/* ============================================
   Kasun — Premium Design System
   Glass Morphism, Smooth Animations, Dark/Light
   ============================================ */

:root {
  /* Brand Colors */
  --color-primary: #1a56db;
  --color-primary-light: #3b82f6;
  --color-primary-dark: #1e40af;
  --color-accent: #f59e0b;
  --color-accent-light: #fbbf24;

  /* Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
  --glass-bg: rgba(255,255,255,0.7);
  --glass-border: rgba(255,255,255,0.3);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.06);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(51, 65, 85, 0.3);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.gradient-text {
  color: var(--text-primary);
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.section-sm {
  padding: 60px 0;
}

/* ============================================
   Glass Morphism
   ============================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s var(--ease-out-expo);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary-light);
}

/* ============================================
   Card System
   ============================================ */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease-out-expo);
}

.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

.card-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out-expo);
}

.card:hover .card-image {
  transform: scale(1.05);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(26,86,219,0.3);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,86,219,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-white {
  background: white;
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 24px 0;
  transition: all 0.3s var(--ease-out-expo);
}

.navbar.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  padding: 16px 0;
}

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

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.navbar-brand span {
  color: var(--color-primary);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-links a {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease;
  position: relative;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--color-primary);
  background: rgba(26,86,219,0.06);
}

/* ============================================
   Theme toggle — hidden (keep code, hide UI)
   ============================================ */
.theme-toggle { display: none !important; }

/* ============================================
   Mobile Hamburger Menu
   ============================================ */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.mobile-menu-btn span:nth-child(2) { margin: 5px 0; }
.mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 260px;
  max-width: 80vw;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 1050;
  padding: 90px 28px 32px;
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-inner { display: flex; flex-direction: column; }
.mobile-menu-inner li { list-style: none; margin: 0; padding: 0; }
.mobile-menu-inner a {
  display: block;
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  transition: background 0.2s;
}
.mobile-menu-inner a:hover,
.mobile-menu-inner a.active {
  color: var(--color-primary);
  background: rgba(26,86,219,0.06);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1040;
}
.mobile-overlay.open { display: block; }

/* Show hamburger, hide desktop nav on mobile */
@media (max-width: 1024px) {
  .navbar-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-menu { display: block; }
  .navbar-brand img { height: 36px !important; }
}

/* ============================================
   Hero Section
   ============================================ */
/* ============================================
   Hero Carousel
   ============================================ */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.hero-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-carousel-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 40%, transparent 70%, rgba(0,0,0,0.3) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 24px 120px;
}

.hero-carousel-overlay .slide-text {
  text-align: center;
  color: white;
  max-width: 800px;
}

.hero-carousel-overlay .slide-title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  margin-bottom: 8px;
}

.hero-carousel-overlay .slide-subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  text-shadow: 0 1px 6px rgba(0,0,0,0.35);
  opacity: 0.9;
  color: rgba(255,255,255,0.9);
}

/* Dots */
.hero-carousel-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}

.hero-carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.hero-carousel-dots button.active {
  background: white;
  border-color: white;
  transform: scale(1.2);
}

/* Arrows */
.hero-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.2);
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.hero-carousel-arrow:hover {
  background: rgba(0,0,0,0.5);
  border-color: white;
}

.hero-carousel-arrow-left { left: 24px; }
.hero-carousel-arrow-right { right: 24px; }

@media (max-width: 768px) {
  .hero-carousel {
    height: 50vh;
    min-height: 350px;
  }
  .hero-carousel-overlay {
    padding-bottom: 80px;
  }
  .hero-carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .hero-carousel-arrow-left { left: 12px; }
  .hero-carousel-arrow-right { right: 12px; }
}

/* ============================================
   Feature Stats
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 60px;
}

.stat-card {
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  transition: all 0.3s var(--ease-out-expo);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Product Grid
   ============================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.35s var(--ease-out-expo);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.product-image-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-secondary);
}

.product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out-expo);
}

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

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-accent);
  color: white;
}

.product-body {
  padding: 20px;
}

.product-category {
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* ============================================
   News Grid
   ============================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease-out-expo);
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.news-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.news-body {
  padding: 24px;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.news-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.news-summary {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ============================================
   Contact Form
   ============================================ */
