/* YURACHI production polish: shared luxury ecommerce refinements. */
:root {
  --yr-ink: #111111;
  --yr-muted: #646464;
  --yr-paper: #f7f5f0;
  --yr-surface: rgba(255, 255, 255, .92);
  --yr-line: rgba(17, 17, 17, .12);
  --yr-accent: #0077b6;
  --yr-gold: #b48a46;
  --yr-radius: 8px;
  --yr-shadow: 0 18px 45px rgba(17, 17, 17, .08);
}

html {
  overflow-x: hidden;
  scrollbar-gutter: stable;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  width: 100%;
  color: var(--yr-ink);
}

body:not(.light):not(.dark) {
  background: var(--yr-paper);
}

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

a {
  text-decoration: none;
}

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

button, .btn, .hero-cta, .btn-main, .btn-secondary, .filter-btn {
  border-radius: var(--yr-radius) !important;
  letter-spacing: .02em;
}

/* ── Navbar base ─────────────────────────────────────────────────────────── */
.glass-nav,
#nav {
  border-bottom: 1px solid transparent !important;
  box-shadow: none !important;
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease !important;
}

/* Default (no theme class) nav */
body:not(.light):not(.dark) .glass-nav,
body:not(.light):not(.dark) #nav {
  background: rgba(247, 245, 240, .96) !important;
  border-bottom-color: rgba(17,17,17,.08) !important;
  box-shadow: 0 4px 24px rgba(17,17,17,.06) !important;
}

/* ── Scrolled nav: premium frosted glass ──────────────────────────────────── */
#nav.nav-scrolled,
body.nav-scrolled #nav {
  background: rgba(202, 240, 248, 0.97) !important;
  backdrop-filter: blur(24px) saturate(1.6) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.6) !important;
  border-bottom: 1px solid rgba(0, 119, 182, 0.14) !important;
  box-shadow: 0 8px 40px rgba(3, 4, 94, 0.12) !important;
}

/* ── Home page hero nav (transparent) ──────────────────────────────────── */
body.home-page:not(.nav-scrolled) #nav {
  background: linear-gradient(to bottom, rgba(0,0,0,.34), rgba(0,0,0,0)) !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
}

body:not(.light):not(.dark) #logo {
  color: var(--yr-ink) !important;
  letter-spacing: .28em !important;
}

body.light #logo {
  letter-spacing: .28em !important;
}

body.home-page:not(.nav-scrolled) #logo,
body.home-page:not(.nav-scrolled) #navLinks a {
  color: #fff !important;
}

/* Nav links desktop */
body:not(.light):not(.dark) #navLinks a {
  color: var(--yr-ink) !important;
  text-transform: uppercase;
  font-size: 12px !important;
  letter-spacing: .12em;
}

#navLinks a {
  text-transform: uppercase;
  font-size: 12px !important;
  letter-spacing: .12em;
}

/* ── Mobile menu ─────────────────────────────────────────────────────────── */
#mobileMenu {
  background: rgba(247, 245, 240, .98) !important;
  border-bottom: 1px solid var(--yr-line) !important;
}

body.light #mobileMenu {
  background: rgba(202, 240, 248, 0.99) !important;
  border-bottom: 1px solid rgba(0,119,182,0.12) !important;
}

#mobileMenu a {
  color: var(--yr-ink) !important;
  min-height: 44px;
}

/* ── Nav icon buttons ─────────────────────────────────────────────────────── */
.nav-svg-btn,
.nav-cart-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle;
  line-height: 1 !important;
}

.nav-svg-btn {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: var(--yr-radius) !important;
}

.nav-svg-btn svg,
.nav-cart-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.nav-cart-btn {
  min-height: 40px;
  gap: 8px;
  padding: 0 14px !important;
}

.nav-cart-count {
  min-width: 0;
}

/* ── Brand badge ──────────────────────────────────────────────────────────── */
#brandBadge {
  background: rgba(255, 255, 255, 0.90) !important;
  border: 1.5px solid rgba(0, 119, 182, 0.22) !important;
  box-shadow: 0 4px 16px rgba(3, 4, 94, 0.13) !important;
}

