:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --background: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --radius: 0.5rem;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --transition: all 0.2s ease;
}

.dark-mode {
  --background: #111827;
  --surface: #1f2937;
  --border: #374151;
  --text: #f9fafb;
  --text-secondary: #9ca3af;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  min-height: 130vh;
  display: grid;
  grid-template-rows: 1fr auto;
  background-color: var(--background);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar {
  background-color: #111827;
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  transition: background-color 0.3s ease;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  transition: var(--transition);
}

.navbar-brand:hover {
  opacity: 0.9;
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: var(--transition);
  border-radius: var(--radius);
}

.nav-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.btn {
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

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

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

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #0ea271;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
  background: var(--background);
}

.btn-icon {
  padding: 0.5rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn-icon:hover {
  color: var(--text);
  background: var(--background);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge.admin {
  background: var(--primary-light);
  color: white;
}

.badge.user {
  background: var(--success);
  color: white;
}

.card {
  width: 100%;
  margin: 0 auto;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background-color: var(--surface);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

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

.card img {
  max-height: 220px;
  object-fit: cover;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  transition: transform 0.5s ease;
}

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

.card-body {
  padding: 1.5rem;
}

.product-container {
  padding: 0 1.5rem;
}

.footer {
  background-color: var(--surface);
  color: var(--text);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}

.footer h5 {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.footer .social-links a {
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: 1.5rem;
  margin-right: 1rem;
}

.footer .social-links a:hover {
  color: var(--primary);
  transform: translateY(-3px);
}

.whatsapp-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25d366;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  text-align: center;
  transition: transform 0.3s ease;
}

.whatsapp-button:hover {
  transform: scale(1.1);
}

.whatsapp-icon {
  width: 30px;
  height: 30px;
}

.hero-section .carousel-item {
  height: 500px;
  position: relative;
}

.hero-section .carousel-item img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  filter: brightness(0.8);
}

.hero-section .carousel-caption {
  text-align: left;
  left: 10%;
  right: auto;
  max-width: 600px;
  bottom: 50%;
  transform: translateY(50%);
  padding: 0;
}

.hero-section .carousel-caption h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-section .carousel-caption p {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-section .carousel-control-prev,
.hero-section .carousel-control-next {
  width: 5%;
  opacity: 0.7;
}

.hero-section .carousel-indicators {
  margin-bottom: 2rem;
}

.hero-section .carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.1) 100%);
}

.text-shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.divider {
  width: 80px;
  height: 4px;
  background-color: var(--success);
  border-radius: 2px;
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.category-card {
  padding: 2rem;
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  height: 100%;
}

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

.category-card .icon-wrapper {
  width: 70px;
  height: 70px;
  background-color: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.category-card h3 {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.product-card {
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.product-badge {
  background-color: var(--success);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.section-header p {
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .navbar {
    padding: 1rem;
  }

  .search-box {
    min-width: 150px;
  }
  
  .hero-section .carousel-caption h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .hero-section .carousel-item {
    height: 400px;
  }

  .hero-section .carousel-caption {
    left: 50%;
    transform: translate(-50%, 0);
    bottom: 20px;
    text-align: center;
    width: 90%;
  }

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

  .hero-section .carousel-caption p {
    font-size: 1rem;
  }

  .hero-section .carousel-caption .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }

  .navbar {
    padding: 0.75rem;
  }

  .search-box {
    width: 100%;
  }
  
  .overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .hero-section .carousel-item {
    height: 350px;
  }
  
  .hero-section .carousel-caption h1 {
    font-size: 1.75rem;
  }
}

[data-bs-theme="dark"] {
  --bs-body-bg: #121212; 
  --bs-body-color: #ffffff; 
}

[data-bs-theme="dark"] body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .navbar {
  background-color: #1f1f1f; 
}

[data-bs-theme="dark"] .btn-outline-light {
  color: #ffffff;
  border-color: #ffffff;
}

[data-bs-theme="dark"] .btn-outline-light:hover {
  background-color: #ffffff;
  color: #121212;
  border-color: #ffffff;
}

[data-bs-theme="dark"] .product-card,
[data-bs-theme="dark"] .card {
  background-color: #1f2937; 
  color: #f9fafb;
  border: 1px solid #374151; 
}

[data-bs-theme="dark"] .login-card,
[data-bs-theme="dark"] .register-card {
  background-color: #1f2937; 
  color: #f9fafb; 
  border: 1px solid #374151; 
}

[data-bs-theme="dark"] .product-card:hover,
[data-bs-theme="dark"] .card:hover {
  background-color: #374151; 
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); 
}

[data-bs-theme="dark"] .category-card {
  background-color: #1f2937; 
  color: #f9fafb; 
  border: 1px solid #374151; 
}

[data-bs-theme="dark"] .product-card {
  background-color: #1f2937; 
  color: #f9fafb;
  border: 1px solid #374151; 
}

[data-bs-theme="dark"] .category-card:hover,
[data-bs-theme="dark"] .product-card:hover {
  background-color: #374151; 
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); 
}

[data-bs-theme="dark"] .admin-card {
  background-color: #1f2937; 
  color: #f9fafb; 
  border: 1px solid #374151; 
}

[data-bs-theme="dark"] .admin-card:hover {
  background-color: #374151; 
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); 
}


[data-bs-theme="dark"] .category-card,
[data-bs-theme="dark"] .product-card {
    background-color: #343a40 !important; 
    color: white !important; 
}

[data-bs-theme="dark"] .category-card h3,
[data-bs-theme="dark"] .product-card h5 {
    color: white !important; 
}

[data-bs-theme="dark"] .category-card p,
[data-bs-theme="dark"] .product-card p {
    color: #d1d1d1 !important; 
}

[data-bs-theme="dark"] .product-card .btn {
    background-color: #198754 !important; 
    color: white !important;
}

[data-bs-theme="dark"] {
    color: white !important; 
}

[data-bs-theme="dark"] p,
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: white !important;
}

[data-bs-theme="dark"] input,
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] select {
    background-color: #1f2937 !important; 
    color: #f9fafb !important; 
    border: 1px solid #374151 !important;

[data-bs-theme="dark"] input::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
    color: #9ca3af !important;
}

[data-bs-theme="dark"] input:focus,
[data-bs-theme="dark"] textarea:focus,
[data-bs-theme="dark"] select:focus {
    outline: none;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important; 
}

[data-bs-theme="dark"] .admin-layout {
    background-color: #121212 !important; 
    color: #f9fafb !important;

[data-bs-theme="dark"] .nav-card {
    background-color: #1f2937 !important; 
    color: #f9fafb !important; 
    border: 1px solid #374151 !important; 
}

[data-bs-theme="dark"] .nav-card:hover {
    background-color: #374151 !important; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] * {
    background-color: transparent !important;
    color: #f9fafb !important;
}}}