/* ═══════════════════════════════════════════════════
   VISION LUXE SÉCURITÉ — Main Stylesheet
   Brand: Deep navy + silver/platinum + white
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800;900&family=Open+Sans:wght@300;400;500;600&display=swap');

:root {
  /* Brand Colors — derived from logo */
  --navy:       #0d1f3c;
  --navy-light: #132845;
  --navy-mid:   #1a3358;
  --silver:     #b8c4d4;
  --platinum:   #d6dfe8;
  --white:      #ffffff;

  /* UI Colors */
  --bg:         #f0f2f5;
  --surface:    #ffffff;
  --border:     #dce3ec;
  --border-dark:#b8c4d4;
  --text:       #1a2640;
  --muted:      #6b7c96;
  --light-bg:   #f7f9fc;

  /* Accent */
  --accent:     #1a5fa8;
  --accent-hover:#1348851;
  --gold:       #c9a84c;
  --green:      #1e7e4a;
  --red:        #c0392b;

  /* Layout */
  --nav-h: 72px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 2px 16px rgba(13,31,60,0.08);
  --shadow-hover: 0 8px 32px rgba(13,31,60,0.16);
}

/* ── RESET & BASE ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { 
  scroll-behavior: smooth; 
  font-size: 16px; 
  font-variant-numeric: lining-nums; /* Adds uniform height to numbers */
  font-feature-settings: "lnum"; /* Fallback for older browsers */
}
body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── TYPOGRAPHY ── */
h1,h2,h3,h4,h5 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}

/* ════════════════════════════════════
   NAVBAR
════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  background: var(--navy);
  display: flex; align-items: center;
  padding: 0 40px;
  gap: 32px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Logo */
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; flex-shrink: 0;
  text-decoration: none;
}
.nav-logo img {
  height: 44px; width: 44px;
  object-fit: contain;
  border-radius: 6px;
  filter: brightness(1.05);
}
.nav-logo-text {
  display: flex; flex-direction: column; line-height: 1.1;
}
.nav-logo-text .brand-main {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem; font-weight: 800;
  color: var(--white);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-logo-text .brand-sub {
  font-family: 'Raleway', sans-serif;
  font-size: 0.62rem; font-weight: 500;
  color: var(--silver);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* Nav Links */
.nav-links {
  display: flex; gap: 2px; flex: 1;
}
.nav-link {
  background: none; border: none; cursor: pointer;
  color: var(--silver);
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem; font-weight: 600;
  padding: 8px 16px; border-radius: 6px;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.07); }
.nav-link.active { color: var(--white); background: rgba(255,255,255,0.1); }

/* Language toggle */
.lang-toggle {
  display: flex; gap: 4px; align-items: center;
}
.lang-btn {
  background: none; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; color: var(--silver);
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; cursor: pointer;
  letter-spacing: 0.05em; transition: all 0.2s;
}
.lang-btn:hover, .lang-btn.active { background: rgba(255,255,255,0.12); color: #fff; }

/* Cart Button */
.cart-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem; font-weight: 700;
  padding: 8px 20px; border-radius: 6px;
  letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.2s; flex-shrink: 0;
  text-transform: uppercase;
}
.cart-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4); }
.cart-icon { font-size: 1rem; }
.cart-count {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 0.68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  min-width: 20px;
}

/* ════════════════════════════════════
   PAGE SYSTEM
════════════════════════════════════ */
.page { display: none; padding-top: var(--nav-h); min-height: 100vh; }
.page.active { display: block; }

/* ════════════════════════════════════
   SHARED COMPONENTS
════════════════════════════════════ */

/* Section layout */
.section { padding: 72px 60px; }
.section-sm { padding: 48px 60px; }
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 40px;
}
.section-title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.9rem; font-weight: 800;
  color: var(--navy);
  position: relative;
}
.section-title::after {
  content: '';
  display: block; width: 40px; height: 3px;
  background: var(--accent);
  margin-top: 8px; border-radius: 2px;
}
.section-link {
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem; font-weight: 600;
  color: var(--accent); cursor: pointer;
  background: none; border: none;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}
.section-link:hover { opacity: 0.7; }

/* Buttons */
.btn-primary {
  background: var(--navy);
  color: var(--white);
  border: none; cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem; font-weight: 700;
  padding: 13px 30px; border-radius: var(--radius);
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: var(--shadow-hover); }

