/* ═══════════════════════════════════════════════════════
   TyagiHub Store — Complete Stylesheet
   Light Theme & SVG Icons Update
═══════════════════════════════════════════════════════ */

/* ─── VARIABLES (Light Theme) ─────────────────────────── */
:root {
  --primary:        #5b35e8;
  --primary-dark:   #4525c8;
  --primary-light:  rgba(91,53,232,0.1);
  --accent:         #ff6b35;
  --success:        #16a34a;
  --bg:             #f5f5f8;
  --bg-2:           #ededf2;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f8f8fc;
  --border:         rgba(0,0,0,0.09);
  --border-hover:   rgba(91,53,232,0.35);
  --text:           #111118;
  --text-muted:     #666678;
  --text-dim:       #aaaabc;
  --header-h:       60px;
  --sidebar-w:      240px;
  --radius-sm:      8px;
  --radius:         14px;
  --radius-lg:      20px;
  --shadow:         0 4px 24px rgba(0,0,0,0.05);
  --shadow-md:      0 8px 40px rgba(0,0,0,0.08);
  --tr:             0.18s ease;
}

/* ─── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: var(--header-h);
  padding-bottom: 70px; /* mobile bottom nav */
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select { font-family: inherit; }
ul { list-style: none; }
svg { display: block; } /* For icons */

/* ─── CONTAINER ───────────────────────────────────────── */
.container { max-width: 1300px; margin: 0 auto; padding: 0 16px; }

/* ─── HEADER ──────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 900;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 12px;
}

/* Logo */
.logo { font-size: 1.15rem; font-weight: 800; white-space: nowrap; letter-spacing: -0.5px; }
.logo-store { color: var(--primary); }
.logo:hover { opacity: 0.85; }

/* Desktop Nav */
.desktop-nav { display: none; }

/* Header Search */
.header-search { display: none; }

@media (min-width: 900px) {
  .desktop-nav {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
  }
  .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--tr);
  }
  .nav-link:hover, .nav-link.active { color: var(--text); background: rgba(0,0,0,0.04); }

  .header-search {
    display: flex;
    flex: 1;
    max-width: 400px;
    align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--tr);
  }
  .header-search:focus-within {
    border-color: var(--primary);
    background: var(--bg-card);
  }
  .header-search input {
    flex: 1;
    padding: 8px 14px;
    background: none;
    border: none;
    outline: none;
    font-size: 0.88rem;
    color: var(--text);
  }
  .header-search input::placeholder { color: var(--text-dim); }
  .header-search button {
    padding: 8px 14px;
    font-size: 1rem;
    border-left: 1px solid var(--border);
    transition: var(--tr);
    display: flex;
    align-items: center;
    color: var(--text-muted);
  }
  .header-search button:hover { background: var(--primary-light); color: var(--primary); }
}

/* Auth */
.auth-section { margin-left: auto; flex-shrink: 0; }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--primary);
  object-fit: cover;
  transition: var(--tr);
}
.user-avatar:hover { transform: scale(1.08); box-shadow: 0 0 0 3px var(--primary-light); }

.profile-wrapper { position: relative; }
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 10px;
  z-index: 999;
}
.profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin-bottom: 4px;
}
.profile-info img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.dp-name { display: block; font-size: 0.88rem; font-weight: 700; color: var(--text); }
.dp-email { display: block; font-size: 0.74rem; color: var(--text-muted); }
.dp-hr { border-color: var(--border); margin: 6px 0; }
.dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  transition: var(--tr);
  color: var(--text);
}
.dropdown-btn:hover { background: rgba(0,0,0,0.03); }
.dropdown-btn.danger { color: #ef4444; }
.dropdown-btn.danger:hover { background: rgba(239,68,68,0.1); }

/* ─── STORE MAIN LAYOUT ───────────────────────────────── */
.store-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 30px;
  align-items: start;
}

/* Mobile Search (inside main content) */
.mobile-search-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--tr);
  margin-bottom: 4px;
}
.mobile-search-bar:focus-within { border-color: var(--primary); }
.mobile-search-bar input {
  flex: 1;
  padding: 10px 14px;
  background: none;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: var(--text);
}
.mobile-search-bar input::placeholder { color: var(--text-dim); }
.mobile-search-bar button { 
  padding: 10px 14px; 
  display: flex; 
  align-items: center;
  color: var(--text-muted);
}
.mobile-search-bar button:hover { color: var(--primary); }

@media (min-width: 900px) {
  .store-main {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
  .mobile-search-bar { display: none; }
}

/* ─── SIDEBAR ─────────────────────────────────────────── */
.store-sidebar {

  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: calc(var(--header-h) + 12px);

  /* Mobile: hidden by default, slides in */
  position: fixed;
  top: 0; left: -100%;
  width: 280px;
  height: 100vh;
  z-index: 850;
  overflow-y: auto;
  transition: left 0.25s ease;
  padding-top: 24px;
  box-shadow: var(--shadow-md);
}
.store-sidebar.open { left: 0; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 840;
  backdrop-filter: blur(2px);
}

@media (min-width: 900px) {
  .store-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    height: auto;
    max-height: calc(100vh - var(--header-h) - 32px);
    left: 0;
    width: auto;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
  }
  .sidebar-overlay { display: none !important; }
}

