/* ==========================================================================
   KATÉA — Responsive System
   Mobile-first corrections layered over the base desktop styles.
   ========================================================================== */

/* Shared responsive safeguards */
html,
body {
  max-width: 100%;
}

body {
  overflow-x: clip;
}

main,
section,
.container,
.container-narrow,
.container-fluid,
.header-container,
.site-footer {
  min-width: 0;
}

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

button,
a,
select,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.page-hero {
  padding: clamp(48px, 6vw, 72px) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.page-hero-title {
  margin-bottom: 14px;
}

/* Collection tools */
.collection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
  gap: 16px 24px;
}

.collection-count {
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.collection-sort {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.collection-sort-label {
  flex: 0 0 auto;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.collection-sort-select {
  width: auto;
  min-width: 180px;
  padding: 8px 34px 8px 12px;
  font-size: 0.85rem;
}

/* Product detail */
.pdp-section {
  padding-top: 40px;
}

.pdp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.pdp-breadcrumb a {
  color: var(--color-text-muted) !important;
}

.pdp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr);
  gap: clamp(36px, 4vw, 56px);
  align-items: start;
}

.pdp-gallery,
.pdp-buybox {
  min-width: 0;
}

.pdp-main-media {
  aspect-ratio: 1 / 1.1;
  background: #F9F6F2;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(26, 18, 11, .06);
  box-shadow: 0 12px 40px rgba(26, 18, 11, .07);
}

.pdp-main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  cursor: zoom-in;
  background: #F9F6F2;
  will-change: opacity;
  transition: opacity .12s ease;
}

.pdp-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  padding: 0 0 8px;
}

.pdp-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid transparent;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: border-color .18s ease, transform .18s ease;
}

.pdp-buybox {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pdp-title {
  font-size: clamp(1.65rem, 2.3vw, 2rem);
  font-weight: 300;
  letter-spacing: .04em;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.pdp-price {
  font-size: clamp(1.25rem, 2vw, 1.5rem) !important;
  color: var(--color-primary) !important;
  font-weight: 300 !important;
  letter-spacing: .04em;
}

.pdp-description {
  font-size: 0.95rem;
  line-height: 1.8;
  font-weight: 300;
  color: #6B5A4A;
  overflow-wrap: anywhere;
}

.pdp-description p,
.pdp-description ul,
.pdp-description ol {
  margin-bottom: 14px;
}

.pdp-description ul,
.pdp-description ol {
  padding-left: 20px;
  list-style: disc;
}

.pdp-description li {
  margin: 4px 0;
}

.pdp-variants {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pdp-variant-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  white-space: nowrap;
  text-align: center;
  font-weight: 300;
  letter-spacing: .10em;
  font-size: .68rem;
  border-width: 1px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

.pdp-action-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: stretch;
}

.pdp-qty {
  width: 110px !important;
  height: 50px !important;
  margin-top: 0 !important;
}

.pdp-qty .qty-btn {
  min-width: 38px;
  font-size: 1rem;
}

.pdp-add-btn,
.pdp-wishlist-btn,
.pdp-whatsapp-btn {
  min-height: 50px;
  padding: 14px 18px !important;
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .07em;
  white-space: nowrap;
}

.pdp-wishlist-btn {
  min-width: 52px;
}

.pdp-specs {
  border-top: 1px solid var(--color-border);
  margin-top: 14px;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.6;
}

/* About */
.about-story {
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.about-story-title {
  font-size: clamp(1.45rem, 3vw, 1.8rem);
  margin-bottom: 30px;
  letter-spacing: 0.08em;
  color: var(--color-primary);
}

.about-story-copy {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.9;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-signature {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--color-accent);
  margin-top: 16px;
  letter-spacing: 0.1em;
}

.about-actions {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Large laptops / compact desktops */
@media (max-width: 1280px) {
  :root {
    --container-padding: 28px;
  }

  .nav-list {
    gap: 20px;
  }

  .nav-link {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }

  .header-actions {
    gap: 12px;
  }

  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 18px;
  }

  .footer-top-grid {
    grid-template-columns: 1.35fr 1fr 1fr 1.2fr;
    gap: 32px;
  }
}

/* iPad landscape / small laptop: move to compact navigation before it collides */
@media (max-width: 1100px) {
  :root {
    --container-padding: 24px;
  }

  .header-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: -8px;
  }

  .header-container {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .header-logo {
    text-align: center;
    justify-self: center;
  }

  .hero-slider-section {
    height: min(76svh, 760px);
    min-height: 520px;
  }

  .hero-content {
    max-width: 760px;
  }

  .category-columns-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .category-card {
    height: 430px;
  }

  .category-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    height: 390px;
  }

  .guide-steps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .guide-step-card {
    padding: 34px 22px;
  }

  .footer-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px 32px;
  }

  .pdp-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.9fr);
    gap: 36px;
  }

  .checkout-container {
    grid-template-columns: 1fr;
    max-width: 820px;
  }
}

