/* =========================================================
   Purefit Responsive Overrides
   ========================================================= */

.mobile-only {
  display: block;
}

.desktop-only {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.overlay-open #main-scroll {
  overflow: hidden;
}

.page-grid-2 {
  display: grid;
  gap: 20px;
}

.page-grid-3 {
  display: grid;
  gap: 20px;
}

.product-page-grid,
.cart-page-grid,
.account-shell {
  display: grid;
  gap: 24px;
}

.product-gallery-stack,
.support-card-grid,
.stats-grid,
.kpi-grid {
  display: grid;
  gap: 14px;
}

.search-results-grid {
  display: grid;
  gap: 12px;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stack-sm {
  display: grid;
  gap: 10px;
}

.stack-md {
  display: grid;
  gap: 16px;
}

.stack-lg {
  display: grid;
  gap: 24px;
}

@media (min-width: 640px) {
  .page-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-card-grid,
  .stats-grid,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }

  .desktop-only {
    display: block !important;
  }

  .page-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-page-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
    gap: 36px;
    align-items: start;
  }

  .cart-page-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 36px;
    align-items: start;
  }

  .account-shell {
    grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .product-gallery-stack {
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: start;
  }

  .support-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .cart-page-grid {
    gap: 48px;
  }

  .search-results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .footer-copy {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 767px) {
  :root {
    --nav-h: 58px;
  }

  body[data-page="contact"] .catalog-stage {
    padding-inline: 20px;
    padding-bottom: 8px;
  }

  body[data-page="contact"] .catalog-stage-top {
    gap: 10px;
  }

  body[data-page="contact"] .catalog-stage-copy {
    gap: 4px;
  }

  body[data-page="contact"] .catalog-stage-actions {
    display: none;
  }

  body[data-page="contact"] .contact-grid {
    padding-inline: 16px;
    gap: 14px;
  }

  body[data-page="contact"] .contact-info {
    gap: 12px;
  }

  body[data-page="contact"] .contact-info-card,
  body[data-page="contact"] .contact-form-card {
    padding: 18px;
    border-radius: 22px;
  }

  body[data-page="contact"] .contact-info-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 4px 14px;
    align-items: start;
  }

  body[data-page="contact"] .contact-info-card .contact-info-icon {
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  body[data-page="contact"] .contact-info-card .contact-info-title {
    margin: 2px 0 0;
    font-size: 15px;
    line-height: 1.2;
  }

  body[data-page="contact"] .contact-info-card .contact-info-text {
    font-size: 13.5px;
    line-height: 1.55;
  }

  body[data-page="contact"] .contact-info-card .contact-info-text a {
    word-break: break-word;
  }

  body[data-page="contact"] .contact-social-row {
    margin-top: 6px;
    gap: 8px;
  }

  body[data-page="contact"] .contact-social-row .footer-social {
    width: 34px;
    height: 34px;
  }

  body[data-page="contact"] .contact-form-card .surface-title {
    font-size: 20px;
  }

  body[data-page="contact"] .contact-form-stack {
    margin-top: 14px;
    gap: 12px;
  }

  body[data-page="contact"] .contact-form-card .form-group {
    margin-bottom: 0;
  }

  body[data-page="contact"] .contact-form-card .form-row {
    gap: 12px;
  }

  body[data-page="contact"] .contact-form-card .form-label {
    margin-bottom: 6px;
  }

  body[data-page="contact"] .contact-form-card .form-input,
  body[data-page="contact"] .contact-form-card .form-select {
    height: 48px;
    border-radius: 16px;
  }

  body[data-page="contact"] .contact-form-card .form-textarea {
    min-height: 156px;
    border-radius: 18px;
  }

  body[data-page="contact"] .contact-form-card .btn-primary {
    width: 100%;
    height: 50px;
    margin-top: 4px;
  }

  body[data-page="product"] .product-shell-wrap {
    padding-top: 2px;
  }

  body[data-page="product"] .section-wrap > .w.pad {
    padding-inline: 12px;
  }

  body[data-page="product"] .product-header {
    gap: 10px;
    padding-bottom: 0;
  }

  body[data-page="product"] .product-header-top {
    gap: 10px;
  }

  body[data-page="product"] .product-header-copy {
    gap: 6px;
    max-width: none;
  }

  body[data-page="product"] .product-header-kicker {
    font-size: 8.5px;
    letter-spacing: 0.18em;
  }

  body[data-page="product"] .product-header-title {
    font-size: clamp(30px, 10.6vw, 40px);
    line-height: 0.94;
    letter-spacing: -0.03em;
  }

  body[data-page="product"] .product-header-sub {
    font-size: 11.5px;
    line-height: 1.48;
    max-width: none;
  }

  body[data-page="product"] .product-header-meta {
    justify-content: flex-start;
    gap: 8px;
  }

  body[data-page="product"] .product-header-meta .chip,
  body[data-page="product"] .product-header-review-link {
    font-size: 11px;
  }

  body[data-page="product"] .product-header-bar {
    padding-top: 8px;
  }

  body[data-page="product"] .breadcrumbs {
    gap: 6px;
    font-size: 10px;
    line-height: 1.4;
    flex-wrap: wrap;
  }

  body[data-page="product"] .product-page-grid {
    gap: 16px;
  }

  body[data-page="product"] .product-visual-card .surface-inner,
  body[data-page="product"] .product-summary-card .surface-inner {
    padding: 14px;
  }

  body[data-page="product"] .product-detail-tabs {
    padding: 18px 14px;
    border-radius: 20px;
  }

  body[data-page="product"] .product-detail-tabs-head {
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .product-visual-inner.product-gallery-stack .product-visual-frame {
    order: 1;
  }

  .product-visual-inner.product-gallery-stack .product-thumb-list {
    order: 2;
    display: flex;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    padding: 2px 2px 6px;
    margin: 0 -2px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .product-visual-inner.product-gallery-stack .product-thumb-list::-webkit-scrollbar {
    display: none;
  }

  .product-visual-inner.product-gallery-stack .product-thumb {
    flex: 0 0 76px;
    width: 76px;
    min-width: 76px;
    height: 76px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
  }

  .product-visual-inner.product-gallery-stack .product-thumb img {
    object-fit: contain;
    padding: 8px;
    background: #fff;
  }

  #product-modal .modal-card {
    max-height: min(90dvh, 90vh);
    border-radius: 28px 28px 0 0;
  }

  #product-modal .modal-scroll {
    display: flex;
    flex-direction: column;
  }

  #product-modal .modal-hero {
    aspect-ratio: auto !important;
    min-height: calc(min(36dvh, 304px) + 18px);
    max-height: none;
    padding: 18px 16px 0;
    align-items: center;
    justify-content: center;
  }

  #product-modal .modal-hero img {
    width: auto;
    height: auto;
    max-width: min(68vw, 240px);
    max-height: min(36dvh, 304px);
    object-fit: contain;
  }

  #product-modal .modal-info {
    padding: 16px 18px 14px;
  }

  #product-modal .modal-brand {
    margin-bottom: 4px;
  }

  #product-modal .modal-name {
    font-size: 22px;
    line-height: 1.12;
    margin-bottom: 8px;
  }

  #product-modal .modal-rating {
    margin-bottom: 10px;
  }

  #product-modal .modal-price-row {
    gap: 8px;
    margin-bottom: 10px;
  }

  #product-modal .modal-price {
    font-size: 28px;
  }

  #product-modal .chip-row {
    gap: 6px;
  }

  #product-modal .chip {
    font-size: 10px;
    padding: 5px 9px;
  }

  #product-modal .modal-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 10px;
    font-size: 12.5px;
    line-height: 1.5;
  }

  #product-modal .modal-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  #product-modal .modal-wish {
    width: 48px;
    height: 48px;
  }

  #product-modal .modal-view,
  #product-modal .modal-add {
    height: 48px;
    font-size: 13px;
  }

  #announce-bar {
    max-height: min(var(--bar-h), 44px);
  }

  #announce-bar::before,
  #announce-bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
  }

  #announce-bar::before {
    left: 0;
    width: 18px;
    background: linear-gradient(90deg, var(--announce-bg-left, var(--ink)) 0%, var(--announce-bg-left-0, rgba(10, 9, 8, 0)) 100%);
  }

  #announce-bar::after {
    right: 28px;
    width: 34px;
    background: linear-gradient(270deg, var(--announce-bg-right, var(--ink)) 0%, var(--announce-bg-right-0, rgba(10, 9, 8, 0)) 100%);
  }

  .announce-track {
    padding-left: 10px;
    padding-right: 44px;
  }

  .announce-item {
    gap: 8px;
    margin-right: 36px;
  }

  .announce-close {
    right: 8px;
    padding: 4px;
    z-index: 2;
  }

  #top-nav {
    height: 58px;
    padding: 0 14px;
  }

  .brand-mark {
    font-size: 20px;
    letter-spacing: 0.08em;
  }

  .brand-mark-logo .brand-logo {
    max-height: 38px;
    max-width: 180px;
  }

  .nav-actions {
    gap: 2px;
  }

  .nav-btn {
    width: 36px;
    height: 36px;
  }

  .nav-account-avatar {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  #account-menu-overlay {
    background: rgba(10, 9, 8, 0.26);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #account-menu {
    top: auto;
    right: 12px;
    left: auto;
    bottom: calc(var(--bot-h) + 10px + env(safe-area-inset-bottom));
    width: min(320px, calc(100vw - 24px));
    max-height: min(56vh, 440px);
    padding: 10px;
    border-radius: 22px;
    background: #faf8f5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 18px 34px rgba(10, 9, 8, 0.16);
    overflow-y: auto;
    transform-origin: bottom right;
  }

  .account-menu-head {
    gap: 10px;
    padding-bottom: 10px;
  }

  .account-menu-avatar {
    width: 44px;
    height: 44px;
  }

  .account-menu-close {
    width: 34px;
    height: 34px;
  }

  .account-menu-list,
  .account-menu-signout {
    gap: 5px;
  }

  .account-menu-link {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 15px;
  }

  .catalog-stage.shop-stage {
    padding: 16px 12px 6px;
  }

  .catalog-stage.shop-stage .catalog-stage-copy {
    gap: 4px;
  }

  .catalog-stage.shop-stage .catalog-stage-kicker {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .catalog-stage.shop-stage .catalog-stage-title {
    font-size: 24px;
  }

  .catalog-stage.shop-stage .catalog-stage-sub {
    font-size: 11.5px;
    line-height: 1.5;
  }

  .catalog-stage.shop-stage .catalog-stage-bar {
    margin-top: 10px;
  }

  .catalog-stage.shop-stage .breadcrumbs {
    gap: 6px;
    font-size: 10px;
  }

  .shop-catalog-wrap {
    padding-top: 2px;
  }

  body[data-page="shop"] .shop-toolbar {
    gap: 10px;
    padding-inline: 12px;
  }

  body[data-page="shop"] .shop-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 10px;
    align-items: stretch;
    width: 100%;
  }

  body[data-page="shop"] .shop-search-input {
    min-width: 0;
    width: 100%;
    border-radius: var(--rpill);
    padding-left: 46px;
    padding-right: 14px;
  }

  body[data-page="shop"] .shop-search-submit {
    left: 8px;
    width: 32px;
    height: 32px;
  }

  body[data-page="shop"] .shop-filter-btn {
    display: flex;
    width: 46px;
    padding: 0;
    border-radius: var(--rpill);
    justify-content: center;
    flex-shrink: 0;
  }

  body[data-page="shop"] .shop-filter-btn span {
    display: none;
  }

  body[data-page="shop"] .shop-count-sort {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
  }

  body[data-page="shop"] .shop-count {
    font-size: 11px;
  }

  body[data-page="shop"] .shop-sort-form {
    width: auto;
    margin-left: auto;
    justify-self: end;
  }

  body[data-page="shop"] .shop-sort-field {
    gap: 10px;
    justify-content: flex-end;
  }

  body[data-page="shop"] .shop-sort-label {
    font-size: 14px;
  }

  body[data-page="shop"] .shop-sort-select-wrap {
    width: min(100%, 202px);
    min-width: 0;
    max-width: 202px;
  }

  body[data-page="shop"] .shop-sort-select,
  body[data-page="shop"] .shop-sort-trigger {
    height: 38px;
    padding: 0 31px 0 11px;
    font-size: 12px;
  }

  body[data-page="shop"] .shop-sort-select-icon {
    right: 14px;
    width: 13px;
    height: 13px;
  }

  body[data-page="shop"] .shop-sort-menu {
    top: calc(100% + 7px);
    padding: 5px;
    border-radius: 10px;
  }

  body[data-page="shop"] .shop-sort-option {
    gap: 8px;
    padding: 9px 10px;
    font-size: 12px;
    border-radius: 8px;
  }

  body[data-page="shop"] .shop-sort-option-check {
    width: 13px;
    height: 13px;
  }

  body[data-page="shop"] .shop-sort-submit {
    margin-top: 10px;
    margin-left: 0;
  }

  body[data-page="shop"] .cat-strip,
  body[data-page="shop"] .chip-row {
    flex-wrap: wrap;
    overflow: visible;
    gap: 10px;
    padding-bottom: 0;
  }

  body[data-page="shop"] .cat-pill,
  body[data-page="shop"] .sort-btn,
  body[data-page="shop"] .chip {
    max-width: 100%;
    padding: 8px 14px;
  }

  body[data-page="shop"] .shop-catalog-wrap > .w > .pad {
    padding-inline: 12px;
  }

  body[data-page="shop"] .shop-edge-grid {
    margin-inline: -16px;
    gap: 10px;
  }

  body[data-page="shop"] .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-page="shop"] .product-card {
    border-radius: 14px;
  }

  body[data-page="shop"] .card-img img {
    padding: 8px;
  }

  body[data-page="shop"] .card-body {
    padding: 10px 10px 12px;
  }

  body[data-page="shop"] .newsletter-band .pad,
  body[data-page="shop"] .main-footer .pad {
    padding-inline: 12px;
  }

  body[data-page="shop"] .newsletter-band .pad {
    padding-top: 28px;
    padding-bottom: 14px;
  }

  body[data-page="shop"] .footer-surface {
    border-radius: 10px;
    padding: 18px 16px 12px;
  }

  body[data-page="shop"] .footer-grid {
    gap: 12px;
  }

  body[data-page="index"] .section-head,
  body[data-page="index"] .newsletter-band .pad,
  body[data-page="index"] .main-footer .pad {
    padding-inline: 12px;
  }

  body[data-page="index"] .section-wrap > .w.pad,
  body[data-page="index"] .section-wrap > .w > .cat-strip.pad {
    padding-inline: 12px;
  }

  body[data-page="index"] .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-page="index"] .product-card {
    border-radius: 14px;
  }

  body[data-page="index"] .card-img img {
    padding: 8px;
  }

  body[data-page="index"] .card-body {
    padding: 10px 10px 12px;
  }

  body[data-page="index"] .newsletter-band .pad {
    padding-top: 28px;
    padding-bottom: 14px;
  }

  body[data-page="index"] .footer-surface {
    border-radius: 10px;
    padding: 18px 16px 12px;
  }

  body[data-page="index"] .footer-grid {
    gap: 12px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]) .newsletter-band .pad,
  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]) .main-footer .pad {
    padding-inline: 12px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]) .newsletter-band .pad {
    padding-top: 28px;
    padding-bottom: 14px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]) .footer-surface {
    border-radius: 10px;
    padding: 18px 16px 12px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]) .footer-grid {
    gap: 12px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]):not([data-page="shop"]):not([data-page="index"]) .pad:has(.product-grid) {
    padding-inline: 12px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]):not([data-page="shop"]):not([data-page="index"]) .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]):not([data-page="shop"]):not([data-page="index"]) .product-grid.product-grid--compact {
    width: 100%;
    margin: 0;
    justify-content: stretch;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]):not([data-page="shop"]):not([data-page="index"]) .product-card {
    border-radius: 14px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]):not([data-page="shop"]):not([data-page="index"]) .card-img img {
    padding: 8px;
  }

  body:not([data-page="login"]):not([data-page="register"]):not([data-page="forgot-password"]):not([data-page="reset-password"]):not([data-page="shop"]):not([data-page="index"]) .card-body {
    padding: 10px 10px 12px;
  }

  body[data-page="index"] .hero-content {
    padding: 22px 18px 24px;
    max-width: 320px;
  }

  body[data-page="index"] .hero-headline {
    font-size: clamp(24px, 8.5vw, 34px);
    line-height: 0.98;
    margin-bottom: 8px;
  }

  body[data-page="index"] .hero-sub {
    max-width: 26ch;
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 18px;
  }

  body[data-page="order-success"] .confirmation-actions,
  body[data-page="thank-you"] .confirmation-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 12px;
  }

  body[data-page="order-success"] .confirmation-actions > a,
  body[data-page="order-success"] .confirmation-actions > button,
  body[data-page="thank-you"] .confirmation-actions > a,
  body[data-page="thank-you"] .confirmation-actions > button {
    width: 100%;
  }

  body[data-page="order-success"] .confirmation-delivery-copy,
  body[data-page="thank-you"] .confirmation-delivery-copy {
    color: var(--ink3);
    font-size: 14px;
    line-height: 1.7;
  }

  body[data-page="order-success"] .confirmation-card,
  body[data-page="thank-you"] .confirmation-card {
    padding-bottom: 20px;
  }

  .footer-surface {
    padding-bottom: 16px;
  }

  .footer-contact-value {
    line-height: 1.45;
  }

  .footer-copy {
    display: grid;
    justify-content: flex-start;
    align-items: start;
    gap: 6px;
    margin-top: 8px;
    padding-top: 10px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    font-size: 10.5px;
    line-height: 1.45;
  }

  .footer-credit {
    flex-wrap: wrap;
    gap: 4px 6px;
  }

  #main-scroll {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  body:not([data-page=login]):not([data-page=register]):not([data-page=forgot-password]):not([data-page=reset-password]) #main-scroll {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  body:not([data-page=login]):not([data-page=register]):not([data-page=forgot-password]):not([data-page=reset-password]) .main-footer .footer-surface {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  html,
  body {
    overscroll-behavior-y: contain;
  }

  .cat-strip,
  .chip-row,
  .search-chips,
  .brand-rail-shell,
  .acct-mobile-tabs,
  .order-filter-row {
    touch-action: pan-x;
    overscroll-behavior-x: contain;
  }

  /* Keep the mobile search overlay chips fully visible instead of clipping the last chip. */
  #search-overlay .search-chips {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 8px;
    touch-action: auto;
    overscroll-behavior-x: auto;
  }

  .page-header,
  .section-head {
    padding-left: 20px;
    padding-right: 20px;
  }

  .newsletter-form {
    width: 100%;
  }

  #image-preview-overlay {
    background: rgba(10, 9, 8, 0.9);
    backdrop-filter: blur(6px);
  }

  #image-preview-modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  #image-preview-modal .image-preview-panel {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    padding: calc(56px + env(safe-area-inset-top)) 10px calc(16px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  #image-preview-modal .image-preview-panel img {
    width: auto;
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 76px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  #image-preview-modal[data-preview-shape="portrait"] .image-preview-panel img {
    max-width: min(calc(100vw - 20px), 440px);
    max-height: calc(100dvh - 68px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  #image-preview-modal .image-preview-close {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 16px;
    background: rgba(10, 9, 8, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 18px rgba(10, 9, 8, 0.16);
    backdrop-filter: blur(12px);
  }

  .newsletter-form .form-input {
    min-width: 0;
  }

  .mini-cards,
  .cat-strip,
  .chip-row {
    padding-bottom: 2px;
  }

  .brand-rail-item {
    min-width: 156px;
    min-height: 78px;
    padding: 14px 16px;
  }

  .brand-rail-logo {
    width: 62px;
    height: 50px;
    border-radius: 16px;
  }

  .brand-rail-name {
    font-size: 17px;
  }

  .contact-grid,
  .checkout-grid,
  .blog-grid {
    padding-left: 20px;
    padding-right: 20px;
  }

  .surface-card.mobile-tight {
    padding: 18px;
  }
}

