/* ALICE mobile final pass — layout only, no automatic animation */
html, body { max-width: 100%; overflow-x: hidden; }
html { scroll-behavior: auto !important; }
.alice-reveal,
.alice-reveal[data-alice-dir],
.alice-stagger > *,
html.alice-page-enter body,
html.alice-page-enter.alice-page-ready body,
html.alice-page-leaving body {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
  animation: none !important;
}
html::after { display: none !important; }

/* Keep manual horizontal rails manual */
.product-grid,
.reviews-grid,
.reviews-horizontal-track,
.empty-cart-products,
.category-grid,
.gallery-grid { animation: none !important; }

@media (max-width: 768px) {
  *, *::before, *::after { box-sizing: border-box; }
  body { width: 100%; min-width: 0; }
  main, section, .section, .page-section { min-width: 0; }
  .container,
  .header-inner,
  .footer-inner,
  .page-container,
  .account-main,
  .account-stage {
    width: calc(100% - 20px) !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
    min-width: 0 !important;
  }

  /* Header */
  .site-header { width: 100%; }
  .header-inner {
    min-height: 62px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 6px !important;
    padding-block: 7px !important;
  }
  .header-actions { display: flex !important; gap: 4px !important; min-width: 0 !important; flex-wrap: nowrap !important; }
  .header-actions:first-child { justify-self: start !important; }
  .mobile-menu-button { justify-self: end !important; }
  .brand-logo, .header-centered-logo { justify-self: center !important; width: 46px !important; height: 46px !important; min-width: 46px !important; }
  .brand-logo img, .header-centered-logo img { width: 46px !important; height: 46px !important; object-fit: cover !important; }
  .icon-button, .cart-button, .mobile-menu-button, .account-button {
    width: 38px !important; height: 38px !important; min-width: 38px !important;
    padding: 0 !important; display: inline-grid !important; place-items: center !important;
  }

  /* Typography and sections */
  .hero-section, .hero, .page-hero { min-height: 0 !important; padding: 28px 0 32px !important; }
  section, .section, .page-section { padding: 34px 0 !important; }
  h1, .hero h1, .hero-copy h1, .page-hero h1 { font-size: clamp(28px, 8vw, 38px) !important; line-height: 1.2 !important; overflow-wrap: anywhere; }
  h2, .section-title, .section-heading h2, .section-head h2 { font-size: clamp(23px, 6.8vw, 30px) !important; line-height: 1.28 !important; overflow-wrap: anywhere; }
  h3 { overflow-wrap: anywhere; }
  p, li, label, small { overflow-wrap: anywhere; }
  .section-heading, .section-head { align-items: flex-end !important; gap: 10px !important; margin-bottom: 18px !important; }

  /* One-column structural layouts */
  .hero-grid, .story-grid, .gift-layout, .review-layout, .product-detail-grid,
  .product-detail, .checkout-layout, .cart-layout, .routine-layout, .contact-layout,
  .content-grid, .account-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .hero-copy, .story-copy, .product-info, .product-gallery { min-width: 0 !important; width: 100% !important; }
  .hero-actions, .form-actions { display: grid !important; grid-template-columns: 1fr !important; gap: 9px !important; }
  .hero-actions .button, .form-actions .button { width: 100% !important; justify-content: center !important; }
  .hero-image-card, .story-visual, .story-placeholder { width: 100% !important; max-width: 100% !important; min-height: 0 !important; }
  .hero-image-card img, .story-visual img, .story-placeholder img { width: 100% !important; height: auto !important; max-height: 380px !important; object-fit: cover !important; }
  .floating-note { position: static !important; width: auto !important; max-width: 100% !important; margin-top: 8px !important; }

  /* Trust / feature cards */
  .trust-grid, .features-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; }
  .trust-grid article, .feature-card { width: 100% !important; min-width: 0 !important; padding: 15px !important; border-radius: 18px !important; }

  /* Manual category rail on home; regular grid on categories page */
  body:not([data-page]) .category-grid {
    display: flex !important; flex-wrap: nowrap !important; gap: 10px !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    scroll-snap-type: x proximity !important; -webkit-overflow-scrolling: touch !important;
    padding: 2px 1px 12px !important; scrollbar-width: none !important;
  }
  body:not([data-page]) .category-grid::-webkit-scrollbar { display: none; }
  body:not([data-page]) .category-grid > * { flex: 0 0 min(62vw, 220px) !important; scroll-snap-align: start !important; }
  body[data-page="categories"] .category-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }

  /* Product grids and rails */
  body[data-page="products"] .product-grid,
  body[data-page="wishlist"] .product-grid,
  body[data-page="product"] .related-products .product-grid,
  body[data-page="categories"] .product-grid {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important; overflow: visible !important; width: 100% !important;
  }
  body:not([data-page]) .featured-section .product-grid,
  body[data-page="gift"] .product-grid,
  body[data-page="cart"] .empty-cart-products,
  .products-horizontal,
  .product-rail {
    display: flex !important; flex-wrap: nowrap !important; gap: 10px !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    scroll-snap-type: x proximity !important; -webkit-overflow-scrolling: touch !important;
    padding: 2px 1px 12px !important; scrollbar-width: none !important;
  }
  body:not([data-page]) .featured-section .product-grid::-webkit-scrollbar,
  body[data-page="gift"] .product-grid::-webkit-scrollbar,
  body[data-page="cart"] .empty-cart-products::-webkit-scrollbar,
  .products-horizontal::-webkit-scrollbar, .product-rail::-webkit-scrollbar { display: none; }
  body:not([data-page]) .featured-section .product-grid > .product-card,
  body[data-page="gift"] .product-grid > .product-card,
  body[data-page="cart"] .empty-cart-products > .product-card,
  .products-horizontal > .product-card, .product-rail > .product-card {
    flex: 0 0 min(72vw, 270px) !important; max-width: 270px !important; scroll-snap-align: start !important;
  }
  .product-card { min-width: 0 !important; width: 100% !important; overflow: hidden !important; display: flex !important; flex-direction: column !important; border-radius: 17px !important; }
  .product-card img, .product-image img { width: 100% !important; aspect-ratio: 1 / 1 !important; height: auto !important; object-fit: cover !important; }
  .product-card .product-info, .product-card .product-content, .product-card-content, .card-content { padding: 10px !important; min-width: 0 !important; }
  .product-card h3, .product-title { font-size: 13px !important; line-height: 1.45 !important; min-height: 38px !important; }
  .product-price, .price-row { display: flex !important; flex-wrap: wrap !important; gap: 4px !important; font-size: 13px !important; }
  .product-actions { display: grid !important; grid-template-columns: 1fr !important; gap: 6px !important; margin-top: auto !important; }
  .product-actions button, .product-actions a, .product-actions .button { width: 100% !important; min-width: 0 !important; padding: 9px 6px !important; font-size: 10.5px !important; justify-content: center !important; }

  /* Reviews: manual rail everywhere */
  .reviews-grid, .reviews-horizontal-track, .public-reviews, #homeReviews {
    display: flex !important; flex-wrap: nowrap !important; gap: 10px !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    scroll-snap-type: x proximity !important; -webkit-overflow-scrolling: touch !important;
    padding: 2px 1px 12px !important; scrollbar-width: none !important;
  }
  .reviews-grid::-webkit-scrollbar, .reviews-horizontal-track::-webkit-scrollbar, .public-reviews::-webkit-scrollbar, #homeReviews::-webkit-scrollbar { display: none; }
  .reviews-grid > *, .reviews-horizontal-track > *, .public-reviews > *, #homeReviews > * {
    flex: 0 0 min(84vw, 310px) !important; max-width: 310px !important; min-height: 210px !important;
    scroll-snap-align: start !important; padding: 16px !important; border-radius: 18px !important;
    overflow: hidden !important; color: #2e2425 !important;
  }
  .review-card p, .public-review p { font-size: 13px !important; line-height: 1.75 !important; color: #2e2425 !important; }
  .review-stars { white-space: nowrap !important; font-size: 14px !important; }

  /* Forms, routine and gift */
  .routine-card, .quiz-shell, .gift-summary, .summary-card, .checkout-card, .content-card,
  .review-summary, .review-form-card, .account-panel, .account-content-card {
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    padding: 16px !important; border-radius: 19px !important;
  }
  .form-grid, .checkout-form-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 11px !important; }
  .field, .field.full { grid-column: auto !important; min-width: 0 !important; }
  input, select, textarea, button { max-width: 100%; }
  input, select, textarea { width: 100% !important; min-width: 0 !important; font-size: 16px !important; }
  body[data-page="gift"] .selected-products { display: grid !important; grid-template-columns: 1fr !important; gap: 8px !important; }
  body[data-page="gift"] .selected-product { display: grid !important; grid-template-columns: minmax(0,1fr) auto !important; gap: 8px !important; align-items: center !important; }

  /* Cart */
  .cart-layout, .checkout-layout { gap: 14px !important; }
  .cart-item { display: grid !important; grid-template-columns: 76px minmax(0,1fr) !important; gap: 10px !important; padding: 10px !important; width: 100% !important; }
  .cart-item img { width: 76px !important; height: 88px !important; object-fit: cover !important; border-radius: 12px !important; }
  .cart-item-actions, .quantity-control { max-width: 100% !important; flex-wrap: wrap !important; }
  .summary-row { display: flex !important; justify-content: space-between !important; gap: 10px !important; font-size: 13px !important; }

  /* Checkout saved address and points */
  .delivery-choice-head, .points-payment-row { display: grid !important; grid-template-columns: 1fr !important; gap: 9px !important; }
  .delivery-choice-actions { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 7px !important; }
  .delivery-choice-actions button, .delivery-choice-actions .button { width: 100% !important; padding-inline: 6px !important; }

  /* Product detail actions */
  body[data-page="product"] .detail-actions { display: grid !important; grid-template-columns: minmax(0,1fr) 44px 44px !important; gap: 7px !important; }
  body[data-page="product"] .detail-actions > * { min-width: 0 !important; }

  /* Account */
  .account-stats { display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 8px !important; }
  .account-order, .order-card { width: 100% !important; min-width: 0 !important; overflow: hidden !important; }
  .account-drawer { width: min(88vw, 330px) !important; max-width: 88vw !important; }

  /* Gallery */
  .gallery-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 8px !important; overflow: visible !important; }
  .gallery-grid img { width: 100% !important; height: auto !important; aspect-ratio: 1/1 !important; object-fit: cover !important; }

  /* Footer */
  .site-footer { padding: 28px 0 14px !important; }
  .footer-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 16px !important; text-align: right !important; }
  .footer-bottom { display: flex !important; flex-direction: column !important; gap: 7px !important; text-align: center !important; }

  /* Drawers and dialogs */
  .main-navigation { width: min(88vw, 330px) !important; max-width: 88vw !important; }
  .modal, .dialog, .search-panel, .drawer, .side-menu, .mobile-menu, .account-search-card {
    width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important; margin: auto !important; border-radius: 18px !important;
  }

  /* Keep every interactive element visible */
  button, .button, a.button, [role="button"] { min-height: 40px; }
  [hidden] { display: none !important; }
}

@media (max-width: 420px) {
  .container, .header-inner, .footer-inner, .page-container, .account-main, .account-stage { width: calc(100% - 16px) !important; }
  body[data-page="products"] .product-grid,
  body[data-page="wishlist"] .product-grid,
  body[data-page="categories"] .product-grid { gap: 7px !important; }
  .product-card .product-info, .product-card .product-content, .product-card-content { padding: 9px !important; }
  .reviews-grid > *, .reviews-horizontal-track > *, .public-reviews > *, #homeReviews > * { flex-basis: 87vw !important; }
}