/* Tablets / iPad portrait */
@media (max-width: 900px) {
  :root {
    --container-padding: 22px;
  }

  .section {
    padding: 64px 0;
  }

  .section-header {
    margin-bottom: 38px;
  }

  .hero-slider-section {
    height: min(72svh, 680px);
    min-height: 500px;
  }

  .hero-title {
    font-size: clamp(2rem, 7vw, 3.4rem);
  }

  .hero-subtitle {
    max-width: 560px;
  }

  .spotlight-banner-section {
    min-height: 470px;
  }

  .spotlight-banner-overlay {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.5) 70%, rgba(0, 0, 0, 0.22) 100%);
  }

  .guide-steps-grid {
    grid-template-columns: 1fr;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  .guide-step-card {
    padding: 32px 28px;
  }

  .booking-section-wrap {
    padding: 36px 28px;
  }

  .pdp-layout {
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 760px;
    margin: 0 auto;
  }

  .pdp-main-media {
    aspect-ratio: 1 / 1.02;
  }

  .pdp-buybox {
    gap: 18px;
  }

  .quickview-modal {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    width: min(94vw, 820px);
  }

  .quickview-gallery {
    min-height: 420px;
  }

  #wishlistModal {
    width: min(92vw, 760px) !important;
  }

  #wishlistGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Phones + compact tablets */
