/* Mobile composition: keep the storefront readable and touch-friendly without
   changing the native purchase, drawer, or carousel behavior. */

@media (max-width: 1024px) {
  /* The Lucam logo is light; keep the mobile header on the brand surface so
     it remains visible even when remote header settings fall back to white. */
  .header-layout-1-shell,
  [data-header-layout="layout-1"],
  [data-header-layout][data-header-layout="layout-2"] .header-top,
  [data-header-layout="layout-3"] .section-header-navigation,
  [data-header-layout="layout-3"] .header-navigation-wrapper,
  [data-header-layout="layout-3"] .header-navigation {
    background-color: #4b136c !important;
    color: #ffffff;
  }

  [data-header-layout="layout-1"] .header-layout-1__store-name,
  [data-header-layout][data-header-layout="layout-2"] .header-top,
  [data-header-layout="layout-3"] .header-navigation {
    color: #ffffff;
  }

  /* Match the compiled desktop selector; equal side columns center the logo. */
  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content {
    display: grid;
    grid-template-columns: minmax(3.5rem, 1fr) minmax(0, 14rem) minmax(3.5rem, 1fr);
    grid-template-rows: minmax(4rem, auto) auto;
    align-items: center;
    column-gap: .75rem;
    row-gap: .5rem;
    height: auto;
    min-height: 4.5rem;
    padding: .5rem 1rem .75rem;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-button.mobile {
    display: flex;
    justify-self: start;
    grid-column: 1;
    grid-row: 1;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: .35rem;
    justify-content: center;
    gap: .25rem;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-button.mobile .button-line {
    width: 100%;
    height: 2px;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content .header-logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    width: min(58vw, 14rem);
    max-width: 100%;
    height: auto !important;
    margin: 0 !important;
    text-align: center;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content .header-logo .header-image {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 3.25rem;
    object-fit: contain;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content .header-actions {
    display: contents;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content .options-wrapper {
    display: none !important;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content .header-cart {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-width: 2.5rem;
    margin: 0;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content .header-cart svg {
    width: 2rem;
    height: 2rem;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content .header-cart .cart-quantity {
    width: 1.35rem;
    height: 1.35rem;
    font-size: .7rem;
    line-height: 1.35rem;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-top .header-content .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none !important;
    margin: 0;
  }

  [data-header-layout][data-header-layout="layout-2"] .header-menu {
    display: none;
  }
}

@media (max-width: 767px) {
  body {
    overflow-x: hidden;
  }

  /* Catalog pages need a smaller rhythm on narrow screens. */
  .catalog-layout {
    padding-inline: .75rem;
    padding-bottom: 2rem;
  }

  .catalog-header__heading {
    gap: .75rem;
  }

  .catalog-header__brand {
    width: min(26vw, 7rem);
    max-height: 2.75rem;
  }

  .catalog-toolbar {
    gap: .5rem;
    margin-top: 1rem;
    padding-block: .7rem;
  }

  .catalog-toolbar__primary {
    gap: .5rem;
  }

  .catalog-filter-trigger {
    min-height: 2.75rem;
    padding-inline: .8rem;
    white-space: nowrap;
  }

  .catalog-toolbar > label {
    min-width: 0;
  }

  .catalog-toolbar select {
    min-width: 0;
    max-width: 9.5rem;
    padding-inline: .75rem 2rem;
    font-size: .75rem;
  }

  .catalog-results {
    gap: 1rem;
    padding-top: 1rem;
  }

  .catalog-products-grid,
  .catalog-products-grid--editorial {
    gap: .75rem;
  }

  .catalog-products-grid product-card .product--card_info {
    padding-inline: .5rem;
  }

  /* Keep product titles and prices from creating horizontal overflow. */
  product-card .product-card-title,
  product-card .product-pricing__main,
  product-card .product-pricing__installment,
  product-card .product-pricing__discount {
    overflow-wrap: anywhere;
  }

  /* PDP: show the content in a predictable sequence before the sticky buy
     action appears, while leaving the native mobile carousel untouched. */
  #product-details.product-page-shell {
    row-gap: 1rem;
    margin-top: .75rem;
    margin-bottom: 2rem;
  }

  #product-details.product-page-shell > .product-layout-breadcrumb {
    margin-bottom: 0;
  }

  #product-details.product-page-shell .product-primary-info {
    gap: .5rem;
    padding-block: .5rem 0;
  }

  #product-details.product-page-shell .product-primary-info h1 {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    line-height: 1.2;
  }

  #product-details.product-page-shell .product-primary-info > .flex {
    gap: .5rem;
  }

  #product-details.product-page-shell #product-summary {
    gap: .75rem;
  }

  #product-details.product-page-shell .product-shipping-panel {
    margin-top: .75rem;
  }

  #product-details.product-page-shell > .product-details__content {
    margin-top: 1rem;
  }

  #product-details.product-page-shell .product-layout-gallery .embla__slide > div {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: .75rem;
    background: var(--color-base-200);
  }

  #product-details.product-page-shell .product-layout-gallery .embla__slide img,
  #product-details.product-page-shell .product-layout-gallery .embla__slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  #product-details.product-page-shell .product-layout-gallery [data-carousel-dot] {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }

  /* The mobile menu is opened from the header trigger; preserve a comfortable
     panel width on very narrow devices. */
  .mobile-navigation-drawer {
    --mobile-navigation-panel-width: min(92vw, 22rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-header-layout][data-header-layout="layout-2"] *,
  #product-details.product-page-shell * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
