/* Phone and touch layouts; loaded last so the original desktop design stays intact. */
@media (max-width:900px) {
  html { scroll-padding-top:calc(84px + env(safe-area-inset-top)); }
  .site-header,.site-header.scrolled,.site-header.menu-open { height:calc(74px + env(safe-area-inset-top)); padding:env(safe-area-inset-top) max(20px,env(safe-area-inset-right)) 0 max(20px,env(safe-area-inset-left)); }
  .site-header .brand.has-logo img { width:155px; max-width:42vw; }
  .desktop-nav { display:none; }
  .menu-toggle { display:block; width:44px; height:44px; padding:5px; }
  .header-actions { gap:8px; }
  .bag-toggle { min-width:44px; min-height:44px; justify-content:center; }
  .bag-label { display:none; }
  .mobile-nav { max-height:calc(100dvh - 74px - env(safe-area-inset-top)); overflow-y:auto; padding:16px 24px 24px; }
  .mobile-nav a,.mobile-nav [data-language-open] { min-height:48px; display:flex; align-items:center; font-size:12px; }
  .mobile-nav [data-language-open] { width:100%; padding:0; border:0; background:none; color:inherit; text-align:left; letter-spacing:.15em; text-transform:uppercase; }
  .hero-stage { touch-action:pan-y pinch-zoom; }
  .hero-scroll.scroll-ready .hero { padding-top:calc(87px + env(safe-area-inset-top)); }
  .hero-scroll.scroll-ready .hero-cta { min-height:44px; }
  .hero-edit-tabs { gap:10px; }
  .hero-edit-tabs button { min-height:44px; padding:8px 3px; font-size:11px; }
  .scene-controls #edit-prev,.scene-controls #edit-next,.scene-controls #edit-count { display:none; }
  .scene-controls #motion-toggle { min-width:44px; min-height:44px; }
  .hero-scroll.scroll-ready .scene-controls { bottom:3px; }
  .replay-reveal { min-height:44px; display:grid; place-items:center; }
  .house-strip { gap:12px 18px; }
  .house-strip button { min-height:44px; }
  .collection-toolbar { flex-wrap:wrap; gap:8px; }
  .filters { width:100%; min-width:0; display:flex; justify-content:flex-start; overflow-x:auto; gap:20px; -webkit-overflow-scrolling:touch; }
  .filter { flex:0 0 auto; min-height:48px; padding:12px 0; font-size:12px; }
  .sort-label { margin-left:auto; padding-top:0; }
  .sort-label select,.catalog-price-filter select,#finder-budget { min-height:44px; font-size:16px; max-width:100%; }
  .catalog-price-filter { flex-wrap:wrap; }
  .product-grid { min-width:0; }
  .product-card,.product-info { min-width:0; }
  .product-title-row h3 { font-size:23px; }
  .product-notes { font-size:11px; line-height:1.6; }
  .product-size,.product-house { font-size:10px; line-height:1.5; }
  .quick-add,.card-purchase .product-detail-button { min-height:44px; font-size:10px; }
  .product-family-tag { font-size:8px; }
  .finder-footer label { flex-wrap:wrap; gap:10px; }
  .finder-result { min-width:0; }
  .finder-result h3 { overflow-wrap:anywhere; }
  .dialog-close,.quantity-controls button { min-width:44px; min-height:44px; }
  #product-dialog { height:100dvh; padding-bottom:env(safe-area-inset-bottom); }
  #product-dialog>.dialog-close { top:calc(12px + env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right)); }
  .pdp-header { height:calc(74px + env(safe-area-inset-top)); padding:env(safe-area-inset-top) 68px 0 20px; gap:12px; }
  .pdp-brand img { width:120px; }
  .pdp-review-bag { font-size:11px; min-height:44px; display:flex; align-items:center; }
  .pdp-breadcrumb { flex-wrap:wrap; gap:8px; line-height:1.6; }
  .pdp-breadcrumb a { min-height:44px; display:inline-flex; align-items:center; }
  .pdp-layout { grid-template-columns:minmax(0,1fr); padding-inline:20px; gap:24px; }
  .pdp-gallery { position:relative; top:auto; }
  .pdp-gallery>.product-visual { max-height:350px; }
  .pdp-copy h1 { font-size:42px; }
  .pdp-specs dl>div { font-size:12px; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:12px; }
  .pdp-add { min-height:48px; }
  .bag-dialog { width:100%; max-width:100%; max-height:100dvh; padding:24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .bag-item { grid-template-columns:42px minmax(0,1fr); gap:12px; }
  .bag-item .quantity-controls { grid-column:2; justify-self:start; }
  .bag-item h3 { font-size:22px; }
  .whatsapp-contact { bottom:calc(12px + env(safe-area-inset-bottom)); right:max(12px,env(safe-area-inset-right)); min-height:44px; padding:10px 14px; font-size:11px; }
  .discovery-dock { width:calc(100% - 24px); max-width:400px; bottom:calc(12px + env(safe-area-inset-bottom)); gap:6px; padding:6px; }
  .discovery-dock a { flex:1; min-height:44px; padding:10px 8px; display:flex; justify-content:center; align-items:center; text-align:center; font-size:11px; }
  .discovery-dock>span { display:none; }
  body:has(.discovery-dock:not([hidden])) .whatsapp-contact { bottom:calc(84px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom:calc(160px + env(safe-area-inset-bottom)); }
  .language-dialog { padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
}
@media (max-width:359px) {
  .product-grid { grid-template-columns:minmax(0,1fr); }
  .product-visual { aspect-ratio:1.15; }
  .product-title-row { justify-content:space-between; }
  .product-title-row h3 { font-size:28px; }
  .language-panel { padding:22px 18px 18px; }
  .language-panel h2 { font-size:28px; }
  .language-options button { padding:14px 16px; }
  .pdp-brand img { width:100px; }
  .pdp-header { gap:8px; }
  .pdp-review-bag { font-size:10px; }
}
/* Keep the mobile header and the main layout in sync on portrait tablets. */
@media (min-width:761px) and (max-width:900px) {
  .hero { grid-template-columns:minmax(0,1fr); gap:24px; padding:108px 7% 30px; }
  .hero-content { width:100%; max-width:720px; margin-inline:auto; }
  .hero h1 { font-size:clamp(52px,8vw,70px); }
  .hero-description { max-width:520px; }
  .hero-stage { width:min(100%,620px); height:500px; margin-inline:auto; }
  .product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px 20px; }
  .product-visual { aspect-ratio:1.05; }
  .product-title-row { flex-wrap:wrap; }
  .product-title-row h3 { font-size:clamp(22px,3vw,27px); }
  .product-notes { font-size:12px; }
  .product-size,.product-house { font-size:11px; }
  .quick-add,.card-purchase .product-detail-button { font-size:11px; }
  .hero-scroll.scroll-ready>.hero {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto minmax(0,1fr);
    gap:14px;
    padding:calc(92px + env(safe-area-inset-top)) 32px 18px;
  }
  .hero-scroll.scroll-ready .hero-content { max-width:720px; align-self:start; }
  .hero-scroll.scroll-ready .hero h1 { font-size:clamp(40px,6vw,58px); line-height:.98; }
  .hero-scroll.scroll-ready .hero h1 br { display:none; }
  .hero-scroll.scroll-ready .hero h1 em { display:inline; margin-left:.15em; }
  .hero-scroll.scroll-ready .hero-eyebrow { margin-bottom:12px; }
  .hero-scroll.scroll-ready .hero-description { display:none; }
  .hero-scroll.scroll-ready .hero-assurance,.hero-scroll.scroll-ready .hero-secondary { display:none; }
  .hero-scroll.scroll-ready .hero-actions { margin-top:12px; }
  .hero-scroll.scroll-ready .hero-cta { min-height:46px; }
  /* The sticky hero has a constrained grid row, so an auto-height stage collapses
     on portrait iPads. Keep a definite stage height for the animated bottle scene. */
  .hero-scroll.scroll-ready .hero-stage { width:min(100%,660px); height:100%; min-height:400px; max-height:780px; justify-self:center; align-self:stretch; border-radius:36% 36% 2px 2px; }
  .hero-scroll.scroll-ready .scene-rig { inset:70px 0 142px; }
  .hero-scroll.scroll-ready .fragrance-slide { inset:3% 20% 2%; }
  .ritual-sauvage { height:80%; top:12%; }
  .ritual-eros { height:68%; top:13%; }
  .ritual-elixir { height:111%; }
  .hero-scroll.scroll-ready .hero-product-copy { left:24px; right:24px; bottom:60px; }
  .hero-scroll.scroll-ready .hero-product-copy h2 { font-size:26px; }
  .hero-scroll.scroll-ready .hero-product-copy>p:last-of-type { max-width:65%; font-size:11px; }
  .hero-scroll.scroll-ready .hero-product-copy>a { font-size:9px; }
  .hero-scroll.scroll-ready .scene-controls { left:24px; right:24px; bottom:5px; }
  .hero-scroll.scroll-ready .scene-progress { left:24px; right:24px; bottom:145px; }
  .hero-scroll.scroll-ready .unfold-caption { left:24px; top:auto; bottom:190px; width:130px; }
}
@media (min-width:761px) and (max-width:1200px) and (orientation:portrait) {
  .hero-scroll.scroll-ready>.hero { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:0; padding:calc(92px + env(safe-area-inset-top)) 32px 18px; }
  .hero-scroll.scroll-ready .hero-content { position:absolute; top:calc(88px + env(safe-area-inset-top)); left:32px; right:32px; z-index:7; max-width:720px; margin-inline:auto; pointer-events:none; }
  .hero-scroll.scroll-ready .hero-content a { pointer-events:auto; }
  .hero-scroll.scroll-ready .hero h1 { font-size:clamp(38px,5.2vw,58px); }
  .hero-scroll.scroll-ready .hero h1 br { display:none; }
  .hero-scroll.scroll-ready .hero h1 em { display:inline; margin-left:.15em; }
  .hero-scroll.scroll-ready .hero-eyebrow { margin-bottom:8px; }
  .hero-scroll.scroll-ready .hero-actions { margin-top:10px; }
  .hero-scroll.scroll-ready .hero-description,.hero-scroll.scroll-ready .hero-assurance,.hero-scroll.scroll-ready .hero-secondary { display:none; }
  .hero-scroll.scroll-ready .hero-stage { width:min(100%,580px); height:76%; min-height:0; max-height:780px; align-self:center; margin:68px auto 0; padding-top:130px; border-radius:48% 48% 2px 2px; }
  .hero-scroll.scroll-ready .stage-edition { display:none; }
  .hero-scroll.scroll-ready .scene-rig { inset:145px 0 135px; }
  .hero-scroll.scroll-ready .fragrance-slide { inset:3% 24% 2%; }
  .ritual-sauvage { height:62%; top:15%; }
  .ritual-eros { height:55%; top:17%; }
  .ritual-elixir { height:92%; }
  .hero-scroll.scroll-ready .hero-product-copy { left:32px; right:32px; bottom:58px; }
  .hero-scroll.scroll-ready .scene-controls { left:32px; right:32px; bottom:5px; }
}
@media (max-width:900px) and (max-height:600px) {
  .hero-scroll.scroll-static>.hero { min-height:0; height:auto; padding:94px 20px 28px; grid-template-columns:minmax(0,1fr); gap:24px; }
  .hero-scroll.scroll-static .hero-content { width:100%; padding:0; text-align:left; }
  .hero-scroll.scroll-static .hero h1 { font-size:clamp(34px,7vw,52px); }
  .hero-scroll.scroll-static .hero-description,.hero-scroll.scroll-static .hero-assurance { display:none; }
  .hero-scroll.scroll-static .hero-stage { width:min(100%,440px); height:470px; margin:auto; }
  .language-logo { width:190px; }
  .language-panel { padding:20px; }
  .language-rule { margin:12px auto; }
  #language-description { margin:12px 0; }
  .language-footnote { margin-top:14px; }
}
@media (hover:none) and (pointer:coarse) {
  .product-visual:hover .bottle,.product-visual:hover .product-photo { transform:none; }
}
/* Keep the required language choice visible without hiding the Home scene. */
@media (max-width:1200px) and (orientation:portrait) {
  .language-dialog {
    position:fixed;
    inset:auto max(12px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    width:auto;
    height:auto;
    max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin:0 auto;
    padding:0;
    overflow:auto;
    background:transparent;
  }
  .language-dialog[open] { display:flex; align-items:flex-end; justify-content:center; }
  .language-dialog::backdrop { background:rgba(38,32,23,.12); backdrop-filter:none; }
  .language-panel { width:100%; max-width:520px; padding:18px 22px 14px; background:rgba(235,223,205,.97); box-shadow:0 12px 36px #40332124; }
  .language-logo { width:min(100%,150px); margin:0 auto; }
  .language-rule { margin:9px auto; }
  .language-panel h2 { font-size:clamp(24px,4vw,30px); }
  #language-description { margin:9px 0 12px; }
  .language-options { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .language-options button { min-height:58px; padding:10px 12px; }
  .language-options strong { font-size:20px; }
  .language-options button>span:last-child { font-size:17px; }
  .language-footnote { margin-top:10px; }
}
