/* ═══════════════════════════════════════════ */
/* SubPower - Premium Business Theme           */
/* Bootstrap 5.3 Override + Custom Components */
/* ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── LIGHT THEME (Default) ──────────────── */
:root {
  --sp-bg: #f0f4f8;
  --sp-bg2: #ffffff;
  --sp-bg3: #e8edf3;
  --sp-bg4: #dbe2ec;
  --sp-text: #0f172a;
  --sp-text2: #475569;
  --sp-text3: #94a3b8;
  --sp-accent: #1e40af;
  --sp-accent2: #2563eb;
  --sp-accent3: #3b82f6;
  --sp-green: #059669;
  --sp-red: #dc2626;
  --sp-yellow: #d97706;
  --sp-gold: #b8860b;
  --sp-border: rgba(15, 23, 42, 0.08);
  --sp-border2: rgba(15, 23, 42, 0.14);
  --sp-glass: rgba(255, 255, 255, 0.80);
  --sp-gradient: linear-gradient(135deg, #1e40af, #3b82f6);
  --sp-gradient2: linear-gradient(135deg, #0f172a, #1e3a5f);
  --sp-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --sp-shadow2: 0 8px 40px rgba(15, 23, 42, 0.12);
  --sp-glow: 0 0 30px rgba(30, 64, 175, 0.10);
  --sp-card-bg: #ffffff;
  --sp-navbar-bg: rgba(255, 255, 255, 0.88);
  --sp-navbar-scrolled: rgba(255, 255, 255, 0.97);
  --sp-dropdown-bg: #ffffff;
  --sp-badge-bg: rgba(30, 64, 175, 0.08);
  --sp-badge-color: #1e40af;
  --sp-sidebar-hover: rgba(15, 23, 42, 0.04);
  --sp-sidebar-active-bg: rgba(30, 64, 175, 0.08);
  --sp-sidebar-active-color: #1e40af;
  --sp-hero-glow1: rgba(30, 64, 175, 0.06);
  --sp-hero-glow2: rgba(59, 130, 246, 0.04);
  --sp-hero-glow3: rgba(14, 165, 233, 0.03);
}

/* ── DARK THEME ─────────────────────────── */
[data-theme="dark"] {
  --sp-bg: #0b1120;
  --sp-bg2: #111827;
  --sp-bg3: #1e293b;
  --sp-bg4: #334155;
  --sp-text: #f1f5f9;
  --sp-text2: #94a3b8;
  --sp-text3: #64748b;
  --sp-accent: #3b82f6;
  --sp-accent2: #60a5fa;
  --sp-accent3: #93c5fd;
  --sp-green: #34d399;
  --sp-red: #f87171;
  --sp-yellow: #fbbf24;
  --sp-gold: #fbbf24;
  --sp-border: rgba(148, 163, 184, 0.08);
  --sp-border2: rgba(148, 163, 184, 0.14);
  --sp-glass: rgba(17, 24, 39, 0.75);
  --sp-gradient: linear-gradient(135deg, #1e40af, #3b82f6);
  --sp-gradient2: linear-gradient(135deg, #0f172a, #1e3a5f);
  --sp-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --sp-shadow2: 0 8px 40px rgba(0, 0, 0, 0.4);
  --sp-glow: 0 0 30px rgba(59, 130, 246, 0.15);
  --sp-card-bg: #111827;
  --sp-navbar-bg: rgba(11, 17, 32, 0.85);
  --sp-navbar-scrolled: rgba(11, 17, 32, 0.97);
  --sp-dropdown-bg: #1e293b;
  --sp-badge-bg: rgba(59, 130, 246, 0.12);
  --sp-badge-color: #60a5fa;
  --sp-sidebar-hover: rgba(255, 255, 255, 0.04);
  --sp-sidebar-active-bg: rgba(59, 130, 246, 0.12);
  --sp-sidebar-active-color: #60a5fa;
  --sp-hero-glow1: rgba(30, 64, 175, 0.12);
  --sp-hero-glow2: rgba(59, 130, 246, 0.08);
  --sp-hero-glow3: rgba(14, 165, 233, 0.06);
}

/* ── LOGO THEME SWITCHING ────────────────── */
.logo-dark { display: none !important; }
[data-theme="dark"] .logo-dark { display: inline-block !important; }
/* Only hide light logo in dark mode IF a dark logo sibling exists */
[data-theme="dark"] .logo-light:has(~ .logo-dark) { display: none !important; }
/* Parent-level fallback for containers (navbar-brand, sidebar-brand a) */
[data-theme="dark"] :has(> .logo-dark) > .logo-light { display: none !important; }

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--sp-bg);
  color: var(--sp-text);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

::selection {
  background: rgba(37, 99, 235, 0.2);
  color: #fff;
}

a {
  color: var(--sp-accent2);
  text-decoration: none;
  transition: color .2s;
}

a:hover {
  color: var(--sp-accent);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--sp-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--sp-bg4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sp-text3);
}

/* ── NAVBAR ─────────────────────────────── */
.navbar-sp {
  background: var(--sp-navbar-bg);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--sp-border);
  padding: .75rem 0;
  transition: all .3s;
}

.navbar-sp .navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--sp-text);
}

