/* ─── RESET & VARIABLE BASE LAYERS ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:       #080c14;
  --bg-surface:    #0d1220;
  --bg-card:       #111827;
  --bg-card-hover: #141d2e;
  --border:        rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.13);
  --neon:          #1e90ff;
  --neon-dim:      rgba(30,144,255,0.15);
  --neon-glow:     rgba(30,144,255,0.35);
  --text-primary:  #f0f4ff;
  --text-secondary:#7a8ba0;
  --text-muted:    #3a4a5e;
  --font-display:  'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── NAVIGATION BAR FIXES ────────────────────────────────────────────────── */
.nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(8, 12, 20, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 5000;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}

.logo-mark {
  background: var(--neon);
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover { color: #fff; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-signin {
  background: none;
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-signin:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

/* ─── BUTTONS & GENERAL BADGES ────────────────────────────────────────────── */
.btn-primary {
  background: var(--neon);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--neon-glow);
}

.cart-trigger {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-trigger:hover { color: #fff; }

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #00c882;
  color: white;
  font-size: 11px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── HERO & BANNER SYSTEM (CENTERED ABOVE MOUNTAINS) ───────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  text-align: center;
  overflow: hidden;
  display: block; /* Removed flex layout to stop right-side squeezing */
  padding-top: 100px;
}

.hero-video-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 12, 20, 0.6) 0%,
    rgba(8, 12, 20, 0.5) 50%,
    rgba(8, 12, 20, 0.85) 85%,
    var(--bg-base) 100%
  );
}

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--neon-dim);
  border: 1px solid rgba(30, 144, 255, 0.2);
  color: #8cc2ff;
  padding: 10px 18px;
  font-size: 13px;
  border-radius: 30px;
  max-width: fit-content;
  margin: 0 auto 24px auto;
}

.banner-dot {
  width: 6px;
  height: 6px;
  background: var(--neon);
  border-radius: 50%;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #fff;
}

.hero-highlight { color: var(--neon); }

.hero-sub {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto 40px auto;
}

.video-mute-btn {
  position: absolute;
  bottom: 32px;
  right: 32px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}
.video-mute-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

/* ─── CARD VIDEO HOVER PLAY ──────────────────────────────────────────── */
.card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.template-card:hover .card-video { transform: scale(1.04); }

.play-icon-hint {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(30, 144, 255, 0.75);
  color: #fff;
  font-size: 11px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
}

.card-thumb:hover .play-icon-hint { opacity: 0; }

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.3s var(--ease-out);
}

.tab-btn:hover { color: #fff; }
.tab-btn.active {
  background: var(--neon);
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 144, 255, 0.3);
}

/* ─── STOREFRONT SHOWCASE GRID ────────────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 40px 0;
}

.template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out) !important;
}

.template-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  border-color: var(--border-bright);
}

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card-thumb:hover .card-overlay { opacity: 1; }

.btn-preview, .btn-add-cart, .btn-download {
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s ease;
}

.btn-preview { background: #fff; color: #000; }
.btn-add-cart { background: rgba(255,255,255,0.08); color: #fff; }
.btn-download { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-preview:hover { background: #e0e0e0; }
.btn-add-cart:hover { background: #fff; color: #000; }
.btn-download:hover { background: var(--neon); color: #fff; }

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--neon);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
}

.badge-sale { background: #ef4444; }
.card-body { padding: 20px; }

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-tag { color: var(--neon); font-size: 12px; font-weight: 600; }
.card-rating { color: #ffb800; font-size: 12px; }
.card-title { font-family: var(--font-display); font-size: 16px; color: #fff; margin-bottom: 12px; }

.resolution-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.resolution-selector label {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.resolution-selector input[type="radio"] { accent-color: var(--neon); cursor: pointer; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.card-price { font-weight: 700; color: #fff; font-size: 16px; }
.card-downloads { color: var(--text-muted); font-size: 12px; }

/* ─── DRAWERS & OVERLAYS ────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: #0d1220;
  border-left: 1px solid var(--border);
  z-index: 10000;
  transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.cart-sidebar.open { right: 0 !important; }
.cart-overlay.open { opacity: 1 !important; pointer-events: auto !important; }

.cart-header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-title { font-family: var(--font-display); color: #fff; font-size: 18px; }
.cart-close { background: none; border: none; color: var(--text-secondary); font-size: 20px; cursor: pointer; }

/* Cart scrollable items area */
.cart-items {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-bright) transparent;
}
.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }

/* Cart sticky footer */
.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: #0d1220;
  flex-shrink: 0;
}

/* Cart Item Rows Inside Drawer */
.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.cart-item-info h4 { color: #fff; font-size: 14px; margin-bottom: 4px; }
.cart-item-info p { color: var(--neon); font-size: 12px; }
.cart-item-price { color: #fff; font-weight: 600; font-size: 14px; }

/* ─── POP-UP AUTH MODAL & PREVIEW LAYOUTS ────────────────── */
main { position: relative; z-index: 1; }

.auth-modal, .preview-modal {
  position: fixed;
  inset: 0 !important;
  background: rgba(4, 6, 10, 0.85) !important;
  backdrop-filter: blur(8px);
  display: none; 
  justify-content: center !important;
  align-items: center !important;
  z-index: 99999 !important; 
}

.auth-box {
  background: #0d1220 !important;
  padding: 40px 30px !important;
  border-radius: 16px !important;
  width: 90% !important;
  max-width: 400px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
  position: relative !important;
}

.auth-box h2 { font-family: 'Syne', sans-serif; color: #fff; margin-bottom: 20px; font-size: 24px; }
.auth-box input {
  width: 100% !important;
  padding: 14px 16px !important;
  margin: 10px 0 !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #fff !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

.auth-close { position: absolute !important; top: 16px !important; right: 18px !important; color: #7a8ba0 !important; font-size: 24px !important; background: none !important; border: none !important; cursor: pointer !important; }

.preview-content {
  position: relative !important;
  max-width: 800px !important; 
  width: 85% !important;
  background: #0d1220 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8) !important;
}

#previewMediaContainer {
  width: 100% !important;
  background: #030508 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
}

#previewMediaContainer video {
  width: 100% !important;
  height: auto !important;
  max-height: 65vh !important;
  object-fit: contain !important;
}

.preview-close { position: absolute !important; top: 12px !important; right: 18px !important; background: none !important; border: none !important; color: #fff !important; font-size: 32px !important; cursor: pointer !important; z-index: 100 !important; }

#previewDetails { padding: 24px !important; background: #0d1220 !important; border-top: 1px solid rgba(255,255,255,0.05) !important; }
#previewTitle { color: #fff !important; font-family: 'Syne', sans-serif !important; font-size: 20px !important; margin: 0 0 6px 0 !important; }
#previewTag { color: #1e90ff !important; font-size: 14px !important; font-weight: 500 !important; }

/* Fix preview container collapsing */
#previewMediaContainer { min-height: 200px !important; }

/* ─── RESPONSIVE / MOBILE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; } /* hide nav links on mobile */

  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 15px; }

  .templates-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  .card-overlay {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
  }

  .btn-preview, .btn-add-cart, .btn-download {
    font-size: 11px;
    padding: 6px 10px;
  }

  .auth-box {
    padding: 24px 18px !important;
  }
}

@media (max-width: 480px) {
  .nav { padding: 0 16px; }
  .container { padding: 0 16px; }
  .hero-title { font-size: 26px; }
  .nav-logo span { display: none; } /* show only logo mark on very small screens */
}