/* Storefront mobile / touch layout — CSS only; no JS/backend changes */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* Touch: product card actions always reachable (no hover) */
@media (hover: none), (pointer: coarse) {
  .productActions {
    opacity: 1 !important;
    transform: none !important;
  }

  .productCard:hover,
  .categoryCard:hover {
    transform: none;
  }

  .productCard:hover .productImageWrap img {
    transform: none;
  }
}

/* —— Phones & small tablets —— */
@media (max-width: 899px) {
  .productActions {
    opacity: 1 !important;
    transform: none !important;
    inset: auto 0.4rem 0.4rem;
    gap: 0.25rem;
    display: flex;
    flex-direction: column;
  }

  .productActions button {
    padding: 0.4rem 0.45rem;
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .headerTop {
    gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: max(0.85rem, env(safe-area-inset-right));
  }




  .headerActions {
    gap: 0.1rem;
    flex-shrink: 0;
  }

  .iconBtn,
  .menuBtn {
    width: 38px;
    height: 38px;
  }

  .iconBtn svg {
    width: 20px;
    height: 20px;
  }

  .searchBar {
    flex-wrap: wrap;
    padding: 0 0.85rem 0.75rem;
  }

  .searchBar input {
    min-width: 0;
    width: 100%;
    flex: 1 1 140px;
  }

  .searchBar .accentBtn {
    flex: 0 0 auto;
    padding: 0.65rem 1rem;
  }

  .nav {
    padding: 0 0.85rem 0.85rem;
  }

  .hero {
    padding: 0.65rem 0.75rem 0.35rem;
  }

  .heroFrame,
  .heroContent {
    min-height: 340px;
    border-radius: 14px;
  }

  .heroContent {
    padding: 1.35rem 1rem 2.4rem;
  }

  .heroTitle {
    font-size: clamp(1.35rem, 6.5vw, 1.85rem);
    max-width: 16ch;
    margin-bottom: 0.85rem;
  }

  .heroEyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .heroOffers {
    gap: 0.35rem;
    margin-bottom: 0.75rem;
  }

  .heroOffers span {
    font-size: 0.62rem;
    padding: 0.28rem 0.55rem;
  }

  .heroCtaGroup {
    gap: 0.5rem;
  }

  .heroCta {
    padding: 0.65rem 1.1rem;
    font-size: 0.9rem;
  }

  .siteLogo {
    height: 52px;
    max-width: min(210px, 55vw);
  }

  .siteLogoFooter {
    height: 72px;
    max-width: 280px;
  }

  .authBrand .siteLogo,
  .productPageBrand .siteLogo {
    height: 52px;
  }

  .categories,
  .productSection {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .categories {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .categoryCard {
    padding: 1.25rem 1.1rem;
  }

  .productGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .productMeta {
    padding: 0.7rem 0.7rem 0.9rem;
  }

  .productMeta h3 {
    font-size: 0.88rem;
  }

  .productBrand {
    font-size: 0.65rem;
  }

  .productAttrs span {
    font-size: 0.58rem;
    padding: 0.18rem 0.35rem;
  }

  .productActions button {
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
  }

  .productBadge {
    top: 0.55rem;
    left: 0.55rem;
    font-size: 0.62rem;
    padding: 0.22rem 0.5rem;
  }

  .sectionLabel {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
  }

  .sectionLabel::after {
    width: 48px;
  }

  .footer {
    padding: 2rem 0.85rem 1.25rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  .footerGrid {
    gap: 1.35rem;
  }

  .whatsapp,
  .scrollTop {
    width: 48px;
    height: 48px;
    right: max(0.75rem, env(safe-area-inset-right));
  }

  .whatsapp {
    bottom: calc(4.8rem + env(safe-area-inset-bottom, 0px));
  }

  .scrollTop {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .toast {
    left: 0.75rem;
    right: 0.75rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    transform: translateY(12px);
    text-align: center;
    border-radius: 14px;
  }

  .toast.visible {
    transform: translateY(0);
  }

  .accountMenu {
    width: min(240px, calc(100vw - 1.5rem));
    right: -0.25rem;
  }

  .authModal,
  .quickViewPanel {
    width: 100%;
    max-height: min(94vh, 880px);
    border-radius: 16px;
    padding: 1.1rem;
  }

  .authOverlay,
  .quickViewOverlay {
    padding: 0.65rem;
    align-items: flex-end;
  }

  .quickViewOverlay {
    place-items: end center;
  }

  .qvClose,
  .authClose {
    top: 0.55rem;
    right: 0.55rem;
  }
}

/* —— Narrow phones —— */
@media (max-width: 480px) {



  .iconBtn,
  .menuBtn {
    width: 36px;
    height: 36px;
  }

  .heroFrame,
  .heroContent {
    min-height: 300px;
  }

  .heroContent {
    padding: 1.1rem 0.85rem 2.2rem;
  }

  .heroOffers span {
    font-size: 0.58rem;
    padding: 0.24rem 0.45rem;
  }

  .heroCtaGroup {
    flex-direction: column;
    align-items: stretch;
  }

  .heroCta {
    width: 100%;
    justify-content: center;
  }

  .productGrid {
    gap: 0.55rem;
  }

  .productActions button {
    font-size: 0.68rem;
    padding: 0.4rem 0.45rem;
  }

  .priceRow {
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
  }

  .searchBar {
    flex-direction: column;
    align-items: stretch;
  }

  .searchBar .accentBtn {
    width: 100%;
  }
}

/* —— Very narrow —— */
@media (max-width: 360px) {
  .productGrid {
    grid-template-columns: 1fr;
  }

  .headerTop {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

/* Auth pages */
@media (max-width: 520px) {
  .authPageShell {
    padding: 1.15rem 0.85rem 1.75rem;
    justify-content: flex-start;
    padding-top: max(1.15rem, env(safe-area-inset-top));
  }

  .authCard {
    padding: 1.35rem 1.15rem 1.2rem;
    border-radius: 16px;
  }

  .authCard h1 {
    font-size: 1.3rem;
  }


}

/* Cart */
@media (max-width: 860px) {
  .cartPageMain {
    width: calc(100% - 1.5rem);
    margin: 1rem auto 2rem;
  }

  .cartPageHeader {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }

  .cartList,
  .cartSummary {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .cartEmpty {
    padding: 2rem 1.15rem;
  }
}

@media (max-width: 480px) {
  .cartItem {
    grid-template-columns: 72px 1fr;
    gap: 0.65rem;
  }

  .cartItemMedia {
    width: 72px;
    height: 72px;
  }

  .cartItemBody h2 {
    font-size: 0.92rem;
  }

  .cartItemControls {
    gap: 0.5rem;
  }

  .cartListHead {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Checkout + confirmation */
@media (max-width: 860px) {
  .checkoutPageMain {
    width: calc(100% - 1.5rem);
    margin: 1rem auto 2rem;
  }

  .checkoutPageHeader {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }

  .checkoutFormPanel,
  .checkoutSummaryPanel {
    padding: 1.1rem 1rem 1.2rem;
  }

  .checkoutEmpty,
  .confirmCard {
    padding: 1.5rem 1.15rem;
  }

  .confirmActions {
    flex-direction: column;
  }

  .confirmActions .accentBtn,
  .confirmHomeBtn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .checkoutItem {
    grid-template-columns: 48px 1fr auto;
    gap: 0.55rem;
  }

  .checkoutItem img {
    width: 48px;
    height: 48px;
  }

  .confirmItems li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .paymentOnly {
    padding: 0.8rem 0.85rem;
  }
}

/* Product detail page */
@media (max-width: 800px) {
  .productPageHeader {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }

  .productPageMain {
    width: calc(100% - 1.25rem);
    margin: 0.85rem auto 1.75rem;
  }

  .ppMediaCol {
    gap: 0.7rem;
  }

  .ppColors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 0.4rem;
    overflow: visible;
  }

  .ppColor {
    width: auto;
    padding: 0.25rem;
  }

  .ppColor img {
    height: 44px;
    max-height: 44px;
  }

  .ppColor span {
    font-size: 0.62rem;
  }

  .ppSpecs li {
    grid-template-columns: 88px 1fr;
  }

  .ppSecondary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }
}

/* Wishlist drawer — full bleed already at 520; tighten padding */
@media (max-width: 520px) {
  .wishlistHead,
  .wishlistBody,
  .wishlistFoot {
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }

  .wishlistItem {
    grid-template-columns: 64px 1fr;
  }

  .wishlistItem img {
    width: 64px;
    height: 64px;
  }
}

/* Shared compact page headers (cart / checkout / product) */
@media (max-width: 480px) {

}