@media (max-width: 639px) {
  .newsletter-form {
    grid-template-columns: 1fr;
  }

  .newsletter-form .btn-primary,
  .newsletter-form .btn-secondary {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .page-grid-2,
  .page-grid-3,
  .support-card-grid,
  .stats-grid,
  .kpi-grid,
  .search-results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 479px) {
  .section-title {
    font-size: 24px;
  }

  .page-header-title {
    font-size: 28px;
  }

  .surface-card,
  .auth-card,
  .checkout-card,
  .loyalty-card,
  .order-card {
    border-radius: var(--r12);
  }
}

@media (pointer: coarse) {
  .nav-btn,
  .side-item,
  .bot-tab,
  .card-add,
  .card-view,
  .card-wish,
  .qty-btn,
  .search-tag,
  .filter-chip,
  .cat-pill,
  .faq-q,
  .settings-row,
  .quick-tile {
    min-height: 44px;
  }

  .card-wish,
  .card-view {
    width: 44px;
    height: 44px;
  }

  .card-add {
    width: 44px;
    height: 44px;
  }

  .card-view {
    top: 62px;
    right: 10px;
  }

  #cart-drawer .qty-btn {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    line-height: 1;
    flex: 0 0 32px;
  }
}


/* codex-mobile-product-gallery-refresh */
@media (max-width: 767px) {
  body[data-page="product"] .product-page-grid > .product-visual-card--gallery {
    width: calc(100% + 24px);
    max-width: calc(100% + 24px);
    min-width: 0;
    margin-inline: -12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-page="product"] .product-visual-card--gallery,
  body[data-page="product"] .product-visual-card--gallery .surface-inner,
  body[data-page="product"] .product-visual-card--gallery .product-mobile-gallery,
  body[data-page="product"] .product-visual-card--gallery .product-mobile-gallery-rail {
    min-width: 0;
  }

  body[data-page="product"] .product-visual-card--gallery .surface-inner {
    padding: 0 !important;
    background: transparent;
  }

  body[data-page="product"] .product-visual-inner.has-mobile-gallery {
    gap: 0;
  }

  body[data-page="product"] .product-mobile-gallery {
    position: relative;
    padding: 10px 0 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 243, 238, 0.96) 100%);
  }

  body[data-page="product"] .product-mobile-gallery-rail {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 12px;
    overflow-x: auto;
    padding: 0 18px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: manipulation;
  }

  body[data-page="product"] .product-mobile-gallery-rail::-webkit-scrollbar {
    display: none;
  }

  body[data-page="product"] .product-mobile-gallery-slide {
    flex: 0 0 calc(100vw - 72px);
    width: calc(100vw - 72px);
    min-width: calc(100vw - 72px);
    border: 0;
    padding: 0;
    background: transparent;
    display: block;
    scroll-snap-align: center;
    scroll-snap-stop: normal;
    appearance: none;
  }

  body[data-page="product"] .product-mobile-gallery-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: min(66vw, 278px);
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(10, 9, 8, 0.06);
    background: #fff;
    box-shadow: 0 14px 34px rgba(10, 9, 8, 0.08);
    transition: aspect-ratio .26s ease, box-shadow .26s ease;
  }

  body[data-page="product"] .product-mobile-gallery-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    display: block;
  }

  body[data-page="product"] .product-mobile-gallery-slide.is-active .product-mobile-gallery-stage {
    box-shadow: 0 18px 40px rgba(10, 9, 8, 0.1);
  }

  body[data-page="product"] .product-mobile-gallery-overlay {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 12px;
    pointer-events: none;
  }

  body[data-page="product"] .product-mobile-gallery-counter {
    pointer-events: auto;
    min-width: 64px;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #161616;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    box-shadow: 0 10px 24px rgba(10, 9, 8, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  body[data-page="product"] .product-visual-card--gallery + .product-summary-card {
    margin-top: 4px;
  }
}

@media (max-width: 420px) {
  body[data-page="product"] .product-mobile-gallery-slide {
    flex-basis: calc(100vw - 64px);
    width: calc(100vw - 64px);
    min-width: calc(100vw - 64px);
  }
}
}
