/* CSS Variables - Natural Theme */
:root {
  --primary: #6B8E23;        /* Olive Green */
  --primary-dark: #3A5A40;   /* Leaf Green */
  --secondary: #FAFAF7;      /* Off White */
  --secondary-dark: #F4EFEA; /* Soft Beige */
  --accent: #8B5E3C;         /* Earth Brown */
  --accent-orange: #E07A3F;  /* Natural Orange */
  
  --text-main: #171717;
  --text-muted: #555555;
  --white: #ffffff;

  --font-heading: 'Poppins', serif;
  --font-body: 'Inter', sans-serif;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  --radius: 16px;
  --radius-sm: 8px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--secondary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

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

.btn {
  display: inline-block;
  padding: 14px 32px;
  background-color: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: var(--primary);
  color: var(--white);
}

.btn-block {
  display: block;
  width: 100%;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Enhanced Header */
.header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  padding: 16px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.cart-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--secondary-dark);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  font-weight: 500;
}

.cart-button:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.cart-count {
  background: var(--accent-orange);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Hero Video */
.hero-video-container {
  position: relative;
  height: 85vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 20px;
  max-width: 700px;
  animation: fadeInUp 1s ease;
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
  color: var(--white);
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
  font-weight: 700;
}

.hero-content p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  margin-bottom: 2.5rem;
  color: #f5f5f5;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  font-weight: 300;
}

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

/* Section Styling */
.section-title {
  text-align: center;
  margin: 60px 0 40px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  position: relative;
  color: var(--primary-dark);
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* Enhanced Category Section */
.category-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 20px 4px 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--secondary-dark);
}

.category-scroll::-webkit-scrollbar {
  height: 6px;
}

.category-scroll::-webkit-scrollbar-track {
  background: var(--secondary-dark);
  border-radius: 10px;
}

.category-scroll::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.category-card {
  min-width: 120px;
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.category-card:hover {
  transform: translateY(-8px);
}

.category-card img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  margin: 0 auto 12px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.category-card:hover img {
  border-color: var(--accent-orange);
  box-shadow: var(--shadow-md);
}

.category-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Premium Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px;
  padding-bottom: 80px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.product-card:hover::before {
  opacity: 0.05;
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.product-image {
  position: relative;
  overflow: hidden;
  background: var(--secondary-dark);
}

.product-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-orange);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

.product-info {
  padding: 20px;
  position: relative;
  z-index: 2;
}

.product-info h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-main);
  font-weight: 600;
}

.price {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 16px;
  font-family: var(--font-heading);
}

.product-info .btn {
  font-size: 0.9rem;
  padding: 12px 24px;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Footer */
footer {
  background: var(--primary-dark);
  color: var(--secondary);
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
}

footer p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-video-container {
    height: 70vh;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
  }
  
  .category-card img {
    width: 80px;
    height: 80px;
  }
  
  .container {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--white);
  color: var(--text-main);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s;
  border-left: 4px solid var(--primary);
}

.toast.success {
  border-left-color: var(--primary);
}

.toast.error {
  border-left-color: #e74c3c;
}

.toast-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}

@media (max-width: 640px) {
  .toast-container {
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: auto;
    width: 100%;
  }
}

/* Mobile Bottom Dock */
.mobile-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  z-index: 100;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}

.dock-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--text-muted);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}

.dock-item.active {
  color: var(--primary);
}

.dock-item:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.dock-icon {
  font-size: 1.4rem;
}

.dock-label {
  font-size: 0.7rem;
  font-weight: 500;
}

.dock-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  background: var(--accent-orange);
  color: var(--white);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

/* Desktop Sidebar */
.sidebar {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  z-index: 99;
  padding: 24px 0;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar.open {
  transform: translateX(0);
}

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

.sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 2px solid var(--secondary-dark);
}

.sidebar-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--primary);
  text-decoration: none;
}

.sidebar-nav {
  padding: 24px 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  color: var(--text-main);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

.sidebar-item:hover,
.sidebar-item.active {
  background: var(--secondary-dark);
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

.sidebar-icon {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}

.sidebar-toggle {
  display: block;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  background: var(--white);
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: var(--primary);
  color: var(--white);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
}

/* Responsive adjustments */
@media (min-width: 769px) {
  .sidebar {
    display: block;
  }
  
  /* Show toggle button on desktop too */
  .sidebar-toggle {
    display: block;
  }
  
  /* Content margins adjust based on sidebar state */
  .hero-video-container,
  main,
  footer {
    margin-left: 0;
    transition: margin-left 0.3s ease;
  }
  
  .header {
    left: 0;
    transition: left 0.3s ease;
  }
  
  /* When sidebar is open, push content */
  .sidebar.open ~ .hero-video-container,
  .sidebar.open ~ main,
  body:has(.sidebar.open) .hero-video-container,
  body:has(.sidebar.open) main,
  body:has(.sidebar.open) footer {
    margin-left: 260px;
  }
  
  body:has(.sidebar.open) .header {
    left: 260px;
  }
}

@media (max-width: 768px) {
  .mobile-dock {
    display: block;
  }
  
  body {
    padding-bottom: 70px; /* Reserve space for dock */
  }
  
  .sidebar {
    display: block;
  }
  
  .sidebar-toggle {
    display: block;
  }
  
  /* Hide desktop header cart on mobile */
  .header .cart-button {
    display: none;
  }
  
  /* Ensure content doesn't have margin on mobile */
  .hero-video-container,
  main,
  footer {
    margin-left: 0;
  }
  
  .header {
    left: 0;
    right: 0;
  }
}