.navbar-sp .navbar-brand span {
  background: var(--sp-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.navbar-sp .nav-link {
  color: var(--sp-text2);
  font-weight: 500;
  font-size: .9rem;
  padding: .5rem 1rem;
  border-radius: 8px;
  transition: all .2s;
}

.navbar-sp .nav-link:hover,
.navbar-sp .nav-link.active {
  color: var(--sp-accent);
  background: var(--sp-badge-bg);
}

.navbar-sp .btn-get-started {
  background: var(--sp-gradient);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: .5rem 1.25rem;
  border-radius: 8px;
  font-size: .85rem;
}

/* ── THEME TOGGLE ───────────────────────── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--sp-border2);
  background: var(--sp-bg2);
  color: var(--sp-text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  font-size: 1rem;
}

.theme-toggle:hover {
  background: var(--sp-bg3);
  color: var(--sp-accent);
  border-color: var(--sp-accent);
}

/* ── NAVBAR UTILITY BUTTONS (uniform height) ── */
.nav-util-btn {
  height: 36px !important;
  font-size: .82rem !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  line-height: 1 !important;
}

/* ── LOGO BADGE ─────────────────────────── */
.logo-badge {
  width: 36px;
  height: 36px;
  background: var(--sp-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .8rem;
  margin-right: 8px;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
}

/* ── HERO ────────────────────────────────── */
.hero-section {
  position: relative;
  padding: 8rem 0 5rem;
  overflow: hidden;
  text-align: center;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 50%, var(--sp-hero-glow1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--sp-hero-glow2) 0%, transparent 40%),
    radial-gradient(circle at 40% 80%, var(--sp-hero-glow3) 0%, transparent 40%);
  z-index: 0;
}

.hero-section>* {
  position: relative;
  z-index: 1;
}

.hero-section h1 {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-section .lead {
  color: var(--sp-text2);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.gradient-text {
  background: var(--sp-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── GLASS CARD ──────────────────────────── */
.glass-card {
  background: var(--sp-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--sp-border);
  border-radius: 16px;
  box-shadow: var(--sp-shadow);
  transition: all .35s cubic-bezier(.4, 0, .2, 1);
}

.glass-card:hover {
  border-color: var(--sp-border2);
  box-shadow: var(--sp-shadow2);
  transform: translateY(-3px);
}

/* ── PRODUCT CARD ────────────────────────── */
.product-card {
  background: var(--sp-card-bg);
  border: 1px solid var(--sp-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  transition: all .4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
  cursor: pointer;
}

.product-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  z-index: 2;
  transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
}

[data-theme="dark"] .product-card::after {
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%);
}

.product-card:hover::after {
  left: 200%;
}

.product-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: var(--sp-accent);
  box-shadow: 0 20px 40px -10px rgba(30, 64, 175, 0.15), 0 0 20px rgba(30, 64, 175, 0.05) inset;
}

.product-card .card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}

.product-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.product-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, .7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  gap: 8px;
  pointer-events: none;
  z-index: 3;
}

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

.product-card .card-body {
  padding: 1.25rem;
}

.product-card .card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--sp-text);
  margin-bottom: .5rem;
}

.product-card .card-desc {
  font-size: .85rem;
  color: var(--sp-text2);
  margin-bottom: .75rem;
}

.product-card .price {
  font-weight: 700;
  color: var(--sp-green);
  font-size: 1.1rem;
}

.product-card .price-old {
  text-decoration: line-through;
  color: var(--sp-text3);
  font-size: .85rem;
  margin-left: 6px;
  font-weight: 400;
}

.product-card .tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tech-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 500;
  border-radius: 999px;
  background: var(--sp-badge-bg);
  color: var(--sp-badge-color);
}