/* ── Hero section ─────────────────────────────────────────────────────────── */
body.home-page #heroSection {
  margin-top: 0 !important;
  padding-top: 0 !important;
  background: #050505;
}

body.home-page:not(.nav-scrolled) #nav {
  border-bottom-color: transparent !important;
}

/* ── Hero slider cards ───────────────────────────────────────────────────── */
.slide-product-card {
  cursor: pointer !important;
}

.slide-product-card:focus-visible {
  outline: 2px solid var(--yr-accent);
  outline-offset: 2px;
  border-radius: var(--yr-radius);
}

/* ── Product & content cards ─────────────────────────────────────────────── */
.product-card,
.card,
.prod-related-card,
#endSection .trust-item,
#endSection .footer,
.table-wrap {
  border-radius: var(--yr-radius) !important;
  background: var(--yr-surface) !important;
  border: 1px solid var(--yr-line) !important;
  box-shadow: var(--yr-shadow) !important;
}

.product-card {
  display: flex !important;
  flex-direction: column !important;
}

.product-card > div:last-child,
.product-card > .p-3,
.product-card > .p-4,
.product-card > [class*="sm:p-"] {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}

.product-card > div:last-child > div:last-child,
.product-card > .p-3 > div:last-child,
.product-card > .p-4 > div:last-child {
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

.product-card .product-media,
.product-card > div:first-child {
  flex-shrink: 0 !important;
}

.product-card,
.prod-related-card {
  overflow: hidden;
}

.product-card:hover,
.prod-related-card:hover {
  transform: translateY(-3px) !important;
}

.product-media,
.main-image-wrap,
.prod-related-card img,
.lb-card,
.col-card,
.thumb {
  border-radius: var(--yr-radius) !important;
}

.price-tag,
.product-price {
  color: var(--yr-accent) !important;
  background: transparent !important;
  font-weight: 800;
}

.btn-main,
.filter-btn.active {
  color: #fff !important;
  background: var(--yr-ink) !important;
}

.filter-btn {
  background: transparent !important;
  border-color: var(--yr-line) !important;
  color: var(--yr-ink) !important;
}

.badge-new,
.badge-pill {
  border-radius: 999px !important;
  background: rgba(180, 138, 70, .14) !important;
  color: #7b5a22 !important;
}

.old-price,
.product-old-price,
.product-meta,
#shopSubtext,
#endSection .trust-desc,
#endSection .brand p,
#endSection .footer-col a {
  color: var(--yr-muted) !important;
}

#toast {
  border-radius: var(--yr-radius) !important;
  background: var(--yr-ink) !important;
}

/* ── Focus styles ─────────────────────────────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--yr-accent);
  outline-offset: 2px;
}

/* ── Smooth scroll ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ── Mobile nav ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #nav {
    min-height: 64px;
    padding: 10px 12px !important;
  }

  #logo {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .95rem !important;
    letter-spacing: .18em !important;
  }

  #cartBtn {
    min-height: 40px;
    padding: 9px 12px !important;
  }

  .cart-btn-label {
    display: inline !important;
  }

  .nav-cart-btn {
    padding: 0 12px !important;
    width: auto !important;
  }

  .nav-cart-label {
    display: inline !important;
  }

  #productGrid {
    gap: 12px !important;
  }

  .product-card h3 {
    font-size: 13px !important;
    line-height: 1.25;
  }

  .product-card .p-3,
  .product-card .p-4 {
    padding: 10px !important;
  }

  #toast {
    max-width: calc(100% - 24px);
    bottom: 16px !important;
  }
}

/* ── Motion safety ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ── Image performance: faster perceived loading ──────────────────────────── */
img {
  content-visibility: auto;
}

/* Fade-in on image load for smoother experience */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.35s ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
  opacity: 1;
}

/* Product image skeleton shimmer (used in product.php gallery) */
.img-skeleton {
  background: linear-gradient(90deg,
    rgba(0,119,182,.06) 25%,
    rgba(0,119,182,.12) 50%,
    rgba(0,119,182,.06) 75%
  );
  background-size: 200% 100%;
  animation: yr-shimmer 1.4s ease-in-out infinite;
}
@keyframes yr-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Thumb images: prevent layout shift */
.thumb {
  background: rgba(0,119,182,.05);
}