.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-in {
  animation: fadeInUp 0.6s var(--ease-out-expo) forwards;
  opacity: 0;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
.animate-in-delay-4 { animation-delay: 0.4s; }
.animate-in-delay-5 { animation-delay: 0.5s; }

/* ============================================
   Page Header
   ============================================ */
.page-header {
  padding: 140px 0 60px;
  text-align: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Admin Panel
   ============================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  background: var(--bg-primary);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-color);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.admin-table tr:hover td {
  background: var(--bg-secondary);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .contact-section {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

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

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-card { padding: 12px; }
  .product-card h3 { font-size: 0.9rem; }
  .product-card .price { font-size: 0.85rem; }
  .product-image-wrapper { height: 120px; }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

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

  /* About page: image above heading */
  #about-content-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  .about-image-col { order: -1; }

  /* Pagination: fit on mobile */
  .pagination { flex-wrap: wrap; }
  .pagination a,
  .pagination span {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 0.8rem;
  }
  .pagination .pg-ellipsis { min-width: 28px; height: 32px; font-size: 0.75rem; }
  .pagination .pg-jump select { height: 32px; font-size: 0.75rem; }
}

/* ============================================
   Scroll Animations (Intersection Observer)
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Loading Skeleton
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
   Success/Error Messages
   ============================================ */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

[data-theme="dark"] .alert-success {
  background: #064e3b;
  color: #a7f3d0;
  border-color: #065f46;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

[data-theme="dark"] .alert-error {
  background: #7f1d1d;
  color: #fecaca;
  border-color: #991b1b;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 48px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(26,86,219,0.05);
}

.pagination .active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.pagination .pg-disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.pagination .pg-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: none;
  background: none;
  letter-spacing: 2px;
}

.pagination .pg-jump {
  margin-left: 8px;
}
.pagination .pg-jump select {
  outline: none;
}
.pagination .pg-jump select:focus {
  border-color: var(--color-primary);
}

/* ============================================
   Image Gallery (Product Detail)
   ============================================ */
.gallery-main {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
  aspect-ratio: 1;
  background: var(--bg-secondary);
  cursor: pointer;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease-out-expo);
}

.gallery-main:hover img {
  transform: scale(1.03);
}

.gallery-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  opacity: 0.6;
  flex-shrink: 0;
}

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

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

/* Lightbox overlay */
.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gallery-lightbox.open {
  display: flex;
}

.gallery-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  object-fit: contain;
}

/* ============================================
   Product Detail Sections
   ============================================ */
.product-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.product-info-panel {
  padding: 4px 0;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.product-meta-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.product-meta-tag.highlight {
  background: rgba(26,86,219,0.08);
  border-color: rgba(26,86,219,0.2);
  color: var(--color-primary);
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 20px 0;
}

.price-current {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}

.price-currency {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.feature-list {
  list-style: none;
  margin: 24px 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.6;
}

.feature-list li::before {
  content: '✓';
  color: var(--color-primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  box-shadow: 0 4px 14px rgba(26,86,219,0.3);
}

.add-to-cart-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(26,86,219,0.4);
}

/* Specs table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.specs-table th,
.specs-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.93rem;
}

.specs-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  width: 200px;
  border-right: 1px solid var(--border-color);
}

.specs-table td {
  color: var(--text-secondary);
}

.specs-table tr:not(:last-child) th,
.specs-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--border-color);
}

/* Section title */
.section-title {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--color-primary);
  display: inline-block;
}

/* Related products grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.related-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease-out-expo);
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.related-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-secondary);
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out-expo);
}

.related-card:hover .related-card-image img {
  transform: scale(1.06);
}

.related-card-body {
  padding: 16px;
}

.related-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.lang-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .product-info-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .specs-table th {
    width: 120px;
  }
  .related-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ============================================
   Footer — WeChat QR hover popup
   ============================================ */
.wechat-qr-wrapper {
  position: relative;
  cursor: pointer;
}
.wechat-qr-popup {
  display: none;
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  white-space: nowrap;
}
.wechat-qr-wrapper:hover .wechat-qr-popup {
  display: block;
}
/* Dark mode — popup stays white (QR code readability) */
[data-theme="dark"] .wechat-qr-popup {
  background: #1e1e1e;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
[data-theme="dark"] .wechat-qr-popup p {
  color: #ccc !important;
}
