/* Product photography and small-screen layout. Loaded after the theme styles. */
.catalog-layout > div:last-child,
.product-grid,
.product,
.product-info {
  min-width: 0;
}

.product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.product {
  display: flex;
  flex-direction: column;
}

.product-photo {
  position: relative;
  flex: none;
  width: calc(100% - 24px);
  height: auto;
  aspect-ratio: 1;
  margin: 0 12px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d7c49b;
  border-radius: 12px;
  background: #faf9f6;
}

.product-photo img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  display: block;
  object-fit: contain;
  object-position: center;
}

.product-photo.is-placeholder img {
  inset: 0;
  width: 100%;
  height: 100%;
}

.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 15px 16px 17px;
}

.product h3,
.product-buy {
  overflow-wrap: anywhere;
}

.product-info > .product-buy {
  margin-top: auto;
}

@media (min-width: 701px) and (max-width: 1050px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 701px) and (max-width: 920px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .header {
    position: relative;
    top: auto;
  }

  .mainbar {
    grid-template-columns: 112px minmax(0, 1fr) auto;
    grid-template-areas: "logo logo tools" "catalog search search";
    gap: 8px;
    padding: 6px 0 10px;
  }

  .catalog-trigger {
    width: 112px;
    min-height: 46px;
    padding: 0 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .search {
    width: 100%;
  }

  .nav {
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .promotions {
    padding-top: 12px;
  }

  .promo-copy {
    padding: 19px 13px 24px;
  }

  .promo-copy h1,
  .promo-copy h2 {
    line-height: 1.08;
  }

  .catalog-block {
    margin-top: 34px;
    padding: 39px 0 42px;
  }

  .catalog-title h2 {
    line-height: 1.1;
  }

  .filter-toggle {
    width: 100%;
    min-height: 46px;
    justify-content: space-between;
  }

  .filter-toggle i {
    min-width: 30px;
    padding: 0 7px;
  }

  .catalog-layout,
  .catalog-layout > div:last-child {
    min-width: 0;
  }

  .product-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    overflow: visible;
    margin: 0;
    padding: 0;
    scroll-snap-type: none;
  }

  #productGrid {
    scroll-margin-top: 16px;
  }

  .product {
    min-width: 0;
    display: flex;
    flex-direction: column;
    scroll-snap-align: none;
  }

  .card-top {
    height: 48px;
    padding: 0 16px;
  }

  .card-top > span {
    font-size: 12px;
  }

  .heart {
    width: 42px;
    height: 42px;
  }

  .heart svg {
    width: 23px;
    height: 23px;
  }

  .product-photo {
    width: calc(100% - 28px);
    height: auto;
    aspect-ratio: 1;
    margin: 0 14px;
    border-radius: 13px;
  }

  .product-info {
    padding: 17px 17px 18px;
  }

  .product h3 {
    font-size: clamp(19px, 5.5vw, 24px);
    line-height: 1.2;
  }

  .product-attributes {
    margin: 10px 0;
  }

  .product .product-description {
    max-height: none;
    min-height: 0;
    font-size: 13px;
  }

  .product-info > .product-buy {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
  }

  .product-buy > span > b {
    font-size: 20px;
  }

  .product-buy small {
    font-size: 12px;
  }

  .add-selection {
    min-height: 44px;
    width: 100%;
    font-size: 14px;
  }

  .pagination {
    gap: 5px;
  }

  .pagination button,
  .page-ellipsis {
    min-width: 38px;
    height: 42px;
  }

  .cookie-banner {
    bottom: 8px;
    max-height: calc(100dvh - 16px);
    overflow: auto;
    padding: 16px;
  }

  .cookie-banner__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .cookie-banner__actions button {
    min-width: 0;
    min-height: 48px;
    padding: 7px;
    white-space: normal;
    font-size: 13px;
    line-height: 1.2;
  }
}

