/* The mobile entrance shares the original boutique's photographic composition.
   This backdrop is independent of the interactive rails: it never fixes or
   transforms their scroll container. */
.storefront-collage { display: none; }

@media (max-width: 900px) {
  body.storefront {
    position: relative;
    --catalog-ground: #fffaf0;
    --mobile-audience-card-width: clamp(130px, calc((100vw - 50px) / 2), 210px);
    --editorial-green: #28533b;
    --editorial-gold: #e6d3a6;
    background: var(--catalog-ground);
  }
  body.storefront .storefront-collage {
    display: grid;
    position: absolute;
    inset: 0 0 auto;
    z-index: 0;
    height: 1000px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 4px;
    overflow: hidden;
    opacity: .26;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(#000 0%, #000 70%, transparent 100%);
    mask-image: linear-gradient(#000 0%, #000 70%, transparent 100%);
  }
  body.storefront .storefront-collage img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    object-fit: cover;
    border-radius: 12px;
    transform: rotate(-3deg);
  }
  body.storefront .storefront-collage img:nth-child(3n) { transform: rotate(3deg); }
  body.storefront .storefront-collage img:nth-child(4n) { transform: translateY(9px) rotate(1deg); }
  body.storefront > main,
  body.storefront > .footer { position: relative; z-index: 1; }

  body.storefront .header {
    position: relative;
    top: auto;
    z-index: 5;
    grid-template-rows: auto;
    gap: 0;
    padding: 12px 14px 6px;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  body.storefront .header > .brand img {
    width: clamp(154px, 44vw, 196px);
    height: auto;
    filter: none;
    opacity: 1;
    mix-blend-mode: normal;
  }
  body.storefront .header > #bag-button {
    padding: 9px 11px;
    gap: 7px;
    min-height: 46px;
    border-color: #c9d7ac;
    background: #edf3de;
    color: #286347;
  }
  body.storefront #bag-count { background: #286347; }
  body.storefront #bag-button .bag-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  body.storefront .service-strip { display: none; }
  body.storefront:not(.mobile-browse-ready) #recently-viewed { display: none; }
  body.storefront #coleccion {
    padding-top: 18px;
    padding-inline: 18px;
    background: transparent;
    scroll-margin-top: 18px;
  }
  body.storefront .catalog-content {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.storefront #mobile-audiences:not(.is-looping) { justify-content: center; }
  body.storefront .mobile-discovery { margin-bottom: 12px; }
  body.storefront #mobile-discovery:not([data-audience="all"]) #mobile-audiences { display: none; }
  body.storefront .mobile-discovery-header {
    gap: 12px;
    margin-bottom: 22px;
  }
  body.storefront .mobile-discovery-header h2 {
    color: var(--editorial-green);
    font-size: clamp(1.65rem, 7.3vw, 2.25rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.025em;
  }
  body.storefront #mobile-discovery[data-audience="all"] .mobile-discovery-header {
    display: block;
    margin-bottom: 30px;
  }
  body.storefront #mobile-discovery[data-audience="all"] .mobile-discovery-actions { display: none; }
  body.storefront #mobile-discovery[data-audience="all"] h2 {
    max-width: 18ch;
    margin-inline: auto;
    text-align: center;
    text-wrap: balance;
  }
  body.storefront .mobile-reset-selection {
    min-height: 44px;
    border-color: #c9b78e;
    background: #fffaf0;
    color: var(--editorial-green);
  }
  body.storefront #mobile-audiences .mobile-audience-card {
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body.storefront .mobile-audience-name {
    grid-row: 1;
    color: var(--editorial-green);
    font: 600 clamp(1.15rem, 5.1vw, 1.55rem)/1.2 var(--serif);
    text-align: center;
  }
  body.storefront .mobile-audience-image {
    grid-row: 2;
    aspect-ratio: 2 / 3;
    border: 2px solid var(--editorial-gold);
    border-radius: 24px;
    background: #efe3c9;
    box-shadow: 0 9px 16px -14px #765b38;
  }
  body.storefront .mobile-audience-image img,
  body.storefront .mobile-category-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: inherit;
  }
  body.storefront .mobile-audience-image img {
    /* Show the entire image within its frame. */
    object-fit: contain;
  }
  body.storefront #mobile-audiences .mobile-audience-card[aria-pressed="true"] {
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  body.storefront .mobile-audience-card[aria-pressed="true"] .mobile-audience-image {
    border-color: #315c42;
    box-shadow: 0 0 0 2px #fffaf0;
  }
  body.storefront .mobile-category-image {
    aspect-ratio: 2 / 3;
    border: 1px solid var(--editorial-gold);
    border-radius: 18px;
    background: #efe3c9;
  }
  body.storefront .mobile-category-name { color: var(--editorial-green); }
  body.storefront .mobile-category-card[aria-pressed="true"] .mobile-category-image {
    border-color: #315c42;
  }
  body.storefront .mobile-discovery-empty-note {
    margin: 8px 0 0;
    color: #5e584b;
    font-size: .78rem;
  }
  body.storefront .mobile-rail-label,
  body.storefront .mobile-subcategory-label { color: #47624b; }
  body.storefront #mobile-socials {
    width: 100%;
    max-width: 420px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 12px auto 24px;
    padding-top: 8px;
    border: 0;
    gap: 8px;
  }
  body.storefront #mobile-socials:not([hidden]) { display: grid; }
  body.storefront #mobile-socials .miloria-social-link {
    flex-direction: column;
    gap: 8px;
    min-height: 84px;
    font-size: 1rem;
    font-weight: 700;
  }
  body.storefront #mobile-socials .miloria-social-icon {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }
  body.storefront #mobile-socials .miloria-social-icon svg { width: 28px; height: 28px; }
  body.storefront .footer #socials .miloria-social-link { gap: 10px; min-height: 48px; font-size: 1rem; }
  body.storefront .footer #socials .miloria-social-icon { width: 40px; height: 40px; flex-basis: 40px; }
  body.storefront .footer #socials .miloria-social-icon svg { width: 24px; height: 24px; }
  body.storefront .catalog-toolbar,
  body.storefront #catalog-filter-summary,
  body.storefront #catalog-results,
  body.storefront .recently-viewed {
    background: rgb(255 250 240 / 94%);
    border-radius: 16px;
  }
  body.storefront .buy-guide { background: rgb(255 250 240 / 86%); }
}

@media (max-width: 359px) {
  body.storefront .header { padding-inline: 10px; }
  body.storefront .header > .brand img { width: 146px; }
  body.storefront .header > #bag-button { padding-inline: 8px; gap: 5px; }
  body.storefront #coleccion { padding-inline: 14px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  body.storefront { --mobile-audience-card-width: clamp(132px, 36vh, 168px); }
  body.storefront .header > .brand img { width: 138px; }
  body.storefront .storefront-collage { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body.storefront #coleccion { padding-top: 8px; }
  body.storefront #mobile-discovery[data-audience="all"] h2 { max-width: 30ch; font-size: 1.7rem; }
  body.storefront #mobile-discovery[data-audience="all"] .mobile-discovery-header { margin-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  body.storefront .storefront-collage img { transform: none; }
}
