/* ============================================================
   LUXE TECH — MAIN.CSS
   Core Design System: Reset → Base → Typography → Layout
   ============================================================ */

/* ── Reset & Box Model ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

@media (max-width: 767px) {
  body {
    padding-bottom: 60px; /* Space for mobile bottom nav */
  }
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* ── Selection ── */
::selection {
  background: var(--color-accent);
  color: var(--color-text-invert);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-hero); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p { color: var(--color-text-secondary); line-height: 1.7; }

.text-display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--fw-light);
}

.text-mono {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-accent) 50%, var(--color-accent-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-center { text-align: center; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }

/* ── Label / Eyebrow Text ── */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ============================================================
   LAYOUT — CONTAINER & GRID
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-gutter);
  padding-right: var(--container-gutter);
}

.container--narrow { max-width: 900px; }
.container--wide   { max-width: 1600px; }

/* ── Section Spacing ── */
.section {
  padding-top: clamp(var(--space-8), 4vw, var(--space-20));
  padding-bottom: clamp(var(--space-12), 8vw, var(--space-40));
}

.section--sm {
  padding-top: clamp(var(--space-10), 5vw, var(--space-24));
  padding-bottom: clamp(var(--space-10), 5vw, var(--space-24));
}

/* ── Section Header ── */
.section-header {
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-16));
}