@media (min-width: 600px) and (max-width: 700px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .offer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .offer-card,
  .offer-help {
    grid-column: auto;
    height: 185px;
    padding: 18px;
  }

  .offer-card h2,
  .offer-help h2 {
    max-width: 59%;
    font-size: 22px;
    line-height: 1.1;
  }

  .offer-card p {
    max-width: 58%;
  }

  .offer-card img,
  .offer-help img,
  .offer-floor img,
  .offer-month img {
    width: 46%;
    height: 100%;
    right: 0;
    bottom: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: center;
  }

  .offer-link {
    left: 18px;
    bottom: 14px;
  }

  .trust-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .trust-strip > div,
  .trust-strip > div:nth-child(2) {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid #ebe6db;
  }

  .trust-strip > div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 380px) {
  .shell {
    width: calc(100% - 24px);
  }

  .mainbar {
    grid-template-columns: 100px minmax(0, 1fr) auto;
  }

  .catalog-trigger {
    width: 100px;
  }

  .tools {
    gap: 3px;
  }

  .tools > * {
    width: 32px;
    height: 36px;
  }

  .promo-copy h1,
  .promo-copy h2 {
    font-size: 27px;
  }
}

/* Compact mobile storefront: simple header, two product columns and tab bar. */
.brand-section {
  grid-template-columns: minmax(220px, .35fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.brand-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 0;
}

#brands {
  scroll-margin-top: 176px;
}

.brand-item {
  min-width: 0;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
}

.brand-item:hover,
.brand-item:focus-visible {
  border-color: #c6b078;
  box-shadow: 0 8px 20px #22272312;
}

.brand-item img {
  width: 100%;
  max-width: 172px;
  height: 62px;
  display: block;
  object-fit: contain;
}

.brand-item img[src$="kerama-marazzi.svg"] {
  filter: brightness(0);
}

.brand-item--firmfit {
  border-color: #214a41;
  background: #214a41;
}

.brand-list .brand-item--firmfit .brand-item__name {
  color: #fff;
}