@media (max-width: 767px) {
  :root {
    --container-padding: 16px;
    --header-height: 64px;
    --announcement-height: 34px;
  }

  html {
    font-size: 15px;
  }

  body {
    line-height: 1.55;
  }

  .announcement-bar {
    padding: 0 12px;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
  }

  .announcement-item {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
    line-height: 1.25;
  }

  .announcement-controls {
    display: none;
  }

  .header-container {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding-left: 12px;
    padding-right: 12px;
    gap: 4px;
  }

  .mobile-menu-toggle {
    margin-left: 0;
    width: 44px;
    height: 44px;
  }

  .logo-text {
    font-size: clamp(1.2rem, 5.2vw, 1.5rem);
    letter-spacing: 0.16em;
  }

  .logo-tagline {
    font-size: 0.5rem;
    letter-spacing: 0.22em;
  }

  .header-actions {
    gap: 2px;
  }

  .currency-select-wrap {
    display: none;
  }

  .action-btn {
    width: 42px;
    height: 42px;
    padding: 9px;
  }

  .action-btn svg {
    width: 20px;
    height: 20px;
  }

  .mobile-drawer {
    width: min(88vw, 360px);
    max-width: none;
    height: 100dvh;
  }

  .mobile-drawer-header,
  .mobile-drawer-body,
  .mobile-drawer-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .mobile-nav-link {
    min-height: 46px;
    font-size: 1.05rem;
  }

  .hero-slider-section {
    height: clamp(500px, 72svh, 660px);
    min-height: 500px;
    max-height: 720px;
  }

  .hero-bg-image {
    object-position: center center;
  }

  .hero-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.45) 48%, rgba(0, 0, 0, 0.72) 100%);
  }

  .hero-content {
    width: 100%;
    max-width: 620px;
    padding: 0 20px;
  }

  .hero-caption {
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    margin-bottom: 12px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 9vw, 2.55rem);
    letter-spacing: 0.055em;
    margin-bottom: 16px;
  }

  .hero-subtitle {
    font-size: clamp(0.88rem, 3.8vw, 1rem);
    line-height: 1.55;
    margin-bottom: 24px;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-actions .btn {
    min-height: 46px;
    padding: 12px 20px;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
  }

  .hero-nav-btn {
    display: none;
  }

  .hero-dots {
    bottom: 18px;
  }

  .section {
    padding: 48px 0;
  }

  .page-hero {
    padding: 46px 0;
  }

  .section-header {
    margin-bottom: 30px;
  }

  .section-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
  }

  .section-desc {
    font-size: 0.9rem;
    max-width: 92%;
  }

  .tab-navigation {
    justify-content: flex-start;
    gap: 20px;
    margin: 0 calc(-1 * var(--container-padding)) 30px;
    padding: 0 var(--container-padding) 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tab-navigation::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    font-size: 0.92rem;
    padding: 8px 4px;
  }

  .tab-btn::after {
    bottom: -15px;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }

  .product-card {
    min-width: 0;
  }

  .product-card:hover {
    transform: none;
  }

  .product-image-wrap {
    aspect-ratio: 1 / 1.2;
    margin-bottom: 11px;
  }

  .product-badges {
    top: 8px;
    left: 8px;
  }

  .product-badges .badge {
    padding: 3px 7px;
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }

  .product-sale-ribbon {
    top: 12px;
    right: -30px;
    font-size: 0.6rem;
    padding: 4px 30px;
  }

  .product-wishlist-btn {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
  }

  .product-card-actions {
    display: flex;
    position: static;
    transform: none;
    opacity: 1;
    background: none;
    padding: 10px 0 0;
    gap: 8px;
  }
  .product-card-actions .product-action-btn {
    flex: 1;
    min-height: 38px;
    font-size: 0.68rem;
    padding: 8px 10px;
    border: 1px solid var(--color-border-light);
  }
  .product-card-actions .product-action-whatsapp {
    flex: 1;
  }

  .product-info {
    gap: 4px;
  }

  .product-category {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .product-title {
    font-size: clamp(0.82rem, 3.5vw, 0.94rem);
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .product-price-wrap {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3px 6px;
  }

  .product-price {
    font-size: 0.88rem;
  }

  .product-compare-price {
    font-size: 0.76rem;
  }

  .category-columns-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .category-card,
  .category-card:last-child:nth-child(odd) {
    grid-column: auto;
    height: clamp(340px, 110vw, 430px);
    max-height: 430px;
    padding: 28px 18px;
  }

  .category-card-title {
    font-size: 1.25rem;
  }

  .spotlight-banner-section {
    min-height: 440px;
  }

  .spotlight-banner-bg {
    object-position: center;
  }

  .spotlight-banner-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.48) 60%, rgba(0, 0, 0, 0.26) 100%);
  }

  .spotlight-banner-content {
    max-width: 100%;
    padding: 54px 0 40px;
  }

  .spotlight-banner-title {
    font-size: clamp(1.7rem, 8vw, 2.25rem);
  }

  .spotlight-banner-desc {
    font-size: 0.94rem;
  }

  .booking-section-wrap {
    padding: 28px 18px;
    margin-left: -4px;
    margin-right: -4px;
  }

  .booking-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .booking-form-full {
    grid-column: 1;
  }

  .form-control {
    min-height: 46px;
  }

  .testimonial-card {
    padding: 18px 4px;
  }

  .testimonial-quote {
    font-size: 1.06rem;
  }

  .collection-toolbar {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 28px;
    gap: 12px;
  }

  .collection-sort {
    width: 100%;
    justify-content: space-between;
  }

  .collection-sort-select {
    min-width: 0;
    width: min(100%, 230px);
  }

  /* Prevent iOS auto-zoom: inputs stay 16px, PDP buttons 0.68rem single-line equal */
  .form-control, .search-input, .currency-select {
    font-size: 16px !important;
  }
  .pdp-variant-btn, .pdp-whatsapp-btn, .qv-variant-btn {
    font-size: 0.68rem !important;
  }
  .pdp-variants {
    display: flex;
    gap: 10px;
  }
  .pdp-variant-btn {
    flex: 1 1 42%;
    min-width: 0;
    min-height: 48px;
    padding: 12px 10px !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pdp-section {
    padding-top: 24px;
  }

  .pdp-breadcrumb {
    margin-bottom: 18px;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
  }

  .pdp-layout {
    gap: 26px;
  }

  .pdp-main-media {
    aspect-ratio: 4 / 3;
    max-height: 46vh;
    margin-left: calc(-1 * var(--container-padding));
    margin-right: calc(-1 * var(--container-padding));
    border-radius: 16px;
    overflow: hidden;
    background: #F9F6F2;
    border: 1px solid rgba(26, 18, 11, .06);
    box-shadow: 0 12px 40px rgba(26, 18, 11, .07);
  }
  .pdp-main-media .pdp-main-image {
    object-fit: contain;
    background: #F9F6F2;
  }
  /* Fit galleries size the frame to each photo, so no height cap is needed */
  .pdp-gallery--fit-contain .pdp-main-media {
    max-height: none;
    background: #FFFFFF;
  }
  .pdp-gallery--fit-contain .pdp-main-image {
    background: #FFFFFF;
  }
  .pdp-thumbnails {
    gap: 10px;
  }
  .pdp-thumb {
    border-radius: 8px;
    border-width: 1.5px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  }
  .pdp-thumb:active {
    transform: scale(.98);
  }
  /* keep variant always above fold and above WhatsApp floating */
  .pdp-buybox {
    position: relative;
    z-index: 2;
    gap: 20px;
  }
  .pdp-variants {
    position: relative;
    z-index: 3;
    gap: 10px;
  }
  .pdp-variant-btn {
    position: relative;
    z-index: 3;
    font-weight: 300;
    letter-spacing: .12em;
    border-width: 1px;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
  }
  .whatsapp-floating-wrap {
    z-index: 1 !important;
  }

  .pdp-thumbnails {
    margin-right: calc(-1 * var(--container-padding));
    padding-right: var(--container-padding);
    gap: 9px;
  }

  .pdp-thumb {
    width: 66px;
    height: 78px;
  }

  .pdp-buybox {
    gap: 22px;
    padding: 4px 0;
  }

  .pdp-title {
    font-size: clamp(1.6rem, 7vw, 1.95rem);
    font-weight: 300;
    letter-spacing: .04em;
    line-height: 1.15;
  }

  .pdp-price {
    font-weight: 300 !important;
    letter-spacing: .04em;
  }

  .pdp-description {
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.8;
    color: #6B5A4A;
  }
  .pdp-specs {
    font-weight: 300;
    line-height: 1.75;
    color: #6B5A4A;
  }
  .badge.badge-stock {
    font-weight: 300;
    letter-spacing: .08em;
    font-size: .68rem;
    border-width: 1px;
  }

  .pdp-action-row {
    grid-template-columns: 104px minmax(0, 1fr) 50px;
    gap: 8px;
  }

  .pdp-qty {
    width: 104px !important;
  }

  .pdp-add-btn {
    padding-left: 12px !important;
    padding-right: 12px !important;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    white-space: normal;
    line-height: 1.25;
  }

  .pdp-whatsapp-btn {
    white-space: nowrap;
    font-size: 0.68rem !important;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.35;
    padding: 14px 16px !important;
    text-align: center;
    border-radius: 999px;
  }

  .about-story-copy {
    line-height: 1.75;
    gap: 20px;
  }

  .about-actions {
    margin-top: 36px;
    flex-direction: column;
  }

  .about-actions .btn {
    width: 100%;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    margin-bottom: 44px;
  }

  .site-footer {
    padding: 54px 0 24px;
  }

  .footer-col {
    gap: 14px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 18px;
  }

  .payment-icons {
    flex-wrap: wrap;
  }

  .cart-drawer {
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
  }

  .cart-drawer-header,
  .free-shipping-bar-wrap,
  .cart-drawer-body,
  .cart-drawer-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .cart-item {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 12px;
  }

  .cart-item-img {
    width: 68px;
    height: 82px;
  }

  .quickview-modal {
    width: calc(100vw - 24px);
    max-width: none;
    max-height: 92dvh;
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .quickview-gallery {
    min-height: 280px;
    height: min(42dvh, 360px);
  }

  .quickview-info {
    padding: 26px 20px;
    max-height: none;
    overflow: visible;
  }

  .quickview-close {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
  }

  #wishlistModal {
    width: calc(100vw - 24px) !important;
    max-width: none !important;
    max-height: 90dvh;
    padding: 22px 16px !important;
    overflow-y: auto !important;
  }

  #wishlistGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px 10px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .search-modal {
    padding: 18px 0 28px;
    max-height: 100dvh;
    overflow-y: auto;
  }

  .search-input {
    font-size: clamp(1rem, 5vw, 1.25rem);
  }

  .search-results-wrap {
    margin-top: 20px;
    max-height: none;
  }

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

  .checkout-header {
    padding: 14px 44px;
    position: sticky;
    top: 0;
    background: var(--color-white);
    z-index: 2;
  }

  .checkout-container {
    margin: 24px auto;
    padding: 0 16px 40px;
    gap: 24px;
  }

  .checkout-summary-box {
    padding: 22px 18px;
  }

  .whatsapp-floating-wrap {
    bottom: max(16px, env(safe-area-inset-bottom));
    right: 16px;
  }

  .whatsapp-floating-btn {
    width: 54px;
    height: 54px;
  }

  .whatsapp-floating-btn svg {
    width: 28px;
    height: 28px;
  }

  .whatsapp-chat-popup {
    width: min(340px, calc(100vw - 32px));
    max-height: 70dvh;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    width: 100%;
    border-radius: 10px;
    padding: 12px 16px;
  }

  .whatsapp-floating-wrap {
    bottom: max(16px, env(safe-area-inset-bottom));
    pointer-events: none;
  }
  .whatsapp-floating-wrap .whatsapp-floating-btn,
  .whatsapp-floating-wrap .whatsapp-chat-popup {
    pointer-events: auto;
  }
  /* Fix iPhone Safari: VIEW ALL near bottom bar + WhatsApp overlap blocks tap until scrolled 50% */
  #featured-creations {
    padding-bottom: 28px;
  }
  #featured-creations .text-center {
    position: relative;
    z-index: 3;
    padding-bottom: 24px;
  }
  #featured-creations .btn {
    position: relative;
    z-index: 4;
    touch-action: manipulation;
  }
}
@media (max-width: 560px) {
  /* Keep the header usable at 320–430px: search + bag remain; wishlist and
     WhatsApp are still available through product cards / floating WhatsApp. */
  .header-actions .action-btn:nth-of-type(2),
  .header-actions .action-btn:nth-of-type(3) {
    display: none;
  }

  .header-container {
    grid-template-columns: 44px minmax(0, 1fr) 88px;
  }

  .hero-actions {
    flex-direction: column;
    width: min(100%, 320px);
    margin: 0 auto;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .collection-sort {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .collection-sort-select {
    width: 100%;
  }

  .pdp-action-row {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .pdp-wishlist-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .pdp-wishlist-btn::after {
    content: " Save to wishlist";
    margin-left: 8px;
  }

  .newsletter-input-group {
    gap: 8px;
  }

  .newsletter-submit {
    flex: 0 0 auto;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  :root {
    --container-padding: 14px;
  }

  .header-container {
    padding-left: 8px;
    padding-right: 8px;
    grid-template-columns: 42px minmax(0, 1fr) 82px;
  }

  .action-btn {
    width: 40px;
    height: 40px;
  }

  .logo-text {
    font-size: 1.12rem;
    letter-spacing: 0.12em;
  }

  .logo-tagline {
    display: none;
  }

  .products-grid,
  #wishlistGrid {
    grid-template-columns: 1fr !important;
  }

  .product-image-wrap {
    aspect-ratio: 1 / 1.08;
  }

  .pdp-action-row {
    grid-template-columns: 1fr;
  }

  .pdp-qty,
  .pdp-wishlist-btn {
    width: 100% !important;
  }

  .pdp-qty {
    justify-content: space-between;
  }

  .pdp-qty .qty-btn {
    width: 44px;
  }

  .search-results-grid {
    grid-template-columns: 1fr;
  }
}

/* Touch devices: avoid hover-only movement and ensure controls are finger friendly */
@media (hover: none), (pointer: coarse) {
  .btn,
  .action-btn,
  .mobile-menu-toggle,
  .close-btn,
  .product-wishlist-btn,
  .footer-social-link,
  .qty-btn {
    min-height: 44px;
  }

  .product-card:hover,
  .guide-step-card:hover,
  .btn:hover {
    transform: none;
  }
}

/* Respect accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
