@import url("./style-base.css");

/* Product image: PS5 AI AIM Package — Ultimate Edition */
.product-art--ultimate {
  background: #02070D url("../images/ps5-ai-ultimate.png") center center / contain no-repeat !important;
}

.product-art--ultimate .product-art__title,
.product-art--ultimate .product-art__sub {
  display: none !important;
}

.product-art--ultimate::before,
.product-art--ultimate::after {
  display: none !important;
}

.product-art--image {
  background: #02070D;
}

.product-art--image::before,
.product-art--image::after {
  display: none;
}

.product-art__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.product-detail__media:has(.product-art--image) {
  aspect-ratio: auto;
}

.product-detail__media {
  aspect-ratio: auto;
  overflow: visible;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-media__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #02070D;
  overflow: hidden;
}

.product-detail__media .product-art {
  position: absolute;
  inset: 0;
}

.product-detail__cat {
  align-self: flex-start;
  text-decoration: none;
}

.product-detail__cat:hover {
  color: var(--text);
}

.product-gallery {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  background: rgba(2, 7, 13, .72);
  border: 1px solid rgba(3,131,244,.28);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
}

.product-gallery__thumb {
  width: 74px;
  height: 52px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(154,163,170,.28);
  background: #02070D;
  cursor: pointer;
  opacity: .72;
}

.product-gallery__thumb.is-active {
  border-color: var(--blue);
  opacity: 1;
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.product-gallery__arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(3,131,244,.42);
  background: rgba(2, 7, 13, .72);
  color: var(--text);
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}

.product-gallery__arrow:hover {
  border-color: var(--blue);
  background: rgba(3,131,244,.14);
  color: #fff;
}

.product-gallery__arrow svg {
  width: 18px;
  height: 18px;
}

.product-gallery__arrow--prev { inset-inline-start: 14px; }
.product-gallery__arrow--next { inset-inline-end: 14px; }

.products-filter {
  position: relative;
  width: min(100%, 360px);
  margin-bottom: 32px;
}

.products-filter__toggle {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid rgba(3,131,244,.38);
  background: rgba(3,131,244,.06);
  color: var(--text);
  cursor: pointer;
  text-align: start;
}

.products-filter__toggle span {
  color: var(--muted);
  font-family: var(--font-arabic);
  font-size: 13px;
}

.products-filter__toggle strong {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

.products-filter__toggle svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
  transition: transform .2s var(--ease);
}

.products-filter__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.products-filter__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  inset-inline: 0;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(2, 7, 13, .96);
  box-shadow: 0 18px 50px rgba(0,0,0,.38);
  backdrop-filter: blur(16px);
}

.products-filter__option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  text-align: start;
}

.products-filter__option:hover,
.products-filter__option.is-active {
  border-color: rgba(3,131,244,.45);
  background: rgba(3,131,244,.08);
  color: var(--text);
}

.nav-category {
  position: relative;
}

.nav-category__details {
  position: relative;
}

.nav-category__details summary {
  list-style: none;
}

.nav-category__details summary::-webkit-details-marker {
  display: none;
}

.nav-link--button {
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav-link--button svg {
  width: 14px;
  height: 14px;
  color: var(--blue);
  transition: transform .2s var(--ease);
}

.nav-link--button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav-category__details[open] .nav-link--button svg {
  transform: rotate(180deg);
}

.nav-category__menu {
  position: absolute;
  top: calc(100% + 18px);
  inset-inline-start: 50%;
  z-index: 90;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(2, 7, 13, .96);
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
  transform: translateX(50%);
  backdrop-filter: blur(16px);
}

html[dir="ltr"] .nav-category__menu {
  transform: translateX(-50%);
}

.nav-category__item {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
}

.nav-category__item:hover {
  border-color: rgba(3,131,244,.45);
  background: rgba(3,131,244,.08);
  color: var(--text);
}

.cart-drawer:not(.is-open) {
  pointer-events: none;
}

.cart-drawer.is-open {
  pointer-events: auto;
}

.lr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 4, 10, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
}

.lr-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border: 1px solid rgba(3,131,244,.45);
  box-shadow: 0 22px 80px rgba(0,0,0,.65);
  cursor: zoom-in;
  transition: transform .18s ease;
}

.lr-lightbox img.is-zoomed {
  transform: scale(1.45);
  cursor: zoom-out;
}

.lr-lightbox-x {
  position: fixed;
  top: 22px;
  right: 28px;
  width: 46px;
  height: 46px;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,7,13,.82);
  border: 1px solid rgba(3,131,244,.65);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.product-card[hidden] {
  display: none !important;
}