/* ── CATEGORY CARD ───────────────────────── */
.category-card {
  background: var(--sp-card-bg);
  border: 1px solid var(--sp-border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--sp-shadow);
  transition: all .3s;
}

.category-card:hover {
  border-color: var(--sp-border2);
  box-shadow: var(--sp-shadow2);
  transform: translateY(-3px);
}

.category-card .cat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--sp-badge-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.4rem;
  color: var(--sp-accent);
}

.category-card h5 {
  font-weight: 600;
  color: var(--sp-text);
  margin-bottom: .25rem;
}

.category-card p {
  font-size: .85rem;
  color: var(--sp-text2);
  margin: 0;
}

/* ── SECTION HEADERS ─────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: .5rem;
}

.section-header p {
  color: var(--sp-text2);
  max-width: 500px;
  margin: 0 auto;
}

/* ── STAT COUNTER ────────────────────────── */
.stat-box {
  text-align: center;
  padding: 2rem;
}

.stat-box .stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--sp-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-box .stat-label {
  color: var(--sp-text2);
  font-size: .9rem;
  margin-top: .25rem;
}

/* ── BUTTONS ─────────────────────────────── */
.btn-sp {
  background: var(--sp-gradient);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: .65rem 1.5rem;
  border-radius: 10px;
  transition: all .25s;
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.btn-sp:hover {
  box-shadow: 0 6px 25px rgba(30, 64, 175, 0.45);
  transform: translateY(-2px);
  color: #fff;
  filter: brightness(1.1);
}

.btn-sp-outline {
  background: transparent;
  border: 1px solid var(--sp-border2);
  color: var(--sp-text);
  font-weight: 600;
  padding: .65rem 1.5rem;
  border-radius: 10px;
  transition: all .2s;
}

.btn-sp-outline:hover {
  border-color: var(--sp-accent);
  background: var(--sp-badge-bg);
  color: var(--sp-accent);
}

.btn-sp-sm {
  padding: .4rem 1rem;
  font-size: .85rem;
}

.btn-sp-lg {
  padding: .85rem 2rem;
  font-size: 1.05rem;
}

/* ── FORMS ───────────────────────────────── */
.form-control,
.form-select {
  background: var(--sp-bg);
  border: 1px solid var(--sp-border2);
  color: var(--sp-text);
  border-radius: 10px;
  padding: .6rem .9rem;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
}

.form-control:focus,
.form-select:focus {
  background: var(--sp-bg);
  border-color: var(--sp-accent2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  color: var(--sp-text);
}

.form-control::placeholder {
  color: var(--sp-text3);
}

.form-label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--sp-text2);
  margin-bottom: .35rem;
}

/* ── STAR RATING ─────────────────────────── */
.star-rating {
  display: flex;
  gap: 2px;
}

.star-rating .star {
  color: var(--sp-text3);
  font-size: .85rem;
  transition: color .15s;
}

.star-rating .star.filled {
  color: #f59e0b;
}

.star-rating.interactive .star {
  cursor: pointer;
}

/* ── FOOTER ──────────────────────────────── */
.footer-sp {
  background: var(--sp-bg2);
  border-top: 1px solid var(--sp-border);
  padding: 4rem 0 2rem;
  color: var(--sp-text2);
  font-size: .9rem;
}

.footer-sp h6 {
  color: var(--sp-text);
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.footer-sp a {
  color: var(--sp-text2);
}

.footer-sp a:hover {
  color: var(--sp-accent);
}

.footer-bottom {
  border-top: 1px solid var(--sp-border);
  padding-top: 1.5rem;
  margin-top: 2rem;
  color: var(--sp-text3);
  font-size: .8rem;
}

/* ── BADGE ───────────────────────────────── */
.badge-sp {
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 500;
  border-radius: 999px;
}

/* ── AUTH CARDS ───────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--sp-bg);
  position: relative;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 40%, var(--sp-hero-glow1) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, var(--sp-hero-glow2) 0%, transparent 40%);
  z-index: 0;
}

.auth-card {
  background: var(--sp-card-bg);
  border: 1px solid var(--sp-border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: var(--sp-shadow2);
}

/* ── PRODUCT GALLERY ─────────────────────── */
.product-gallery {
  position: relative;
}

.product-gallery .main-img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--sp-border);
  overflow: hidden;
  position: relative;
}

.product-gallery .main-img img {
  width: 100%;
  display: block;
  transition: opacity .25s ease;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all .2s;
  opacity: 0;
}

