/* Custom CSS for Kudumbhasree Ecommerce Platform */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  scroll-behavior: smooth;
}

/* Navigation */
nav {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

nav button[data-nav].active {
  border-bottom: 3px solid #FBBF24;
  padding-bottom: 12px;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Page transitions */
[data-page] {
  animation: fadeIn 0.3s ease-in;
}

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

/* Product cards hover effect */
.bg-white {
  transition: all 0.3s ease;
}

.bg-white:hover {
  transform: translateY(-2px);
}

/* Line clamp for text */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Focus states */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* Button states */
button {
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

/* Badge styling */
#cartBadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
}

/* Rating stars */
.rating-stars {
  letter-spacing: 2px;
}

/* Responsive grid */
@media (max-width: 768px) {
  nav {
    padding: 1rem 0.5rem;
  }
  
  .hidden.md\:flex {
    display: none !important;
  }

  [data-page] {
    padding: 1rem;
  }
}

/* Form validation feedback */
input:invalid {
  border-color: #f87171;
}

input:valid {
  border-color: #86efac;
}

/* Loading spinner (optional) */
.spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #16a34a;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* Badge for new/featured */
.badge-new {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef4444;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

/* Card shadows */
.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Gradient backgrounds */
.gradient-green-gold {
  background: linear-gradient(135deg, #16a34a 0%, #b8860b 100%);
}

/* Accessibility - focus visible */
*:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  nav,
  button,
  [data-nav] {
    display: none;
  }

  [data-page] {
    display: block !important;
  }
}
