:root {
  /* Light theme colors */
  --red: 348 63% 24%; /* #8B2532 */
  --dull-yellow: 45 95% 55%; /* #F4D03F */
  --primary: var(--red);
  --secondary: var(--dull-yellow);
  --background: 0 0% 100%; /* #FFFFFF */
  --surface: 210 11% 98%; /* #F5F7FA */
  --text-primary: 0 0% 13%; /* #212529 */
  --text-secondary: 0 0% 40%; /* #666666 */
  --border: 210 11% 85%; /* #D6DCE5 */
  --shadow: 0 0% 0%; /* #000000 */
}

[data-theme="dark"] {
  /* Dark theme colors */
  --primary: 45 95% 55%; /* #B83A52 */
  --secondary: 45 85% 65%; /* #F2E55C */
  --background: 0 0% 8%; /* #141414 */
  --surface: 0 0% 12%; /* #1F1F1F */
  --text-primary: 0 0% 95%; /* #F1F1F1 */
  --text-secondary: 0 0% 75%; /* #BFBFBF */
  --border: 0 0% 20%; /* #333333 */
  --shadow: 0 0% 0%; /* #000000 */
}

* {
  box-sizing: border-box;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--text-primary));
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Custom Bootstrap overrides */
.bg-primary {
  background-color: hsl(var(--primary)) !important;
}

.text-primary {
  color: hsl(var(--primary)) !important;
}

.btn-primary {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: white;
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
  border-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  border-color: hsl(var(--secondary));
  color: hsl(var(--text-primary));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.9);
  border-color: hsl(var(--secondary) / 0.9);
}

.bg-light-custom {
  background-color: hsl(var(--surface)) !important;
}

.card {
  background-color: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--text-primary));
}

.navbar-dark {
  background-color: hsl(var(--primary)) !important;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: white;
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: hsl(var(--background));
}

.hero-image {
  text-align: center;
  opacity: 0.3;
}

/* Banner Section - Fixed responsive layout */
.banner-section {
  background: hsl(var(--secondary));
  padding: 2rem 0;
}

.banner-wrapper {
  padding: 1rem;
  border-radius: 1rem;
  background: hsl(var(--background));
}

.banner-image {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 4px 15px hsl(var(--shadow) / 0.1);
  transition: transform 0.3s ease;
}

.banner-image:hover {
  transform: scale(1.02);
}

/* Responsive banner styles */
@media (max-width: 768px) {
  .banner-section {
    padding: 1rem 0;
  }
  
  .banner-wrapper {
    padding: 0.5rem;
  }
}

@media (max-width: 576px) {
  .banner-image {
    border-radius: 0.5rem;
  }
}

/* Product Cards */
.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  box-shadow: 0 2px 8px hsl(var(--shadow) / 0.1);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px hsl(var(--shadow) / 0.15);
}

.product-image {
  height: 200px;
  background-color: hsl(var(--surface));
  border-bottom: 1px solid hsl(var(--border));
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.price {
  font-size: 1.5rem;
  font-weight: bold;
  color: hsl(var(--primary));
  margin-bottom: 1rem;
}

/* About Page Hero */
.about-hero {
  min-height: 100vh;
  background: hsl(var(--primary));
  display: flex;
  align-items: center;
  position: relative;
}

.hero-overlay {
  background: hsl(var(--primary));
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
}

/* Stats Section */
.stat-item h3 {
  margin-bottom: 0.5rem;
}

/* Theme Toggle */
#theme-toggle {
  transition: all 0.3s ease;
}

#theme-toggle:hover {
  transform: scale(1.1);
}

/* Dark theme specific styles */
[data-theme="dark"] .modal-content {
  background-color: hsl(var(--surface));
  color: hsl(var(--text-primary));
}

[data-theme="dark"] .form-control {
  background-color: hsl(var(--background));
  border-color: hsl(var(--border));
  color: hsl(var(--text-primary));
}

[data-theme="dark"] .form-control:focus {
  background-color: hsl(var(--background));
  border-color: hsl(var(--primary));
  color: hsl(var(--text-primary));
  box-shadow: 0 0 0 0.2rem hsl(var(--primary) / 0.25);
}

[data-theme="dark"] .dropdown-menu {
  background-color: hsl(var(--surface));
  border-color: hsl(var(--border));
}

[data-theme="dark"] .dropdown-item {
  color: hsl(var(--text-primary));
}

[data-theme="dark"] .dropdown-item:hover {
  background-color: hsl(var(--background));
}

/* Footer */
footer {
  background-color: hsl(var(--text-primary) / 0.9) !important;
  color: hsl(var(--background)) !important;
}

footer a {
  color: hsl(var(--secondary)) !important;
  text-decoration: none;
}

footer a:hover {
  color: hsl(var(--secondary) / 0.8) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .about-hero {
    background-attachment: scroll;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid hsl(var(--primary));
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast Notifications */
.toast-notification {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: hsl(var(--surface));
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--primary));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--primary) / 0.8);
}

/* Focus styles for accessibility */
.focus-visible:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* Button hover effects */
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Card improvements */
.cart-item {
  transition: all 0.2s ease;
}

.cart-item:hover {
  background-color: hsl(var(--surface));
}

/* Modal improvements */
.modal-content {
  border-radius: 1rem;
  border: none;
  box-shadow: 0 10px 30px hsl(var(--shadow) / 0.2);
}

.modal-header {
  border-bottom: 1px solid hsl(var(--border));
  border-radius: 1rem 1rem 0 0;
}

.modal-footer {
  border-top: 1px solid hsl(var(--border));
  border-radius: 0 0 1rem 1rem;
}

/* Badge improvements */
.badge {
  font-size: 0.75rem;
  padding: 0.25em 0.6em;
}

/* Form improvements */
.form-control:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 0.2rem hsl(var(--primary) / 0.25);
}

/* Print styles */
@media print {
  .navbar,
  .modal,
  .toast-notification,
  #toast-container {
    display: none !important;
  }
  
  .hero-section {
    min-height: auto;
    padding: 2rem 0;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .product-card {
    border: 2px solid hsl(var(--text-primary));
  }
  
  .btn {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}