.product-gallery:hover .gallery-arrow {
  opacity: 1;
}

.gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
  left: 12px;
}

.gallery-next {
  right: 12px;
}

.gallery-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 5;
}

.gallery-thumbs-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1;
  scrollbar-width: none;
  padding: 4px 0;
}

.gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  width: 80px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: .5;
  flex-shrink: 0;
  transition: all .25s;
}

.gallery-thumb:hover {
  opacity: .8;
  border-color: var(--sp-border2);
}

.gallery-thumb.active {
  opacity: 1;
  border-color: var(--sp-accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-scroll-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sp-bg3);
  border: 1px solid var(--sp-border);
  color: var(--sp-text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: .7rem;
  transition: all .2s;
}

.thumb-scroll-btn:hover {
  background: var(--sp-accent);
  color: #fff;
  border-color: var(--sp-accent);
}

/* ══ ADMIN PANEL ═════════════════════════ */
.admin-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--sp-bg2);
  border-right: 1px solid var(--sp-border);
  overflow-y: auto;
  z-index: 1040;
  transition: transform .3s;
}

.admin-sidebar .sidebar-brand {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--sp-border);
  font-weight: 800;
  font-size: 1rem;
  color: var(--sp-text);
}

.admin-sidebar .nav-group {
  padding: 1rem 0 0;
}

.admin-sidebar .nav-group-title {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sp-text3);
  padding: 0 1.25rem .5rem;
}

.admin-sidebar .sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .6rem 1.25rem;
  margin: 2px .75rem;
  color: var(--sp-text2);
  font-size: .87rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all .2s;
}

.admin-sidebar .sidebar-link:hover {
  background: var(--sp-sidebar-hover);
  color: var(--sp-text);
}

.admin-sidebar .sidebar-link.active {
  background: var(--sp-sidebar-active-bg);
  color: var(--sp-sidebar-active-color);
  font-weight: 600;
}

.admin-content {
  margin-left: 260px;
  min-height: 100vh;
}

.admin-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--sp-bg2);
  border-bottom: 1px solid var(--sp-border);
}

.admin-header .page-title {
  font-weight: 600;
  font-size: 1.1rem;
}

/* ── STAT CARD (Admin) ───────────────────── */
.admin-stat {
  background: var(--sp-card-bg);
  border: 1px solid var(--sp-border);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sp-shadow);
}

.admin-stat::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--sp-gradient);
  opacity: .06;
}

.admin-stat .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: .75rem;
}

.admin-stat .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--sp-text);
}

.admin-stat .stat-label {
  font-size: .8rem;
  color: var(--sp-text2);
  margin-top: .15rem;
}

/* ── DATA TABLE (Admin) ──────────────────── */
.table-sp {
  color: var(--sp-text);
}

.table-sp thead th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sp-text3);
  border-bottom: 1px solid var(--sp-border);
  padding: .85rem 1rem;
  background: transparent;
}

.table-sp tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--sp-border);
  vertical-align: middle;
  font-size: .9rem;
}

.table-sp tbody tr:hover {
  background: var(--sp-sidebar-hover);
}

/* ── PAGINATION ──────────────────────────── */
.pagination .page-link {
  background: var(--sp-bg2);
  border: 1px solid var(--sp-border);
  color: var(--sp-text2);
  font-size: .85rem;
  border-radius: 8px !important;
  margin: 0 2px;
  padding: .4rem .75rem;
}

.pagination .page-item.active .page-link {
  background: var(--sp-accent);
  border-color: var(--sp-accent);
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  color: var(--sp-text3);
}

/* ── PRODUCT DETAIL ──────────────────────── */
.product-gallery {
  position: relative;
}

.product-gallery .main-img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--sp-border);
  overflow: hidden;
}

.product-gallery .main-img img {
  width: 100%;
  display: block;
}

.product-gallery .thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.product-gallery .thumb {
  width: 72px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: .6;
  transition: all .2s;
}

.product-gallery .thumb.active,
.product-gallery .thumb:hover {
  border-color: var(--sp-accent);
  opacity: 1;
}

.product-gallery .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── MISC ────────────────────────────────── */
.divider {
  border-top: 1px solid var(--sp-border);
}

.text-accent {
  color: var(--sp-accent2) !important;
}

.bg-sp {
  background: var(--sp-bg2);
}