.sidebar-section { margin-bottom: 24px; }
.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Category List */
.category-list { display: flex; flex-direction: column; gap: 4px; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--tr);
}
.cat-item:hover { color: var(--text); background: rgba(0,0,0,0.03); }
.cat-item.active { color: var(--primary); background: var(--primary-light); font-weight: 700; }
.cat-icon { display: flex; align-items: center; justify-content: center; width: 20px; }
.cat-count {
  margin-left: auto;
  font-size: 0.72rem;
  background: rgba(0,0,0,0.05);
  padding: 2px 7px;
  border-radius: 100px;
  color: var(--text-muted);
}
.cat-item.active .cat-count { background: rgba(91,53,232,0.15); color: var(--primary); }

/* Price Filter */
.price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.price-inputs input {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  width: 0;
  transition: border-color var(--tr);
}
.price-inputs input:focus { border-color: var(--primary); background: var(--bg-card); }
.price-inputs span { color: var(--text-dim); font-size: 0.8rem; flex-shrink: 0; }
.btn-apply-filter {
  width: 100%;
  padding: 9px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--tr);
}
.btn-apply-filter:hover { background: var(--primary-dark); }

/* ─── STORE TOPBAR ────────────────────────────────────── */
.store-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.mobile-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: var(--tr);
}
.mobile-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
@media (min-width: 900px) { .mobile-filter-btn { display: none; } }

.result-count { font-size: 0.85rem; color: var(--text-muted); }
.result-count strong { color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.sort-label { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.sort-select {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--tr);
}
.sort-select:focus { border-color: var(--primary); }

/* ─── PRODUCT GRID ────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* ─── PRODUCT CARD ────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--tr), border-color var(--tr), box-shadow var(--tr);
  position: relative;
  box-shadow: var(--shadow);
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px rgba(91,53,232,0.1);
}

/* Product Image */
.product-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  display: block;
}
.product-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.product-thumb-placeholder svg { width: 48px; height: 48px; opacity: 0.5; }

/* Category Badge */
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 100px;
}
.badge-svg      { background: rgba(168,85,247,0.15); color: #9333ea; border: 1px solid rgba(168,85,247,0.3); }
.badge-pdf      { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.badge-document { background: rgba(59,130,246,0.1); color: #2563eb; border: 1px solid rgba(59,130,246,0.3); }
.badge-template { background: rgba(34,197,94,0.1); color: #16a34a; border: 1px solid rgba(34,197,94,0.3); }

/* Wishlist btn */
.wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--tr);
}
.wishlist-btn:hover { background: rgba(239,68,68,0.1); border-color: #f87171; color: #ef4444; }

/* Card Body */
.product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.product-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}
.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.product-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}
.product-price-free { color: var(--success); }
.product-price-original {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: line-through;
}
.btn-buy {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--tr);
  flex-shrink: 0;
}
.btn-buy:hover { background: var(--primary-dark); transform: scale(1.03); }

/* ─── SKELETON ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, #e2e8f0 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  height: 280px;
  border-radius: var(--radius);
  border: none;
  box-shadow: none;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── EMPTY STATE ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1 / -1;
}
.empty-icon { display: flex; justify-content: center; margin-bottom: 16px; color: var(--text-dim); }
.empty-state h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; font-size: 0.9rem; }

/* ─── BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--tr);
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

/* ─── DESKTOP FOOTER ───────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 40px;
  background: var(--bg-card);
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (min-width: 768px) {
  .footer-top { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand .logo { font-size: 1.4rem; display: inline-block; margin-bottom: 12px; }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; max-width: 400px; line-height: 1.6; }
.footer-links-col h4 { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.footer-links-col a { display: block; font-size: 0.88rem; color: var(--text-muted); margin-bottom: 10px; transition: var(--tr); }
.footer-links-col a:hover { color: var(--primary); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.footer-copy { font-size: 0.85rem; color: var(--text-muted); }
.footer-payments { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }

/* ─── MOBILE BOTTOM NAV ─────────────────────────────────── */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 800;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 10px;
  transition: var(--tr);
  text-decoration: none;
}
.mobile-nav-item.active, .mobile-nav-item:hover { color: var(--primary); }
.nav-icon { display: flex; align-items: center; justify-content: center; }
.nav-label { font-size: 0.65rem; font-weight: 600; }
.nav-plus {
  background: var(--primary);
  color: #fff !important;
  width: 48px; height: 48px;
  border-radius: 50%;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(91,53,232,0.3);
}
.nav-plus .nav-icon { display: flex; align-items: center; justify-content: center; height: 100%; }

@media (min-width: 900px) {
  .mobile-bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ─── TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  border-radius: 100px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transition: all 0.28s ease;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ─── UTILITY ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* --- TIMER MODAL ----------------------------------------- */
.timer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.timer-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.timer-icon {
  color: var(--success);
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}
.timer-box h3 { font-size: 1.4rem; color: var(--text); margin-bottom: 8px; }
.timer-box p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }
.timer-countdown {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}
.timer-note { font-size: 0.8rem !important; color: var(--text-dim) !important; margin-bottom: 0 !important; }