.brand-list .brand-item__name {
  min-height: 0;
  display: block;
  border: 0;
  color: #353b35;
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.brand-item--grani .brand-item__name {
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
}

.brand-item--altacera .brand-item__name,
.brand-item--artkera .brand-item__name {
  font-family: Georgia, serif;
  font-weight: 400;
  letter-spacing: .06em;
}

.brand-item--delacora .brand-item__name {
  font-family: Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -.03em;
}

.brand-item--monarch .brand-item__name {
  font-family: Arial Black, Arial, sans-serif;
  font-weight: 900;
}

@media (max-width: 1100px) and (min-width: 701px) {
  .brand-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .brand-section {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mobile-bottom-nav {
  display: none;
}

.detail-mobile-menu,
.detail-mobile-search {
  display: none;
}

.favorites-drawer #favoriteItems {
  flex: 1;
  overflow: auto;
  padding: 12px 20px;
}

.favorite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.favorite-row a {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 12px;
}

.favorite-row img {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.favorite-row span {
  min-width: 0;
}

.favorite-row b,
.favorite-row small {
  display: block;
  overflow-wrap: anywhere;
}

.favorite-row b {
  font-size: 14px;
  line-height: 1.3;
}

.favorite-row small {
  margin-top: 4px;
  color: var(--grey);
}

.favorite-row > button {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 22px;
}

.account-contact {
  display: block;
  margin-top: 22px;
  padding: 13px;
  border-radius: 8px;
  background: var(--gold);
  text-align: center;
  font-weight: 700;
}

@media (max-width: 700px) {
  #brands {
    scroll-margin-top: 116px;
  }

  .brand-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .brand-item {
    min-height: 111px;
    gap: 5px;
    padding: 10px 7px;
  }

  .brand-item img {
    max-width: 145px;
    height: 56px;
  }

  .brand-list .brand-item__name {
    font-size: 11px;
  }

  body {
    padding-bottom: calc(65px + env(safe-area-inset-bottom));
  }

  .notice,
  .nav {
    display: none;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .detail-header {
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .detail-header-inner {
    min-height: 64px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .detail-brand {
    justify-self: center;
  }

  .detail-header img {
    width: 96px;
    height: 54px;
  }

  .detail-back {
    display: none;
  }

  .detail-mobile-menu,
  .detail-mobile-search {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
  }

  .detail-mobile-menu svg,
  .detail-mobile-search svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  .detail-photo {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .mainbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-areas: "catalog logo tools" "search search search";
    gap: 5px 8px;
    padding: 6px 0 9px;
  }

  .brand {
    justify-self: center;
  }

  .brand img {
    width: 96px;
    height: 44px;
  }

  .catalog-trigger {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 0;
  }

  .catalog-trigger svg {
    width: 25px;
    height: 25px;
    color: var(--ink);
  }

  .catalog-trigger:hover {
    background: #f1eee6;
    transform: none;
  }

  .tools {
    justify-self: end;
  }

  .tools button {
    display: none !important;
  }

  .tools a {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
  }

  .search {
    height: 45px;
    border-radius: 9px;
    background: #f7f6f2;
  }

  .search button {
    order: -1;
    flex: none;
    width: 43px;
  }

  .search input {
    font-size: 14px;
  }

  .catalog-popover {
    max-height: calc(100dvh - 175px);
    overflow: auto;
  }

  #catalog,
  #route,
  #productGrid {
    scroll-margin-top: 116px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: #e9e8e2;
  }

  .product,
  .product:hover {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 7px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    transform: none;
  }

  .card-top {
    height: 31px;
    padding: 0;
  }

  .card-top > span {
    max-width: calc(100% - 30px);
    overflow: hidden;
    color: #68706a;
    font-size: 9px;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .heart {
    width: 30px;
    height: 30px;
  }

  .heart svg {
    width: 19px;
    height: 19px;
  }

  .product-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .product-photo img,
  .product-photo.is-placeholder img {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .product-info {
    padding: 8px 0 5px;
  }

  .product h3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
  }

  .product-attributes,
  .product .product-description {
    display: none;
  }

  .product-info > .product-buy {
    gap: 7px;
    margin-top: auto;
    padding-top: 11px;
    border: 0;
  }

  .product-buy > span > b {
    font-size: 16px;
    line-height: 1.15;
  }

  .product-buy small {
    font-size: 10px;
    line-height: 1.2;
  }

  .add-selection {
    min-height: 39px;
    padding: 7px 5px;
    font-size: 12px;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 45;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: calc(63px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    padding: 5px 7px env(safe-area-inset-bottom);
    border-top: 1px solid #deded8;
    background: #fff;
    box-shadow: 0 -5px 18px #2227230d;
  }

  .mobile-bottom-nav > * {
    position: relative;
    min-width: 0;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 2px;
    border: 0;
    background: transparent;
    color: #343a35;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
  }

  .mobile-bottom-nav svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  .mobile-bottom-nav i {
    position: absolute;
    top: 0;
    left: calc(50% + 9px);
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 9px;
    background: var(--gold);
    color: var(--ink);
    font-size: 10px;
    font-style: normal;
    line-height: 15px;
  }

  .mobile-bottom-nav i:empty {
    display: none;
  }

  .mobile-bottom-nav > :focus-visible {
    outline: 2px solid var(--gold-dark);
    outline-offset: -2px;
  }

  .toast {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .cookie-banner {
    bottom: calc(71px + env(safe-area-inset-bottom));
  }
}

/* Final mobile composition: one predictable header and a media-first hero. */
@media (max-width: 700px) {
  .header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(83, 76, 61, .12);
    background: rgba(250, 248, 243, .98);
    box-shadow: 0 8px 24px rgba(34, 39, 35, .07);
    backdrop-filter: none;
  }

  .mainbar.shell {
    width: 100%;
    margin: 0;
    padding: 5px 12px 8px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    grid-template-rows: 44px 40px;
    grid-template-areas: "catalog logo tools" "search search search";
    gap: 4px 9px;
  }

  .brand {
    align-self: center;
    justify-self: center;
  }

  .brand picture {
    display: block;
  }

  .brand img {
    width: 150px;
    height: 40px;
  }

  .catalog-trigger,
  .tools a {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border: 1px solid #e6dfd0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 13px rgba(34, 39, 35, .05);
  }

  .catalog-trigger {
    padding: 0;
    color: var(--ink);
    font-size: 0;
  }

  .catalog-trigger svg,
  .tools a svg {
    width: 22px;
    height: 22px;
  }

  .tools {
    gap: 0;
    justify-self: end;
  }

  .tools button {
    display: none !important;
  }

  .tools a {
    display: grid;
    color: #332d20;
  }

  .search {
    width: 100%;
    height: 40px;
    border: 1px solid #e2dbce;
    border-radius: 13px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
  }

  .search button {
    order: -1;
    width: 42px;
    color: #6f6242;
  }

  .search input {
    padding: 0 11px 0 1px;
    font-size: 13px;
  }

  .catalog-popover {
    max-height: calc(100dvh - 98px);
  }

  #catalog,
  #route,
  #productGrid,
  #brands {
    scroll-margin-top: 98px;
  }

  .promotions.shell {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .promo-slide {
    min-height: 0;
    padding: 0;
    border: 1px solid rgba(105, 91, 57, .1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 36px rgba(39, 37, 30, .09);
  }

  .promo-art {
    order: -1;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 0;
  }

  .promo-copy {
    width: 100%;
    max-width: none;
    padding: 21px 18px 54px;
  }

  .promo-copy > span {
    font-size: 8px;
    letter-spacing: .075em;
  }

  .promo-copy h1,
  .promo-copy h2 {
    margin: 12px 0 11px;
    font-size: clamp(28px, 8.1vw, 34px);
    line-height: 1.06;
  }

  .promo-copy h1 br,
  .promo-copy h2 br {
    display: none;
  }

  .promo-copy p {
    font-size: 14px;
    line-height: 1.45;
  }

  .promo-actions {
    width: 100%;
    gap: 13px;
    margin-top: 18px;
  }

  .promo-cta {
    width: 100%;
    min-height: 47px;
    border-radius: 11px;
  }

  .promo-text-link {
    margin-inline: auto;
  }

  .carousel-controls {
    right: auto;
    bottom: 14px;
    left: 50%;
    padding: 7px 10px;
    gap: 0;
    border: 1px solid rgba(72, 67, 53, .09);
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 4px 14px rgba(35, 34, 29, .07);
    backdrop-filter: blur(8px);
    transform: translateX(-50%);
  }

  .carousel-count,
  .autoplay-toggle,
  .slide-arrow {
    display: none;
  }

  .slide-dots {
    gap: 5px;
  }

  .slide-dots button {
    width: 7px;
    height: 7px;
    border-radius: 50%;
  }

  .slide-dots button[aria-selected="true"] {
    width: 22px;
    border-radius: 999px;
  }

  .cookie-banner {
    right: 10px;
    bottom: calc(69px + env(safe-area-inset-bottom));
    left: 10px;
    width: calc(100% - 20px);
    padding: 14px;
    border-radius: 16px;
  }

  .cookie-banner h2 {
    margin-bottom: 4px;
    font-size: 16px;
  }

  .cookie-banner p {
    font-size: 11px;
    line-height: 1.4;
  }

  .cookie-banner__actions {
    gap: 7px;
    margin-top: 10px;
  }

  .cookie-banner__actions button {
    min-height: 41px;
    padding: 5px;
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .offer-card,
  .offer-help {
    height: 218px;
  }

  .offer-card p {
    max-width: 54%;
    font-size: 11px;
    line-height: 1.35;
  }

  .offer-card p br {
    display: none;
  }
}