.bg-sp2 {
  background: var(--sp-bg3);
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 992px) {
  .hero-section h1 {
    font-size: 2.5rem;
  }

  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.show {
    transform: translateX(0);
  }

  .admin-content {
    margin-left: 0;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding: 6rem 0 3rem;
  }

  .hero-section h1 {
    font-size: 2rem;
  }
}

/* ── SIDEBAR OVERLAY ─────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ── FORM CHECK ──────────────────────────── */
.form-check-input {
  background-color: var(--sp-bg3);
  border-color: var(--sp-border2);
}

.form-check-input:checked {
  background-color: var(--sp-accent);
  border-color: var(--sp-accent);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ── DROPDOWNS ───────────────────────────── */
.dropdown-menu {
  background: var(--sp-dropdown-bg);
  border: 1px solid var(--sp-border);
  border-radius: 12px;
  padding: .5rem;
  box-shadow: var(--sp-shadow2);
}

.dropdown-item {
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .9rem;
  transition: all .15s;
  color: var(--sp-text2);
}

.dropdown-item:hover {
  background: var(--sp-badge-bg);
  color: var(--sp-accent);
}

/* ── PRODUCT DESCRIPTION ─────────────────── */
.product-description h1,
.product-description h2,
.product-description h3,
.product-description h4 {
  margin-top: 1.5rem;
  margin-bottom: .75rem;
}

.product-description ul,
.product-description ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.product-description li {
  margin-bottom: .35rem;
}

.product-description p {
  margin-bottom: 1rem;
}

/* ── BREADCRUMB ──────────────────────────── */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
}

.breadcrumb-item+.breadcrumb-item::before {
  color: var(--sp-text3);
}

.breadcrumb-item a {
  color: var(--sp-text2);
}

.breadcrumb-item a:hover {
  color: var(--sp-accent);
}