.btn-accent {
  background: var(--accent);
  color: var(--white);
  border: none; cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem; font-weight: 700;
  padding: 13px 30px; border-radius: var(--radius);
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 0.2s;
}
.btn-accent:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem; font-weight: 700;
  padding: 13px 30px; border-radius: var(--radius);
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 0.2s;
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.08); }

/* Badges */
.badge {
  display: inline-block;
  font-family: 'Raleway', sans-serif;
  font-size: 0.65rem; font-weight: 800;
  padding: 4px 10px; border-radius: 4px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.badge-new  { background: var(--navy); color: #fff; }
.badge-hot  { background: #c0392b; color: #fff; }
.badge-sale { background: var(--green); color: #fff; }
.badge-promo{ background: var(--gold); color: #fff; }

/* Product Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  transition: all 0.25s;
  box-shadow: var(--shadow);
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  border-color: var(--border-dark);
}
.product-img {
  height: 200px;
  display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem;
  background: var(--light-bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.product-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(13,31,60,0.03));
}
.product-badge {
  position: absolute; top: 12px; left: 12px;
}
.product-info { padding: 18px 20px; }
.product-cat {
  font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 7px; font-weight: 600;
}
.product-name {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem; font-weight: 700;
  margin-bottom: 8px; line-height: 1.3;
  color: var(--navy);
}
.product-desc {
  font-size: 0.78rem; color: var(--muted);
  line-height: 1.55; margin-bottom: 16px;
}
.product-footer {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.product-price {
  font-family: 'Raleway', sans-serif;
  font-size: 1.25rem; font-weight: 800;
  color: var(--navy);
}
.product-price .old-price {
  font-size: 0.8rem; color: var(--muted);
  text-decoration: line-through;
  margin-left: 6px; font-weight: 400;
  font-family: 'Open Sans', sans-serif;
}
.add-btn {
  background: var(--navy); color: var(--white);
  border: none; cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-size: 0.75rem; font-weight: 700;
  padding: 8px 16px; border-radius: 6px;
  letter-spacing: 0.05em; text-transform: uppercase;
  transition: all 0.2s;
}
.add-btn:hover { background: var(--accent); }

/* Category Cards */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.cat-card {
  border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  position: relative; aspect-ratio: 3/4;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--shadow);
}
.cat-card:hover { transform: scale(1.02); box-shadow: var(--shadow-hover); }
.cat-bg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.cat-bg-1 { background: linear-gradient(160deg, #0d1f3c, #1a3358); }
.cat-bg-2 { background: linear-gradient(160deg, #1a2f1a, #0d2010); }
.cat-bg-3 { background: linear-gradient(160deg, #1f1a0d, #2d2207); }
.cat-bg-4 { background: linear-gradient(160deg, #1a0d1f, #220d2d); }
.cat-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,31,60,0.92) 0%, rgba(13,31,60,0.2) 55%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px;
}
.cat-name {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem; font-weight: 800;
  color: #fff; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cat-count { font-size: 0.75rem; color: var(--silver); margin-top: 4px; }
.cat-border {
  width: 24px; height: 2px; background: var(--accent);
  margin-bottom: 10px; border-radius: 2px;
}

/* Toast */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: var(--navy);
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 0.85rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(13,31,60,0.3);
  border-left: 3px solid var(--accent);
  transform: translateY(120px); opacity: 0;
  transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Forms */
.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--light-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 10px;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,95,168,0.1);
  background: var(--white);
}

/* Footer */
footer {
  background: var(--navy);
  color: var(--silver);
  padding: 56px 60px 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.footer-logo img {
  height: 40px; width: 40px; object-fit: contain;
  border-radius: 6px;
}
.footer-brand-name {
  font-family: 'Raleway', sans-serif;
  font-size: 0.95rem; font-weight: 800;
  color: var(--white); letter-spacing: 0.08em;
  text-transform: uppercase; line-height: 1.1;
}
.footer-brand-sub {
  font-size: 0.6rem; color: var(--silver);
  letter-spacing: 0.2em; text-transform: uppercase;
}
.footer-desc {
  font-size: 0.8rem; line-height: 1.7;
  color: #6d82a0; max-width: 240px;
}
.footer-col-title {
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem; font-weight: 800;
  color: var(--platinum);
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 18px;
}
.footer-link {
  display: block; font-size: 0.8rem; color: #6d82a0;
  margin-bottom: 10px; cursor: pointer;
  background: none; border: none; text-align: left;
  font-family: 'Open Sans', sans-serif;
  transition: color 0.2s; padding: 0;
}
.footer-link:hover { color: var(--platinum); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.75rem; color: #4a5f7a;
}
.footer-bottom-brand {
  font-family: 'Raleway', sans-serif; font-weight: 700;
  color: var(--silver); font-size: 0.78rem;
}

/* Stats Bar */
.stats-bar {
  background: var(--navy-light);
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.stat-item {
  padding: 28px 32px;
  border-right: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: 'Raleway', sans-serif;
  font-size: 2rem; font-weight: 900;
  color: var(--platinum);
  margin-bottom: 4px;
}
.stat-label { font-size: 0.75rem; color: var(--silver); letter-spacing: 0.05em; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-up  { animation: fadeUp 0.6s ease both; }
.animate-in  { animation: fadeIn 0.5s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stats-bar   { grid-template-columns: 1fr 1fr; }
  .stat-item   { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .cat-grid    { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { padding: 0 20px; gap: 16px; }
  .nav-links { display: none; }
  .section, .section-sm { padding: 48px 20px; }
  .cat-grid    { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stats-bar   { grid-template-columns: 1fr 1fr; }
  footer       { padding: 40px 20px 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .cat-grid      { grid-template-columns: 1fr 1fr; }
  .stats-bar     { grid-template-columns: 1fr; }
  .stat-item     { border-right: none; }
}

/* ── Category Filter Buttons (Catalog Sidebar) ── */
.cat-filter-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  background: none; border: 1px solid transparent;
  border-radius: 7px; cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.84rem; font-weight: 500;
  padding: 8px 12px; color: var(--text);
  text-align: left; transition: all 0.18s;
}
.cat-filter-btn:hover {
  background: var(--light-bg); border-color: var(--border);
  color: var(--navy);
}
.cat-filter-btn.active {
  background: var(--navy); color: #fff;
  border-color: var(--navy); font-weight: 600;
}

/* Out-of-stock card */
.product-card.out-of-stock { opacity: 0.72; }
.product-card.out-of-stock .product-img { filter: grayscale(40%); }

/* ── Excel loading state ── */
.excel-loading {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--muted);
  font-size: 0.9rem; gap: 16px;
}
.excel-loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.excel-error {
  grid-column: 1 / -1;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: #c53030;
}
.excel-error p { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.excel-error code {
  background: var(--bg); padding: 2px 6px;
  border-radius: 4px; font-family: monospace;
  font-size: 0.82rem;
}

/* ── Excel Loading State ── */
.excel-loading {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 20px; gap: 16px;
  color: var(--muted); font-size: 0.9rem;
}
.excel-loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.excel-error {
  grid-column: 1 / -1;
  background: #fff5f5; border: 1px solid #fca5a5;
  border-radius: 12px; padding: 32px;
  text-align: center; color: var(--red);
  font-size: 0.88rem; line-height: 1.7;
}
.excel-error strong { display: block; font-size: 1rem; margin-bottom: 8px; }
.excel-error code {
  background: #fee2e2; padding: 2px 6px;
  border-radius: 4px; font-size: 0.82rem;
}

/* ── Photo Gallery Arrows ── */
.gallery-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(13,31,60,0.65);
  color: #fff;
  border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 1.4rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  opacity: 0;           /* hidden by default */
  z-index: 10;
}
.detail-main-img:hover .gallery-arrow { opacity: 1; }
.gallery-arrow:hover { background: var(--navy); }
.gallery-arrow-left  { left: 10px; }
.gallery-arrow-right { right: 10px; }

/* Hide arrows when product has only 1 or 0 photos */
.detail-main-img.single-photo .gallery-arrow { display: none; }

/* ── Nav links work as <a> tags (hash router) ── */
a.nav-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
a.cart-btn {
  text-decoration: none;
}
/* Breadcrumb <a> tags */
.breadcrumb a {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: 'Open Sans', sans-serif;
  font-size: 0.78rem; transition: color 0.2s;
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent); }

/* ── Variant / Model selector buttons ── */
#productVariants { margin: 14px 0; }

.variant-btn {
  border: 2px solid var(--border-dark);
  background: var(--white);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 72px;
}
.variant-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.variant-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.variant-btn .variant-price {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}
.variant-btn.active .variant-price { opacity: 1; }
