:root {
  --color-bg: #0d1117;
  --color-bg-light: #161b22;
  --color-text: #c9d1d9;
  --color-accent: #d4af37;
  --font-title: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-body);
  background:
    linear-gradient(135deg, rgba(13, 13, 13, 0.8) 0%, rgba(26, 26, 46, 0.75) 50%, rgba(45, 45, 68, 0.8) 100%),
    url('../CSS/laramblafondo.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--color-text);
  min-height: 100vh;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Glass Morphism - Subtle Professional Effect */
.glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px) saturate(130%);
  -webkit-backdrop-filter: blur(15px) saturate(130%);
  position: relative;
  overflow: hidden;
}

.glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.05),
      transparent);
  transition: left 0.8s;
  pointer-events: none;
  z-index: 0;
}

.glass:hover::before {
  left: 100%;
}

/* Header - Subtle Liquid Glass */
header {
  background: rgba(160, 160, 180, 0.1);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow:
    0 2px 15px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

header .logo-container img {
  height: 50px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: var(--transition);
}

header .logo-container:hover img {
  filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.4));
  transform: scale(1.05);
}

header nav a {
  color: white;
  text-decoration: none;
  margin: 0 1rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  transition: var(--transition);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
}

header nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

header nav a:hover::before {
  opacity: 1;
}

header nav a:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-accent);
  box-shadow:
    0 2px 8px rgba(212, 175, 55, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Main Content */
main {
  min-height: calc(100vh - 80px);
  padding: 2rem 0;
}

/* Footer */
footer {
  background: rgba(13, 17, 23, 0.9);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
}

footer .social-icons a {
  color: var(--color-accent);
  font-size: 1.2rem;
  text-decoration: none;
  transition: var(--transition);
}

footer .social-icons a:hover {
  transform: scale(1.2);
  color: white;
}

/* Product Box - Subtle Glass */
.product-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 16px;
  padding: 1.5rem;
  transition: var(--transition);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px) saturate(120%);
  -webkit-backdrop-filter: blur(15px) saturate(120%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.product-box::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      rgba(212, 175, 55, 0.08) 0%,
      transparent 70%);
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
  z-index: 0;
}

.product-box:hover::after {
  opacity: 1;
}

.product-box:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow:
    0 6px 20px rgba(212, 175, 55, 0.15),
    0 0 0 1px rgba(212, 175, 55, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

/* Unavailable Product Styles */
.product-unavailable {
  opacity: 0.7;
  filter: grayscale(0.4);
  pointer-events: none;
  /* Disable interactions for forced state */
  cursor: not-allowed;
}

.product-unavailable .product-img-wrapper {
  position: relative;
}

.unavailable-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  background: rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--color-accent);
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  border-left: 4px solid var(--color-accent);
}

.product-unavailable .btn-primary {
  background: #444 !important;
  border: none !important;
  color: #888 !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.product-box h3 {
  color: white;
  font-family: var(--font-title);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.product-box h5 {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.product-box img {
  border-radius: 12px;
  width: 100%;
  height: 180px;
  object-fit: cover;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.product-box h4 {
  position: relative;
  z-index: 1;
}

.product-box .btn,
.product-box button,
.product-box span {
  position: relative;
  z-index: 2;
}

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

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, #c5a028 100%);
  border: none;
  color: white;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
  background: linear-gradient(135deg, #c5a028 0%, var(--color-accent) 100%);
}

/* Cart Overlay */
#cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Cart Panel - Subtle Glass */
#cart-panel {
  position: fixed;
  right: -450px;
  top: 0;
  height: 100vh;
  width: 400px;
  max-width: 90vw;
  z-index: 1001;
  transition: right 0.4s ease;
  overflow-y: auto;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  border-left: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow:
    -4px 0 20px rgba(0, 0, 0, 0.3),
    inset 1px 0 0 rgba(255, 255, 255, 0.06);
}

#cart-panel.active {
  right: 0;
  box-shadow:
    -4px 0 25px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(212, 175, 55, 0.15),
    inset 1px 0 0 rgba(255, 255, 255, 0.08);
}

.cart-item {
  transition: background 0.2s;
}

.cart-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Intro Section */
.intro h1 {
  font-family: var(--font-title);
  color: var(--color-accent);
  font-size: 3rem;
  font-weight: 600;
}

.intro h4 {
  color: rgba(255, 255, 255, 0.8);
  max-width: 900px;
  margin: 0 auto;
}

/* Badge */
.badge.bg-secondary {
  background: rgba(212, 175, 55, 0.2) !important;
  color: var(--color-accent);
  font-weight: 500;
}

/* Product description clipping */
.product-box h5 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

/* Form Controls */
.form-control.bg-dark {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: white;
  transition: var(--transition);
}

.form-control.bg-dark:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
  color: white;
}