/* ── NAVBAR SCROLLED ─────────────────────── */
.navbar-sp.scrolled {
  background: var(--sp-navbar-scrolled);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

/* ── ANIMATIONS ──────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-up {
  animation: fadeUp .6s ease forwards;
}

.fade-in {
  animation: fadeIn .5s ease forwards;
}

/* ── ALERT OVERRIDES ─────────────────────── */
.alert {
  background: var(--sp-bg2);
  border: 1px solid var(--sp-border);
  color: var(--sp-text);
}

/* ── USER PANEL SIDEBAR ─────────────────── */
.user-sidebar {
  display: flex;
  flex-direction: column;
}

.user-sidebar .nav-group {
  padding: .5rem 0 0;
}

.user-sidebar .sidebar-link .badge {
  min-width: 22px;
  text-align: center;
}

.user-panel-content .table-sp tbody td {
  font-size: .88rem;
}

@media (max-width: 992px) {
  .user-sidebar {
    transform: translateX(-100%);
  }

  .user-sidebar.show {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .user-panel-content {
    margin-left: 0;
  }
}

/* ═══════════════════════════════════════════ */
/* MOBILE RESPONSIVE                          */
/* ═══════════════════════════════════════════ */

/* ── Tablet (≤992px) ─────────────────────── */
@media (max-width: 992px) {
  .hero-section { padding: 3rem 0; }
  .hero-section h1 { font-size: 2.2rem; }
  .section-header h2 { font-size: 1.5rem; }

  body {
    padding-bottom: 72px;
  }
}

/* ── Mobile (≤768px) ─────────────────────── */
@media (max-width: 768px) {
  body {
    font-size: 14px;
    padding-bottom: 72px;
  }

  .container { padding-left: 12px; padding-right: 12px; }

  /* Navbar */
  .navbar-sp {
    padding: .5rem .75rem;
  }
  .navbar-sp .navbar-brand img {
    height: 28px !important;
  }

  /* Hero */
  .hero-section { padding: 2rem 0; }
  .hero-section h1 { font-size: 1.8rem; }
  .hero-section .lead { font-size: .9rem; }
  .hero-section .btn { font-size: .85rem; padding: 8px 16px; }

  /* Stats */
  .stat-box { padding: 1rem !important; }
  .stat-num { font-size: 1.3rem; }
  .stat-label { font-size: .7rem; }

  /* Product Cards */
  .product-card .card-body { padding: .875rem !important; }
  .product-card .card-title { font-size: 1rem !important; }
  .product-card .card-desc { font-size: .8rem !important; margin-bottom: .75rem !important; }
  .card-img-wrap { min-height: 160px; }
  .card-img-wrap img { min-height: 160px; }

  /* Section Headers */
  .section-header h2 { font-size: 1.3rem; }
  .section-header p { font-size: .82rem; }

  /* Category Cards */
  .category-card { padding: 1rem; }
  .category-card h5 { font-size: .9rem; }
  .cat-icon { width: 48px; height: 48px; font-size: 1.2rem; }

  /* Glass Cards */
  .glass-card { padding: 1rem; border-radius: 12px; }

  /* Footer */
  .footer-sp { padding: 2rem 0 1rem; }
  .footer-sp .row { gap: 0; }
  .footer-sp h6 { font-size: .9rem; margin-bottom: .5rem; }
  .footer-sp p, .footer-sp a { font-size: .8rem; }
  .footer-sp .col-lg-4 { margin-bottom: 1rem; }
  .footer-bottom { font-size: .75rem; padding: .75rem 0; }

  /* Tables */
  .table-sp { font-size: .8rem; }
  .table-sp th, .table-sp td { padding: .5rem .4rem; }

  /* Buttons */
  .btn-sp-lg { padding: 10px 20px; font-size: .9rem; }

  /* Modals */
  .modal-dialog { margin: .5rem; }
}

/* ── Small Mobile (≤480px) ───────────────── */
@media (max-width: 480px) {
  .hero-section h1 { font-size: 1.5rem; }
  .hero-section .lead { font-size: .82rem; }

  .stat-num { font-size: 1.1rem; }
  .stat-label { font-size: .65rem; }

  .product-card .card-title { font-size: .92rem !important; }
  .price { font-size: 1.1rem !important; }

  .category-card h5 { font-size: .8rem; }
  .cat-icon { width: 40px; height: 40px; font-size: 1rem; }

  .section-header h2 { font-size: 1.15rem; }

  .tech-tag { font-size: .65rem !important; padding: 2px 6px !important; }
}

/* ═══════════════════════════════════════════ */
/* STICKY MOBILE BOTTOM NAV                   */
/* ═══════════════════════════════════════════ */
@media (max-width: 992px) {
  /* Prevent sticky nav from hiding content on ALL pages */
  body {
    padding-bottom: 70px !important;
  }
  .container.py-5, .container-fluid.py-5, .container.py-4 {
    padding-bottom: 100px !important; 
  }

  .mobile-bottom-sheet {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 85vh !important;
    transform: translateY(100%) !important;
    border-top-left-radius: 24px !important;
    border-top-right-radius: 24px !important;
    border-left: none !important;
    border-right: none !important;
  }
  .mobile-bottom-sheet.show {
    transform: none !important;
  }
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: 64px;
  background: var(--sp-navbar-scrolled);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--sp-border);
  box-shadow: 0 -2px 20px rgba(0,0,0,0.08);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--sp-text3);
  font-size: .65rem;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  overflow: hidden;
  transition: color .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav a i {
  font-size: 1.15rem;
  transition: transform .2s ease, color .2s ease;
}

.mobile-bottom-nav a.active {
  color: var(--sp-accent);
}

.mobile-bottom-nav a.active i {
  transform: scale(1.1);
}

.mobile-bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--sp-gradient);
  border-radius: 0 0 4px 4px;
}

/* Ripple effect */
.mobile-bottom-nav a::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--sp-accent);
  opacity: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .4s ease, height .4s ease, opacity .4s ease;
}

.mobile-bottom-nav a:active::after {
  width: 80px;
  height: 80px;
  opacity: .08;
}

/* Badge on nav item */
.mobile-bottom-nav .nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: .6rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: var(--sp-red);
  border-radius: 8px;
}

/* ═══════════════════════════════════════════ */
/* USER PANEL MOBILE BOTTOM NAV               */
/* ═══════════════════════════════════════════ */
.user-mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: 64px;
  background: var(--sp-navbar-scrolled);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--sp-border);
  box-shadow: 0 -2px 20px rgba(0,0,0,0.08);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.user-mobile-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--sp-text3);
  font-size: .6rem;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  overflow: hidden;
  transition: color .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.user-mobile-nav a i {
  font-size: 1.1rem;
  transition: transform .2s ease;
}

.user-mobile-nav a.active {
  color: var(--sp-accent);
}

.user-mobile-nav a.active i {
  transform: scale(1.1);
}

.user-mobile-nav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--sp-gradient);
  border-radius: 0 0 4px 4px;
}

/* Hide TinyMCE branding and promotion system-wide */
.tox-statusbar__branding,
.tox-promotion {
    display: none !important;
}