/* Hawttt custom styles — loaded after bundle.min.css
   Fixes CLS, aspect ratios, mobile UX, modern tweaks.
   Bootstrap 5 overrides and component additions. */

/* ── Prevent CLS on image containers ──────────────────────────────────────
   Reserve space before images load so layout doesn't shift.
   Uses aspect-ratio (supported in all modern browsers since 2021). */

/* Product card thumbnails — square images */
.ratio_337-337.image-wrapper,
.ratio_640-640.image-wrapper {
  aspect-ratio: 1;
}

/* Product page main image slider — typical product photo ratio */
.height-ratio.image-wrapper {
  min-height: 300px;
  aspect-ratio: 4 / 5;
}

/* Swiper container — prevent height from collapsing before JS init */
.swiper {
  min-height: inherit;
}
.nav-slider-hover,
.box-carousel {
  min-height: 260px;
}
/* Swiper nav buttons — size down to not overwhelm the card */
.nav-slider-hover .swiper-button-prev,
.nav-slider-hover .swiper-button-next {
  --swiper-navigation-size: 28px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ── Image loading shimmer — keep on lazy images before they load ─────── */
img.lazy,
img[data-src] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
img.lazy.loaded,
img:not([data-src]) {
  animation: none;
  background: none;
}

/* ── Sticky buy bar — mobile only ─────────────────────────────────────── */
#sticky-buy-bar {
  /* Hidden by default; shown via x-intersect in template */
  display: none;
}
@media (min-width: 992px) {
  /* Hide on desktop — buy buttons are already visible in page */
  #sticky-buy-bar {
    display: none !important;
  }
}

/* ── Touch targets — minimum 44px for accessibility & mobile UX ──────── */
.product-buy-link,
.btn-product {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ── Price section — make the comparison table the hero on mobile ─────── */
@media (max-width: 991.98px) {
  .product-description-card {
    border-radius: 8px;
  }
  /* Price comparison section gets a subtle highlight */
  section[aria-label="Price comparison"] {
    border-left: 3px solid var(--bs-primary, #b33882);
  }
}

/* ── Product avail row — better mobile spacing ───────────────────────── */
.product-avail-row {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.product-avail-row:last-child {
  border-bottom: none;
}

/* ── Typography improvements ─────────────────────────────────────────── */
/* Ensure minimum readable font size on all form inputs (prevents iOS zoom) */
input, select, textarea {
  font-size: max(16px, 1rem) !important;
}

/* ── Modern scroll behavior ──────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ── Category/search product grid — consistent card heights ─────────── */
.ratio_400-400.image-wrapper {
  aspect-ratio: 1;
}

/* ── Pagination — better touch targets ──────────────────────────────── */
.page-link {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Variant pill chips on product view ─────────────────────────────── */
.variant-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.variant-chips small {
  width: 100%;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.variant-chip {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1.25;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  color: #495057;
}

/* ── Sticky buy bar on product view ─────────────────────────────────── */
.sticky-buy-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1400;
  background: #fff;
  border-top: 2px solid #b33882;
  padding: 10px 16px;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
}
.sticky-buy-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  gap: 12px;
}
.sticky-buy-bar-info {
  min-width: 0;
}
.sticky-buy-bar-name {
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sticky-buy-bar-price {
  font-weight: 700;
  color: #b33882;
  font-size: 1.05rem;
}
.sticky-buy-bar-price span {
  font-size: 0.7rem;
  font-weight: 400;
  color: #666;
}
.sticky-buy-bar-cta {
  flex-shrink: 0;
  background: #b33882;
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.sticky-buy-bar-close {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  color: #666;
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}
