/* ===== Root Variables ===== */
:root {
  /* Zero Hour Branding - Digital Tech Theme */
  --primary: #FFD700;
  /* Gold/Yellow for digital products */
  --primary-dark: #ccac00;
  --primary-light: #ffeb3b;

  --secondary: #94a3b8;

  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --light: #f1f5f9;
  --dark: #0f172a;
  /* Deep tech navy/black */
  --white: #ffffff;

  /* Zero Hour Pulse Gradient */
  --gradient-primary: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);

  /* Cyber Dark Gradient */
  --gradient-secondary: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);

  /* Success Gradient */
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Dark Mode Variables ===== */
[data-theme="dark"] {
  --light: #2d3748;
  --dark: #f8f9fa;
  --white: #1a202c;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] body {
  background: linear-gradient(to bottom, #1a202c 0%, #2d3748 100%);
  color: #e2e8f0;
}

[data-theme="dark"] .navbar {
  background: rgba(26, 32, 44, 0.95) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav-link {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary-light) !important;
}

[data-theme="dark"] .dropdown-menu {
  background: #2d3748;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dropdown-item {
  color: #e2e8f0;
}

[data-theme="dark"] .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .product-card,
[data-theme="dark"] .category-card,
[data-theme="dark"] .card {
  background: #2d3748;
  color: #e2e8f0;
}

[data-theme="dark"] .product-title {
  color: #e2e8f0;
}

[data-theme="dark"] .product-description,
[data-theme="dark"] .text-muted {
  color: #a0aec0 !important;
}

[data-theme="dark"] .search-input-nav,
[data-theme="dark"] .search-form-nav .btn {
  background: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .search-input-nav:focus {
  background: #1a202c;
}

[data-theme="dark"] .search-results-dropdown {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .search-result-item {
  color: #e2e8f0;
  border-bottom-color: #4a5568;
}

[data-theme="dark"] .search-result-item:hover {
  background: #4a5568;
}

[data-theme="dark"] .product-detail-description {
  background: #2d3748;
  border-right-color: var(--primary);
}

/* ===== Global Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--primary);
  /* Fallback */
}

/* ===== Navbar Styles ===== */
.navbar {
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 2px solid var(--primary);
  padding: 0.5rem 0;
  transition: var(--transition);
}

.navbar-brand {
  font-size: 1.8rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.brand-logo {
  height: 70px !important;
  max-height: 70px !important;
  width: auto !important;
  object-fit: contain;
  transition: var(--transition);
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.2));
}

.navbar-brand:hover .brand-logo {
  transform: scale(1.1) rotate(2deg);
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
}

.nav-link {
  font-weight: 600;
  color: var(--dark) !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background: var(--light);
  color: var(--primary) !important;
  transform: translateY(-2px);
}

.nav-link i {
  margin-left: 0.3rem;
}

/* Navbar Search */
.search-form-nav {
  position: relative;
  width: auto;
  min-width: 250px;
  max-width: 500px;
  flex-grow: 1;
}

.search-input-nav {
  border-radius: 0 20px 20px 0 !important;
  border-left: none;
  border-right: 1px solid #e9ecef;
  background: #f8f9fa;
  border-color: #e9ecef;
  padding-right: 1rem;
  padding-left: 0.5rem;
  transition: var(--transition);
  font-size: 0.95rem;
}

.search-input-nav:focus {
  background: white;
  box-shadow: none;
  border-color: var(--primary-light);
  border-left: none;
}

.search-form-nav .btn {
  border-radius: 20px 0 0 20px !important;
  border-right: none;
  border-left: 1px solid #e9ecef;
  background: #f8f9fa;
  border-color: #e9ecef;
  color: var(--secondary);
  transition: var(--transition);
}

.search-form-nav .btn:hover {
  background: var(--primary);
  color: var(--dark);
  border-color: var(--primary);
}

.search-input-nav:focus+.btn {
  border-color: var(--primary-light);
  background: white;
  border-right: none;
}

@media (max-width: 991px) {
  .search-form-nav {
    width: 100%;
    margin: 1rem 0 !important;
  }
}

/* Cart Badge */
.cart-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  background: var(--gradient-secondary);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* ===== Main Content ===== */
.main-content {
  min-height: calc(100vh - 400px);
  padding: 3rem 0;
}

/* ===== Hero Section ===== */
.hero-section {
  background: var(--gradient-primary);
  color: white;
  padding: 5rem 0;
  margin-bottom: 3rem;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
  background-size: cover;
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.hero-btn {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  color: var(--dark) !important;
  border: none;
  box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(255, 215, 0, 0.5);
  color: var(--dark) !important;
  filter: brightness(1.1);
}

/* Digital Card Enhancement */
.product-card {
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 0 20px rgba(255, 215, 0, 0.1);
  border-color: var(--primary-light);
}

[data-theme="dark"] .product-card {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #1e293b;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

.product-image {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  height: 220px;
}

.product-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  /* Better for digital product logos like Office/Canva */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ===== Product Grid ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* ===== Product Card ===== */
.product-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.product-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-image img {
  transform: scale(1.1);
}

.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--gradient-secondary);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.product-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--dark);
  text-decoration: none;
  transition: var(--transition);
}

.product-title:hover {
  color: var(--primary);
}

.product-description {
  color: var(--secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.6;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--light);
}

.product-price {
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.product-price-currency {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ===== Buttons ===== */
.btn-add-cart {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-add-cart:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.text-primary {
  color: var(--primary) !important;
}

.btn-primary {
  background: var(--gradient-primary) !important;
  border: none !important;
  color: var(--dark) !important;
  font-weight: 700 !important;
}

.btn-primary:hover {
  background: var(--primary-dark) !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5) !important;
}

.gradient-text {
  background: var(--gradient-primary) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  display: inline-block;
}

.btn-add-cart:active {
  transform: translateY(0);
}

.btn-add-cart i {
  font-size: 1rem;
}

/* ===== Section Titles ===== */
.section-title {
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 5rem;
  color: var(--secondary);
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.5rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--secondary);
  opacity: 0.8;
}

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 5rem;
}

.footer-title {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
}

.footer-links a:hover {
  color: white;
  transform: translateX(-5px);
}

.footer-contact {
  list-style: none;
  padding: 0;
}

.footer-contact li {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.footer-contact i {
  color: var(--primary);
  width: 20px;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.social-link:hover {
  background: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.footer-divider {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 2rem 0 1rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .gradient-text {
    font-size: 1.2rem;
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding: 3rem 0;
  }
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.5s ease-out;
}

/* ===== Loading Animation ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Utility Classes ===== */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-hover {
  transition: var(--transition);
}

.shadow-hover:hover {
  box-shadow: var(--shadow-lg);
}