.section-header--flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ── Grid Systems ── */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 640px) {
  .grid { gap: var(--space-5); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .grid { gap: var(--space-6); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── Flex Utilities ── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ============================================================
   SURFACE / CARD BASE
   ============================================================ */
.surface {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.surface--2 {
  background: var(--color-surface-2);
}

.glass {
  background: var(--color-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--color-glass-border);
}

/* ============================================================
   DIVIDERS
   ============================================================ */
.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
}

.divider--accent {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.overflow-hidden { overflow: hidden; }
.relative        { position: relative; }
.absolute        { position: absolute; }
.inset-0         { inset: 0; }

.mt-auto  { margin-top: auto; }
.mb-2     { margin-bottom: var(--space-2); }
.mb-3     { margin-bottom: var(--space-3); }
.mb-4     { margin-bottom: var(--space-4); }
.mb-6     { margin-bottom: var(--space-6); }
.mb-8     { margin-bottom: var(--space-8); }
.mt-4     { margin-top: var(--space-4); }
.mt-6     { margin-top: var(--space-6); }
.mt-8     { margin-top: var(--space-8); }

/* ── Truncate text ── */
.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Aspect ratios ── */
.aspect-product   { aspect-ratio: 3 / 4; }
.aspect-hero      { aspect-ratio: 16 / 9; }
.aspect-square    { aspect-ratio: 1 / 1; }
.aspect-category  { aspect-ratio: 4 / 5; }

.aspect-product img,
.aspect-hero img,
.aspect-square img,
.aspect-category img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Scroll snap for category strip ── */
.scroll-snap-x {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
}
.scroll-snap-x::-webkit-scrollbar { display: none; }
.scroll-snap-x > * { scroll-snap-align: start; flex-shrink: 0; }

/* ============================================================
   NOISE TEXTURE OVERLAY
   ============================================================ */
.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  opacity: 0.2;
  z-index: 1;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS REFERENCE
   sm:  640px
   md:  768px
   lg:  1024px
   xl:  1280px
   2xl: 1400px
   ============================================================ */
@media (min-width: 768px) {
  body { font-size: var(--text-md); }
}

/* ============================================================
   DEVICE VISIBILITY CLASSES
   ============================================================ */
.show-desktop-only { display: block !important; }
.show-mobile-only { display: none !important; }

@media (max-width: 768px) {
  .show-desktop-only { display: none !important; }
  .show-mobile-only { display: block !important; }

  /* Fix 1: Make product image fit perfectly and fill the box on mobile */
  .woocommerce-product-gallery {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .woocommerce-product-gallery__wrapper,
  .woocommerce-product-gallery__image,
  .woocommerce-product-gallery__image a,
  .woocommerce-product-gallery__image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  /* Fix 3: Hide quick add overlay on mobile cards to prevent accidental taps */
  .product-card__overlay {
    display: none !important;
  }

  /* Fix 4: Shrink the Buy Now button on shop cards so it fits mobile screens perfectly */
  .card-atc-btn {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.7rem !important;
    min-width: 0 !important;
    width: auto !important;
    white-space: nowrap !important;
  }
  .card-atc-btn span {
    font-size: 0.7rem !important;
  }
}

/* Fix 2: Prevent PC slider arrows from triggering the image zoom by pulling them to the front */
.woocommerce-product-gallery .flex-direction-nav, 
.woocommerce-product-gallery .flex-direction-nav a,
.woocommerce-product-gallery .swiper-button-next, 
.woocommerce-product-gallery .swiper-button-prev, 
.woocommerce-product-gallery .slick-arrow,
.woocommerce-product-gallery .flex-control-nav {
  position: relative !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
}

/* --- Shop Archive Card Footer Layout --- */
.shop-archive-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 16px 16px; /* Added spacing from the edges */
}
.shop-archive-price-wrap {
  display: flex;
  flex-direction: row; /* ALWAYS Left-to-Right */
  align-items: center;
  gap: 6px;
}
.shop-archive-price-wrap .price-original {
  font-size: 0.75rem;
  color: #999;
  text-decoration: line-through;
  order: 1; /* Crossed out price on the left */
}
.shop-archive-price-wrap .price-current {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-main, #333);
  order: 2; /* Main price on the right */
}

/* Button Text Swapping */
.shop-archive-btn-wrap .btn-text-mobile {
  display: none;
}
.shop-archive-btn-wrap .btn-text-pc {
  display: inline;
}

.shop-archive-btn-wrap .reference-btn {
  background-color: #6B8CFF !important;
  color: #fff !important;
  border-radius: 50px !important; /* Perfect pill shape */
  padding: 0.3rem 0.7rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-transform: none !important;
  border: none !important;
  transition: opacity 0.2s !important;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(107, 140, 255, 0.2) !important;
}
.shop-archive-btn-wrap .reference-btn:hover {
  opacity: 0.9 !important;
  background-color: #5A7AE6 !important;
}

/* --- Mobile Layout for Shop Archive Cards --- */
@media (max-width: 768px) {
  .shop-archive-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .shop-archive-price-wrap .price-original {
    font-size: 0.7rem;
  }
  .shop-archive-price-wrap .price-current {
    font-size: 1rem;
  }
  .shop-archive-btn-wrap {
    width: 100%;
  }
  .shop-archive-btn-wrap .reference-btn {
    width: 100% !important; /* Full width below price */
    background-color: #172033 !important; /* Premium Dark Blue from screenshot */
    padding: 0.6rem !important; /* Taller button for easy tapping */
    font-size: 0.75rem !important; /* Smaller, cleaner font size */
    border-radius: 50px !important; /* Ensure it stays a pill */
    box-shadow: none !important;
  }
  /* Hide PC Icon and Text on Mobile */
  .shop-archive-btn-wrap .pc-only-icon,
  .shop-archive-btn-wrap .btn-text-pc {
    display: none !important;
  }
  /* Show Mobile Text */
  .shop-archive-btn-wrap .btn-text-mobile {
    display: inline !important;
  }
}

/* ============================================================
   ENTRY CONTENT - Standard Page Typography Spacing
   ============================================================ */
.entry-content {
  color: var(--color-text-secondary);
  line-height: 1.8;
  font-size: var(--text-base);
}

.entry-content p {
  margin-bottom: var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.entry-content ul,
.entry-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.entry-content ul li {
  list-style-type: disc !important;
  margin-bottom: var(--space-2);
}

.entry-content ol li {
  list-style-type: decimal !important;
  margin-bottom: var(--space-2);
}

.entry-content strong {
  color: var(--color-text-primary);
  font-weight: var(--fw-semibold);
}