.form-control.bg-dark::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-label.text-white-50 {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 500;
}

/* Mobile Menu Sticky */
#mobileMenu {
  position: sticky;
  top: 70px;
  z-index: 90;
  transition: var(--transition);
}

#mobileMenu .hover-bg {
  transition: var(--transition);
}

#mobileMenu .hover-bg:hover {
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.navbar-toggler {
  transition: var(--transition);
}

.navbar-toggler:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  transform: scale(1.05);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .product-box img {
    height: 140px;
  }

  .product-box {
    padding: 1rem;
  }

  .product-box h3 {
    font-size: 1rem;
  }

  .product-box h5 {
    font-size: 0.8rem;
  }

  .intro h1 {
    font-size: 2rem;
  }

  .intro h4 {
    font-size: 1rem;
  }

  #cart-panel {
    width: 100%;
    right: -100%;
    top: 0;
    max-width: 100%;
    height: 100vh;
  }

  #cart-panel.active {
    right: 0;
  }

  header nav a {
    font-size: 0.75rem;
    padding: 8px 16px;
    margin: 0 3px;
  }
}

/* Hero Section with Background Image */
.hero-section {
  position: relative;
  height: 70vh;
  min-height: 500px;
  background-image: url('../CSS/fotopotrero.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3rem;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(13, 13, 13, 0.4) 0%, rgba(26, 26, 46, 0.3) 50%, rgba(45, 45, 68, 0.4) 100%);
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
}

.hero-title {
  font-family: var(--font-title);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
  max-width: 700px;
  margin: 0 auto;
}

/* Home Cards - Subtle Glass */
.home-card {
  height: 100%;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(15px) saturate(120%);
  -webkit-backdrop-filter: blur(15px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.home-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 8px 30px rgba(212, 175, 55, 0.18),
    0 0 0 1px rgba(212, 175, 55, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: rgba(212, 175, 55, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.card-image-wrapper {
  width: 100%;
  height: 250px;
  overflow: hidden;
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.card-content {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  font-family: var(--font-title);
  color: var(--color-accent);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.card-content p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  font-size: 1rem;
}

/* Category Sections - Subtle Variations */
.category-section {
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 4rem;
  transition: var(--transition);
  border: 1px solid transparent;
}

.category-section:nth-child(odd) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-color: rgba(255, 255, 255, 0.05);
}

.category-section:nth-child(even) {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
  border-color: rgba(0, 0, 0, 0.2);
}

/* Specific Category Accents (Subtle & Elegant) */
/* We keep buttons UNIFORM (Gold/Premium) for consistency. 
   We distinguish categories only via subtle Title colors and Section Borders (Left & Right). */

/* 1. Café - Gold (Brand Core) */
.category-section:nth-of-type(1) {
  border-left: 3px solid rgba(212, 175, 55, 0.3);
  border-right: 3px solid rgba(212, 175, 55, 0.3);
}

.category-section:nth-of-type(1) h2 {
  color: #d4af37;
  text-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
}

/* 2. Frutas - Warm Amber (Close to Gold) */
.category-section:nth-of-type(2) {
  border-left: 3px solid rgba(255, 160, 122, 0.3);
  border-right: 3px solid rgba(255, 160, 122, 0.3);
}

.category-section:nth-of-type(2) h2 {
  color: #e0a884;
  text-shadow: 0 2px 10px rgba(224, 168, 132, 0.2);
}

/* 3. Vegetales - Sage Green (Desaturated) */
.category-section:nth-of-type(3) {
  border-left: 3px solid rgba(143, 188, 143, 0.3);
  border-right: 3px solid rgba(143, 188, 143, 0.3);
}

.category-section:nth-of-type(3) h2 {
  color: #a3c1ad;
  text-shadow: 0 2px 10px rgba(163, 193, 173, 0.2);
}

/* 4. Medicinales - Muted Teal */
.category-section:nth-of-type(4) {
  border-left: 3px solid rgba(95, 158, 160, 0.3);
  border-right: 3px solid rgba(95, 158, 160, 0.3);
}

.category-section:nth-of-type(4) h2 {
  color: #8fbcbb;
  text-shadow: 0 2px 10px rgba(143, 188, 187, 0.2);
}

/* 5. Vivero - Dusty Rose */
.category-section:nth-of-type(5) {
  border-left: 3px solid rgba(219, 112, 147, 0.3);
  border-right: 3px solid rgba(219, 112, 147, 0.3);
}

.category-section:nth-of-type(5) h2 {
  color: #d8a6b5;
  text-shadow: 0 2px 10px rgba(216, 166, 181, 0.2);
}

/* 6. Accesorios - Slate Blue */
.category-section:nth-of-type(6) {
  border-left: 3px solid rgba(119, 136, 153, 0.3);
  border-right: 3px solid rgba(119, 136, 153, 0.3);
}

.category-section:nth-of-type(6) h2 {
  color: #aab7c4;
  text-shadow: 0 2px 10px rgba(170, 183, 196, 0.2);
}

/* Frutas - Orange */
.category-section:nth-of-type(3) h2 {
  color: #2ecc71;
}

/* Vegetales - Green */
.category-section:nth-of-type(4) h2 {
  color: #1abc9c;
}

/* Medicinales - Teal */
.category-section:nth-of-type(5) h2 {
  color: #e84393;
}

/* Vivero - Pink */
.category-section:nth-of-type(6) h2 {
  color: #3498db;
}

/* Accesorios - Blue */

/* Cart Notification Banner */
#cart-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
}

#cart-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

#cart-notification svg {
  color: var(--color-accent);
}

/* Mobile Hero Adjustments */
@media (max-width: 768px) {
  .hero-section {
    height: 50vh;
    min-height: 400px;
    background-attachment: scroll;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    padding: 0 1rem;
  }

  .card-image-wrapper {
    height: 200px;
  }

  .card-content {
    padding: 1.5rem;
  }

  .card-content h3 {
    font-size: 1.5rem;
  }
}

/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 30px;
  right: 30px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50%;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  background-color: #128c7e;
  transform: scale(1.1);
  box-shadow: 2px 2px 20px rgba(37, 211, 102, 0.5);
  animation: none;
}

.whatsapp-float svg {
  width: 32px;
  height: 32px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Mobile adjustments for WhatsApp button */
@media (max-width: 768px) {
  .whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }

  .what sapp-float svg {
    width: 26px;
    height: 26px;
  }
}

/* Inventory & Stock Badges */
.stock-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.low-stock {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.unavailable-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(220, 53, 69, 0.25);
  color: #ff4d5e;
  border: 1px solid rgba(220, 53, 69, 0.5);
  backdrop-filter: blur(10px);
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-unavailable {
  opacity: 0.75;
  filter: grayscale(0.4);
}

.product-unavailable:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.1);
}