.nav-link.is-active {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.products-grid > .product-card--featured:first-child {
  grid-row: span 1 !important;
}

.products-grid > .product-card--featured:first-child .product-card__media {
  aspect-ratio: 16 / 7.2 !important;
}

.products-grid > .product-card--featured:first-child .product-art__image {
  object-fit: cover !important;
  object-position: center top !important;
}

.products-grid > .product-card--featured:first-child .product-card__body {
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

/* ============================================================
   Numerals — Rajdhani for prices, cart-count, qty inputs, etc.
   (matches source style.css: tabular numbers across the store)
   ============================================================ */
.price__amount,
.cart-count,
.qty-stepper input,
.lr-wc input.qty,
.lr-wc .quantity input.qty,
.lr-wc .woocommerce-Price-amount,
.lr-wc .woocommerce-Price-amount bdi,
a[href^="tel:"] .contact-card__value,
a[href^="https://wa.me"] .contact-card__value {
  font-family: "Rajdhani", var(--font-display), system-ui, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .products-filter {
    width: 100%;
  }

  .product-gallery__arrow {
    width: 36px;
    height: 36px;
  }

  .product-gallery__thumb {
    width: 62px;
    height: 44px;
  }

  .lr-lightbox {
    padding: 18px;
  }

  .lr-lightbox img.is-zoomed {
    transform: scale(1.18);
  }
}

@media (max-width: 980px) {
  .nav-category,
  .nav-link--button {
    width: 100%;
  }

  .nav-link--button {
    justify-content: space-between;
    font-size: 16px;
  }

  .nav-category__menu {
    position: static;
    min-width: 0;
    margin-top: 12px;
    transform: none;
    box-shadow: none;
  }
}

/* ============================================================
   MOBILE & TABLET — Complete responsive improvements
   ============================================================ */

/* Tablet ≤ 900px -------------------------------------------- */
@media (max-width: 900px) {
  /* Cat tabs: horizontal scroll instead of multi-line wrap */
  .cat-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 12px;
    margin-inline: calc(-1 * var(--section-pad-x));
    padding-inline: var(--section-pad-x);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { flex-shrink: 0; }
}

/* Tablet portrait only (641–900px) — featured card aspect ratio */
@media (min-width: 641px) and (max-width: 900px) {
  .products-grid > .product-card--featured:first-child .product-card__media {
    aspect-ratio: 16 / 8 !important;
  }
}

/* Mobile ≤ 640px — additive fixes --------------------------- */
@media (max-width: 640px) {
  /* Fix: full-width drawer (max-width:100%) must start completely off-screen.
     The base style uses a fixed -460px offset which leaks on 460-640px screens. */
  .cart-drawer {
    inset-inline-end: -100vw;
  }

  /* Cart drawer footer: stack action buttons for comfortable thumb reach */
  .cart-drawer__actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* iOS/Safari: prevent viewport auto-zoom on input focus.
     Any font-size below 16px triggers the zoom. */
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }

  /* Product card: full-width primary button on small screens */
  .product-card__actions {
    grid-template-columns: 1fr;
  }

  /* Breadcrumbs: allow wrapping when product path is long */
  .breadcrumbs {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  /* Hero content: tighter left/right padding on narrow screens */
  .hero-content {
    inset-inline-start: 0;
    inset-inline-end: 0;
    padding-inline: var(--pad-x);
    max-width: 100%;
  }

  /* Why cards: slightly smaller description text */
  .why-card__desc {
    font-size: 14px;
    line-height: 1.75;
  }

  /* Product detail trust items: single column on small screens */
  .product-detail__trust {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Small phones ≤ 380px -------------------------------------- */
@media (max-width: 380px) {
  /* Prevent header overflow on 320-380px phones */
  .brand-logo { width: 130px; }
  .icon-btn { width: 32px; height: 32px; }

  /* Compact section headings */
  .section-title { font-size: 22px; }

  /* Hero title: safe sizes for 320px phones */
  .hero-title__line--top { font-size: 22px; }
  .hero-title__line--bot { font-size: 30px; }
  .hero-subtitle { font-size: 13.5px; }

  /* Tighter hero title box */
  .hero-title { padding: 12px 16px; }
}

/* Landscape phones ------------------------------------------ */
/* Handles phones rotated to landscape where height < 500px.
   Prevents the hero (min-height: 720px) from overflowing the viewport. */
@media (max-height: 500px) and (min-width: 600px) and (orientation: landscape) {
  .hero {
    height: auto;
    min-height: 0;
    padding-top: calc(var(--header-h) + 36px);
    padding-bottom: 40px;
  }
  .hero-content {
    position: relative;
    top: auto;
    inset-inline-start: 0;
    inset-inline-end: 0;
    transform: none;
    max-width: 100%;
    padding-inline: var(--pad-x);
    padding-inline-end: var(--pad-x);
    bottom: auto;
  }
  .hero-video { display: none; }
  .hero-particles { display: none; }
  .hero-title__line--top { font-size: 22px; }
  .hero-title__line--bot { font-size: 30px; }
  .hero-subtitle { display: none; }
}
