/* ============== Dragon Bred • Nike-Inspired Design System ============== */

/* Nike-inspired design tokens */
:root{
  /* Nike Color Palette */
  --bg:#ffffff;
  --panel:#f8f9fa;
  --card:#ffffff;
  --ink:#000000;        /* Nike's signature black */
  --muted:#757575;      /* Nike's gray */
  --brand:#000000;      /* Nike's primary black */
  --brand-soft:#333333; /* Dark gray for CTAs */
  --accent:#000000;     /* Nike's accent black */
  --accent-light:#666666;
  --accent-dark:#000000;
  --success:#000000;
  --warning:#ff6b35;    /* Nike's orange accent */
  --line:rgba(0,0,0,.1);
  --shadow:rgba(0,0,0,.08);
  --gradient:linear-gradient(135deg, #000000 0%, #333333 100%);

  /* Nike Typography */
  --font-primary: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --font-weight-black: 900;

  /* Nike Spacing System */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Nike Product Grid */
  --pg-min: 280px;   /* Nike-style card width */
  --pg-img-h: 320px; /* Nike-style image height */
}

/* Resets / base */
* { box-sizing: border-box; }
html, body { height: 100%; }
/* Mobile rendering safeguards */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
img, video, canvas, svg { max-width: 100%; height: auto; }

/* Lazy loading styles */
.lazy-loading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-loading.loaded {
  opacity: 1;
}

.lazy-loading.error {
  opacity: 1;
  background-color: #f5f5f5;
}

/* Performance optimizations */
img {
  content-visibility: auto;
  contain-intrinsic-size: 300px 300px;
}

/* Reduce layout shifts */
.img-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

/* Smooth transitions */
.product-card {
  will-change: transform;
}

.product-card:hover {
  will-change: auto;
}
body {
  margin: 0;
  font-family: var(--font-primary);
  color: var(--ink);
  background: var(--bg);
  /* Sticky layout */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Nike-style typography */
  font-size: 1rem;
  line-height: 1.5;
  font-weight: var(--font-weight-normal);
  letter-spacing: 0;
  /* Ensure body can scroll */
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Links */
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nike-style Header / Navigation */
header {
  background: #ffffff;
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

/* Nike-style Logo */
.logo {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-black);
  font-size: 1.5rem;
  color: var(--brand);
  letter-spacing: 0.05em;
}

.logo a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
}

.logo a:hover {
  text-decoration: none;
}

header .logo {
  height: 50px;
  display: flex;
  align-items: center;
}

header .logo img {
  height: 100%;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

/* Nike-style Navigation */
nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

nav ul { 
  list-style: none; 
  display: flex; 
  gap: var(--space-xl); 
  margin: 0; 
  padding: 0;
  flex-wrap: wrap;
}

nav li { 
  font-weight: var(--font-weight-medium); 
  font-size: 0.95rem; 
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

nav a { 
  color: var(--ink); 
  transition: color 0.2s ease;
}

nav a:hover { 
  color: var(--muted); 
  text-decoration: none;
}

/* Let main fill remaining height */
/* UPDATED: widen and make padding responsive */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(1rem, 2.2vw, 2.2rem);
  padding-top: 85px;
  flex: 1 0 auto;
  min-height: calc(100vh - 200px);
}

/* Nike-style Headings */
h1, h2 { 
  color: var(--brand); 
  font-family: var(--font-primary);
}

h1 {
  text-align: center;
  margin: 0 0 var(--space-lg);
  font-weight: var(--font-weight-black);
  font-size: 3rem;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

h2 {
  font-weight: var(--font-weight-bold);
  font-size: 2rem;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

/* Generic cards / sections */
.card, .section-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  padding: 1.6rem;
  margin-bottom: 1.8rem; /* gentle spacing between stacks */
}
.section-card p { color: var(--muted); line-height: 1.6; }

/* CTA blocks are centered */
.cta { text-align: center; }

/* Nike-style Buttons */
.btn {
  appearance: none;
  border: 2px solid var(--brand);
  background: var(--brand);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: 0;
  font-weight: var(--font-weight-bold);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
}

.btn:hover { 
  background: white;
  color: var(--brand);
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

/* Primary CTA — keep both syntaxes:
   1) .btn.primary  (space)
   2) .btn-primary  (dash)  <-- your about.html uses this */
.btn.primary,
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  padding: 0.9rem 1.6rem;     /* larger tap target */
  font-size: 1.1em;           /* a touch bigger for prominence */
  letter-spacing: .2px;
}

/* "Buy" style (used on product pages) */
.btn.buy {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Forms (Admin / Contact) */
label { display:block; font-weight:600; margin:10px 0 6px; color: var(--ink); }
input, select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}
textarea { min-height: 100px; resize: vertical; }
.row { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.actions { display:flex; gap:10px; margin-top:14px; }
.status { margin-top:8px; font-weight:600; }
.status.ok { color:#48d597; }
.status.err { color:#ff6b6b; }
.toggle { display:flex; gap:10px; align-items:center; margin:8px 0 0; }
.preview { margin-top:8px; display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.preview img { width:140px; height:105px; object-fit:cover; border-radius:10px; border:1px solid var(--line); }
.toast {
  margin-top:10px; padding:10px; border-radius:8px;
  background:#11204f; border:1px solid #2c3f80; display:none;
}
.list { display:grid; gap:10px; }
.item {
  display:grid; grid-template-columns:90px 1fr auto; gap:12px; align-items:center;
  background:#151a3e; border:1px solid var(--line); border-radius:12px; padding:10px;
}
.item img { width:90px; height:68px; object-fit:cover; border-radius:8px; }

/* ========== SHOP (global defaults that your shop.html can rely on) ========== */

/* Controls row used on some pages */
.filters {
  display:flex; justify-content:center; gap:1rem; margin: 0 0 2rem; flex-wrap:wrap;
}
.filters select {
  padding: 0.6rem 1rem; border-radius: 8px; border: 1px solid var(--line);
  font-size: 1rem; background: var(--card); color: var(--ink); cursor: pointer;
}

/* Core grid helpers (ensure grids fill the width instead of centering) */
.products-grid,
.grid.products,
#productGrid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--pg-min), 1fr));
  gap: 1.5rem;
  justify-content: normal;
  justify-items: stretch;
  align-items: stretch;
}

/* Nike-style Product Cards */
.product-card {
  background: var(--card);
  border: none;
  border-radius: 0;
  padding: 0;
  text-align: left;
  box-shadow: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.product-card:hover { 
  transform: translateY(-8px); 
  box-shadow: 0 8px 32px rgba(0,0,0,.12); 
}

/* Nike-style Image Wraps */
.img-wrap,
.imgWrap {
  position: relative;
  width: 100%;
  height: var(--pg-img-h);
  background: #f8f9fa;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: var(--space-md);
  display: flex; 
  align-items: center; 
  justify-content: center;
}

.img-wrap img,
.imgWrap img {
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
  transition: transform 0.3s ease;
}

.product-card:hover .img-wrap img {
  transform: scale(1.05);
}

/* Nike-style Product Text */
.h3 { 
  color: var(--brand); 
  margin: var(--space-sm) 0; 
  font-weight: var(--font-weight-bold); 
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.desc { 
  font-size: 0.9rem; 
  margin: 0 0 var(--space-md); 
  color: var(--muted); 
  line-height: 1.4;
}

.price { 
  font-weight: var(--font-weight-bold); 
  font-size: 1.1rem; 
  margin-bottom: var(--space-md); 
  color: var(--brand);
}

.btn-group { 
  display: flex; 
  justify-content: flex-start; 
  gap: var(--space-sm); 
}
.dots { display:flex; gap:6px; justify-content:center; margin-top:.35rem; min-height:10px; }
.dot { width:6px; height:6px; border-radius:50%; background:#6b78b6; opacity:.65; }
.dot.active { opacity:1; background:#9db6ff; }

/* Product detail page */
.product-card-lg {
  background:#3a2a75; border:1px solid var(--line);
  border-radius:10px; padding:1.2rem;
  display:grid; grid-template-columns:1.6fr 1fr; gap:1.2rem;
}
.product-card-lg .details { display:flex; flex-direction:column; }
@media (max-width: 900px){
  .product-card-lg { grid-template-columns: 1fr; }
  .thumbs img { width:72px; height:72px; }
}
.media {
  background:linear-gradient(135deg,#3a1c6e, #5a2ea6);
  border-radius:10px; padding:.8rem;
  display:flex; flex-direction:column; gap:.6rem;
}
.mainImg { width:100%; aspect-ratio:4/3; object-fit:contain; display:block; border-radius:8px; background:#251e4a; }
.thumbs { display:flex; gap:.5rem; flex-wrap:wrap; }
.thumbs img {
  width:90px; height:68px; object-fit:cover; border-radius:8px;
  cursor:pointer; border:2px solid transparent; background:#251e4a;
}
.thumbs img.active { border-color: var(--brand); }
.details h1 { color: var(--brand); margin:0 0 .5rem; font-size:1.8rem; }
.meta { color: var(--muted); margin:.3rem 0 1rem; }
.price-lg { font-weight:800; font-size:1.4rem; margin:1rem 0; }
.cta { display:flex; gap:.6rem; flex-wrap:wrap; }

/* Related products */
.related { margin-top:2rem; background:#251e4a; border-radius:10px; padding:1.2rem; }
.related h2 { font-family:'Inter',sans-serif; color:var(--brand); margin:0 0 1rem; font-size:1.3rem; font-weight:600; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem;
  /* NEW: make sure generic grids also fill the row */
  justify-content: normal; justify-items: stretch; align-items: stretch;
}
.mini-card {
  background:#3a2a75; border:1px solid var(--line); border-radius:10px;
  padding:.8rem; text-align:center;
}
.mini-card img {
  width:100%; max-width:160px; height:120px; object-fit:contain;
  background:#251e4a; border-radius:8px; margin:.3rem auto .6rem; display:block;
}
.mini-price { font-weight:700; margin-bottom:.6rem; color:#eee; }
.mini-btn { background:#1e2a5c; color:#eee; border:1px solid var(--line);
  padding:.45rem .8rem; border-radius:8px; font-weight:700; cursor:pointer; }

/* About page characters */
.side-character {
  position: fixed;
  width: clamp(190px, 18vw, 320px);
  z-index: 0; user-select:none; pointer-events:none;
  will-change: transform; transform-origin:center;
  animation: float-wobble 4.8s ease-in-out infinite alternate;
}
.side-character.left  { left:8px;  top: clamp(96px, 22vh, 320px); }
.side-character.right { right:8px; bottom: clamp(96px, 18vh, 260px); animation-duration:5.4s; }
@keyframes float-wobble {
  0%   { transform: translate(0px, 6px)  rotate(0.2deg); }
  50%  { transform: translate(8px, -18px) rotate(-0.2deg); }
  100% { transform: translate(-6px, -32px) rotate(0.2deg); }
}
@media (prefers-reduced-motion: reduce) { .side-character { animation: none; } }
@media (max-width: 768px) { .side-character { display:none; } }

/* Helpers */
.center { text-align:center; }
.status-inline { color: var(--muted); }

/* === UX & Visual Enhancements === */

/* subtle 3D tilt on product cards */
.card-tilt {
  transform-style: preserve-3d;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card-tilt:hover {
  transform: translateY(-4px) rotateX(.8deg) rotateY(.8deg) scale(1.01);
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}

/* badges (e.g., console type, condition, includes) */
.badges {
  display:flex; gap:.35rem; justify-content:center; flex-wrap:wrap;
  margin:.35rem 0 .5rem;
}
.badge {
  font-size:.8rem; font-weight:800; letter-spacing:.2px;
  padding:.25rem .5rem; border-radius:999px;
  border:1px solid rgba(255,255,255,.15);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.15));
  color:#e9e9ff;
}
.badge.nintendo  { background: linear-gradient(180deg, #3b82f6, #2b5db3); color:#fff; border-color:#3b73da; }
.badge.xbox      { background: linear-gradient(180deg, #22c55e, #168c42); color:#021b0e; border-color:#18924a; }
.badge.playstation{background: linear-gradient(180deg, #60a5fa, #2a5bd7); color:#07142e; border-color:#3f76ea;}
.badge.retro     { background: linear-gradient(180deg, #fbbf24, #c08400); color:#231800; border-color:#d09a12; }

/* skeleton shimmer (for big images while they load) */
.skeleton {
  position:relative; overflow:hidden; background:#2a2f55;
}
.skeleton::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* section header helper (used on product page recommendations) */
.section-head {
  display:flex; align-items:center; justify-content:space-between;
  margin: 1.2rem 0 .6rem;
}
.section-head h3 { margin:0; font-family:'Inter',sans-serif; color:var(--brand); font-size:1.1rem; font-weight:600; }

/* ========== NIKE-STYLE RESPONSIVE DESIGN ========== */
@media (max-width: 1200px){
  :root{ --pg-min: 260px; --pg-img-h: 300px; }
}

@media (max-width: 768px){
  :root{ --pg-min: 200px; --pg-img-h: 240px; }
  
  /* Nike mobile typography */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  /* Nike mobile header */
  header { 
    padding: var(--space-sm) var(--space-md); 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: var(--space-sm);
    height: auto;
    min-height: 70px;
  }
  
  header .logo {
    height: 38px;
  }
  
  header .logo img {
    max-width: 130px;
  }
  
  nav {
    position: static;
    transform: none;
  }
  
  nav ul { 
    gap: var(--space-md); 
    font-size: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  main {
    padding-top: 80px;
  }
}

@media (max-width: 640px){
  :root{ --pg-min: 160px; --pg-img-h: 200px; }
  
  /* Nike mobile layout */
  header { 
    flex-direction: column; 
    align-items: center; 
    gap: var(--space-sm); 
    padding: var(--space-sm) var(--space-md);
    height: auto;
    min-height: 60px;
  }
  
  header .logo {
    height: 35px;
  }
  
  header .logo img {
    max-width: 120px;
  }
  
  nav ul { 
    gap: var(--space-sm); 
    font-size: 0.75rem;
    flex-wrap: wrap;
  }
  
  main { 
    padding: var(--space-md); 
    margin-top: 70px;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.25rem; }
  
  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
  }
  
  .card, .section-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }
}

/* === Hide scrollbars globally (keep scrolling working) === */
html, body {
  -ms-overflow-style: none; /* IE and legacy Edge */
  scrollbar-width: none;    /* Firefox */
  overflow-x: hidden; /* Prevent horizontal scroll */
  overflow-y: auto; /* Allow vertical scrolling */
  height: 100%;
  position: relative;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

/* ========== FOOTER WITH TWO BANNERS ========== */
.site-footer {
  margin-top: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 30; /* Ensure footer is above hero (z-index: 0) and main (z-index: 20) */
  background: #000000; /* Ensure footer has background */
}

/* Black Banner - Dragon Bred & Get In Touch */
.footer-black-banner {
  background: #000000;
  color: #ffffff;
  padding: 3rem 0;
  border-top: 2px solid #333333;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.footer-black-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.footer-black-section h4 {
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: 1.5rem;
  font-style: normal;
  color: #ffffff;
  margin: 0 0 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.footer-black-section p,
.footer-black-section a {
  color: #cccccc;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.7;
  margin: 0.75rem 0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-black-section a:hover {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* White Banner - Quick Links Only */
.footer-white-banner {
  background: #36454F;
  color: #ffffff;
  padding: 2rem 0;
  margin-top: 0;
}

.footer-white-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: center;
}

.footer-white-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-white-section h4 {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 1rem 0 0 0;
}

.footer-links li {
  margin: 0.8rem 0;
}

.footer-links a {
  color: #cccccc;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  padding: 0.2rem 0;
}

.footer-links a:hover {
  color: #ffffff;
  transform: translateY(-2px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hidden admin link in footer */
.footer-links a.hidden-admin-link {
  color: #ffffff;
  font-size: 0.5rem;
  opacity: 0.01;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.footer-links a.hidden-admin-link:hover {
  color: #ffffff;
  transform: none;
  text-shadow: none;
  cursor: default;
}

/* Admin button in footer - barely visible but clickable */
.footer-admin-button {
  display: inline-block;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: transparent;
  text-decoration: none;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0;
  border-radius: 50%;
  transition: all 0.3s ease;
  margin: 0;
  cursor: pointer;
}

.footer-admin-button:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

/* Footer Responsive */
@media (max-width: 768px) {
  .footer-black-banner {
    padding: 2rem 0;
  }
  
  .footer-black-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
    padding: 0 1.5rem;
  }
  
  .footer-black-section h4 {
    font-size: 1.2rem;
    margin: 0 0 1rem;
  }
  
  .footer-black-section p,
  .footer-black-section a {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .footer-white-content {
    text-align: center;
    padding: 0 1.5rem;
  }
  
  .footer-white-banner {
    padding: 1.5rem 0;
  }
  
  .footer-links a {
    font-size: 1.1rem;
  }
}

@media (max-width: 640px) {
  .footer-black-banner {
    padding: 1.5rem 0;
  }
  
  .footer-black-content {
    padding: 0 1rem;
    gap: 1.5rem;
  }
  
  .footer-black-section h4 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
  }
  
  .footer-black-section p,
  .footer-black-section a {
    font-size: 0.9rem;
    margin: 0.5rem 0;
  }
  
  .footer-white-content {
    padding: 0 1rem;
  }
  
  .footer-white-banner {
    padding: 1rem 0;
  }
  
  .footer-links {
    padding: 0.5rem 0 0 0;
  }
  
  .footer-links li {
    margin: 0.5rem 0;
  }
  
  .footer-links a {
    font-size: 1rem;
  }
}
