/* ==========================================================================
   Best Mex Produce - Styles
   Version: 2.0 - Performance & Mobile Optimized
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Theme)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --nopal-profundo: #1a3c34;
  --verde-campo: #7FB069;
  --mango-solar: #FFB300;
  --tierra-roja: #C67C53;
  --crema-natural: #F4F1E8;
  --gris-pizarra: #78888F;
  --panel-dark: #244f45;
  
  /* Semantic Colors */
  --text-light: #e0e0e0;
  --text-muted: #d7e3df;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-border: rgba(255, 255, 255, 0.08);
  
  /* Spacing */
  --section-padding: 100px;
  --section-padding-mobile: 60px;
  
  /* Typography */
  --font-primary: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.35s ease;
}

/* --------------------------------------------------------------------------
   Base Styles & Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

section {
  scroll-margin-top: 90px;
}

body {
  font-family: var(--font-primary);
  color: var(--crema-natural);
  background-color: var(--nopal-profundo);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
}

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

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
/* Colors */
.text-mango { color: var(--mango-solar) !important; }
.text-verde { color: var(--verde-campo) !important; }
.text-tierra { color: var(--tierra-roja) !important; }
.text-light { color: var(--text-light) !important; }
.text-muted-custom { color: var(--text-muted) !important; }

.bg-panel-dark {
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
}

/* Typography */
.text-body-light {
  color: var(--text-light);
  font-weight: 300;
  line-height: 1.8;
}

.font-weight-300 { font-weight: 300 !important; }
.font-weight-400 { font-weight: 400 !important; }
.font-weight-700 { font-weight: 700 !important; }
.font-weight-800 { font-weight: 800 !important; }

/* Layout */
.max-w-700 { max-width: 700px; }
.max-w-650 { max-width: 650px; }
.max-w-720 { max-width: 720px; }

/* Image Effects */
.img-frame {
  position: relative;
}

.img-frame::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--mango-solar);
  z-index: 0;
  pointer-events: none;
}

.img-frame img {
  position: relative;
  z-index: 1;
  filter: sepia(18%) contrast(1.1);
}

/* WhatsApp Icon Color */
.wa-icon { 
  color: #25D366 !important; 
  font-size: 18px;
}

/* Border utilities */
.border-subtle {
  border-color: var(--border-subtle) !important;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar {
  background: rgba(26, 60, 52, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 15px 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.navbar-dark .navbar-toggler {
  border-color: rgba(244, 241, 232, 0.35);
}

.navbar-dark .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%28244,241,232,0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-brand img {
  height: 65px;
  width: auto;
  filter: brightness(0) invert(1);
  transition: transform var(--transition-normal);
}

.navbar-brand img:hover {
  transform: scale(1.05);
}

.nav-link {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--crema-natural) !important;
  opacity: 0.85;
  padding: 0 15px !important;
  transition: all var(--transition-normal);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--mango-solar) !important;
  opacity: 1;
}

.btn-nav-cta {
  border: 1px solid var(--mango-solar);
  color: var(--mango-solar);
  font-size: 0.75rem;
  padding: 8px 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition-fast);
}

.btn-nav-cta:hover,
.btn-nav-cta:focus {
  background: var(--mango-solar);
  color: var(--nopal-profundo);
}

/* --------------------------------------------------------------------------
   Focus States (Accessibility)
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(255, 179, 0, 0.7);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Language Switch
   -------------------------------------------------------------------------- */
.lang-btn {
  border: 1px solid rgba(244, 241, 232, 0.35);
  background: transparent;
  color: var(--crema-natural);
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 0.75rem;
  padding: 8px 12px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  border-color: var(--mango-solar);
  color: var(--mango-solar);
}

.lang-btn.active {
  border-color: var(--mango-solar);
  color: var(--mango-solar);
}

.lang-wrap {
  display: flex;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 90vh;
  min-height: 90svh;
  background:
    linear-gradient(to bottom, rgba(26, 60, 52, 0.65), var(--nopal-profundo)),
    url("../assets/img/hero.jpg") no-repeat center center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 90px;
}

.hero-tagline {
  color: var(--mango-solar);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.hero-subtitle {
  max-width: 700px;
  font-size: 1.25rem;
  font-weight: 300;
}

.btn-mango {
  background-color: var(--mango-solar);
  color: var(--nopal-profundo);
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 0;
  letter-spacing: 1px;
  padding: 18px 40px;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.btn-mango:hover,
.btn-mango:focus {
  background: #fff;
  color: var(--nopal-profundo);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

/* --------------------------------------------------------------------------
   Section Styles
   -------------------------------------------------------------------------- */
.section-padding {
  padding: var(--section-padding) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 70px;
}

.section-header span {
  color: var(--mango-solar);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.8rem;
  display: block;
  margin-bottom: 15px;
}

.section-header h2 {
  font-size: 3rem;
  color: var(--crema-natural);
}

.section-header p {
  color: var(--gris-pizarra);
}

/* --------------------------------------------------------------------------
   Light Section (Crema Background)
   -------------------------------------------------------------------------- */
.bg-crema {
  background-color: var(--crema-natural);
  color: var(--nopal-profundo);
}

.bg-crema .section-header h2 {
  color: var(--nopal-profundo);
}

.bg-crema .section-header span {
  color: var(--tierra-roja);
}

.bg-crema p {
  color: #555;
}

/* --------------------------------------------------------------------------
   Region Cards
   -------------------------------------------------------------------------- */
.region-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  padding: 40px 20px;
  transition: all var(--transition-slow);
  height: 100%;
  border-radius: 4px;
}

.region-card:hover {
  border-bottom: 5px solid var(--verde-campo);
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(26, 60, 52, 0.15);
}

/* --------------------------------------------------------------------------
   Product Cards
   -------------------------------------------------------------------------- */
.product-card {
  background-color: var(--panel-dark);
  border: none;
  overflow: hidden;
  transition: transform var(--transition-fast);
  height: 100%;
  border-radius: 4px;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card img {
  height: 220px;
  object-fit: contain;
  width: 100%;
  background-color: #fff;
  padding: 10px;
}

.product-info {
  padding: 30px;
}

.product-title {
  color: var(--mango-solar);
  margin-bottom: 6px;
}

.product-subtitle {
  color: #cdddd9;
  opacity: 0.9;
  font-size: 0.9rem;
}

.product-desc {
  color: #cdddd9;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 14px;
}

.technical-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--nopal-profundo);
  background: var(--verde-campo);
  padding: 5px 10px;
  border-radius: 2px;
  display: inline-block;
  margin-top: 15px;
}

/* --------------------------------------------------------------------------
   Contact Section
   -------------------------------------------------------------------------- */
.contact-card {
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: 8px;
  padding: 24px;
  height: 100%;
}

.contact-label {
  color: var(--gris-pizarra);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.contact-icon {
  color: var(--mango-solar);
  margin-top: 4px;
  flex-shrink: 0;
}

.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--crema-natural);
  border-radius: 6px;
  padding: 12px 14px;
  transition: all var(--transition-fast);
}

.form-control::placeholder {
  color: rgba(244, 241, 232, 0.65);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(255, 179, 0, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(255, 179, 0, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--crema-natural);
}

.form-select option {
  background: var(--nopal-profundo);
  color: var(--crema-natural);
}

.form-text {
  color: rgba(244, 241, 232, 0.7);
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   WhatsApp Floating Button
   -------------------------------------------------------------------------- */
.wa-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #25D366;
  color: #0b2b24;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.wa-float:hover {
  transform: translateY(-2px) scale(1.05);
  color: #0b2b24;
}

.wa-float i {
  font-size: 28px;
}

/* Pulse animation for WhatsApp button */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.wa-float {
  animation: pulse 2s infinite;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  background: #112923;
  color: var(--gris-pizarra);
  padding: 80px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

footer h5 {
  color: #fff;
  margin-bottom: 25px;
}

footer a {
  color: var(--gris-pizarra);
  text-decoration: none;
  transition: color var(--transition-normal);
}

footer a:hover {
  color: var(--mango-solar);
}

footer i {
  width: 25px;
}

.footer-logo {
  max-height: 60px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Impact Section Cards
   -------------------------------------------------------------------------- */
.impact-card {
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-fast);
}

.impact-card:hover {
  transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   Loading States & Skeleton
   -------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   Accessibility: Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .wa-float {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive: Tablet (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .section-padding {
    padding: 80px 0;
  }
  
  .section-header {
    margin-bottom: 50px;
  }
  
  .section-header h2 {
    font-size: 2.5rem;
  }
  
  .hero {
    min-height: 80vh;
    padding-top: 80px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
}

/* --------------------------------------------------------------------------
   Responsive: Mobile (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .navbar-brand img {
    height: 50px;
  }
  
  .nav-link {
    padding: 10px 0 !important;
    font-size: 0.85rem;
  }
  
  .hero {
    min-height: 85vh;
    padding: 100px 20px 60px;
  }
  
  .hero h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .hero-tagline {
    font-size: 0.75rem;
    letter-spacing: 2px;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .btn-mango {
    padding: 14px 30px;
    font-size: 0.85rem;
  }
  
  .product-card img {
    height: 180px;
  }
  
  .product-info {
    padding: 20px;
  }
  
  .region-card {
    padding: 30px 15px;
  }
  
  .contact-card {
    padding: 20px;
  }
  
  footer {
    padding: 60px 0 30px;
    text-align: center;
  }
  
  footer .col-md-3,
  footer .col-md-4 {
    text-align: center;
  }
  
  .wa-float {
    width: 50px;
    height: 50px;
    right: 15px;
    bottom: 15px;
  }
  
  .wa-float i {
    font-size: 24px;
  }
  
  /* Image frame adjustment for mobile */
  .img-frame::before {
    top: -10px;
    left: -10px;
  }
}

/* --------------------------------------------------------------------------
   Responsive: Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
  
  .product-card {
    margin-bottom: 1rem;
  }
  
  .btn-mango {
    width: 100%;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Availability Calendar Styles
   -------------------------------------------------------------------------- */

.availability-calendar-wrapper {
  overflow-x: auto;
  margin-top: 2rem;
  padding-bottom: 1rem;
  border-radius: 0.5rem;
}

.availability-calendar {
  display: table;
  border-collapse: separate;
  border-spacing: 1px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 0.5rem;
  min-width: fit-content;
  width: 100%;
}

.cal-header,
.cal-row {
  display: table-row;
}

.cal-product,
.cal-month,
.cal-cell {
  display: table-cell;
  padding: 1rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.25rem;
  text-align: center;
  vertical-align: middle;
  min-height: 50px;
  transition: all 0.2s ease;
}

.cal-header .cal-product {
  font-weight: 700;
  background: rgba(127, 176, 105, 0.2);
  color: var(--verde-campo);
  padding: 0.75rem;
}

.cal-header .cal-month {
  font-weight: 600;
  background: rgba(127, 176, 105, 0.15);
  color: var(--verde-campo);
  font-size: 0.85rem;
  padding: 0.75rem;
}

.cal-row .cal-product {
  padding: 1rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.cal-cell {
  display: table-cell;
  padding: 1rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.25rem;
  cursor: pointer;
  min-height: 50px;
  width: 60px;
}

.cal-cell:hover {
  background: rgba(127, 176, 105, 0.2);
  transform: scale(1.02);
}

.cal-cell {
  display: table-cell;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
}

.region-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  margin: 0 2px;
}

.cal-cell[data-region*="sin"] .region-badge[title="Sinaloa"] {
  background: rgba(127, 176, 105, 0.9);
}

.cal-cell[data-region*="nl"] .region-badge[title="Nuevo León"] {
  background: rgba(198, 124, 83, 0.9);
}

.cal-cell[data-region*="mic"] .region-badge[title="Michoacán"] {
  background: rgba(255, 179, 0, 0.9);
}

/* Filter buttons */
.filter-btn {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.filter-btn:hover {
  border-color: var(--verde-campo);
  color: var(--verde-campo);
}

.filter-btn.active {
  background: var(--verde-campo);
  border-color: var(--verde-campo);
  color: #fff;
}

/* Hide/show rows based on filter */
.cal-row[data-product].hidden {
  display: none;
}

/* Availability legend */
.availability-legend {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 0.25rem;
  margin-right: 0.5rem;
  font-weight: 700;
  color: #000;
  font-size: 0.85rem;
}

/* Responsive calendar */
@media (max-width: 768px) {
  .cal-product,
  .cal-month,
  .cal-cell {
    padding: 0.75rem 0.25rem;
    font-size: 0.8rem;
    min-height: 40px;
    width: auto;
  }

  .cal-header .cal-month {
    padding: 0.5rem 0.25rem;
    font-size: 0.7rem;
  }

  .region-badge {
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    margin: 0 1px;
  }
}

@media (max-width: 480px) {
  .cal-product,
  .cal-month,
  .cal-cell {
    padding: 0.5rem 0.2rem;
    font-size: 0.7rem;
    min-height: 32px;
  }

  .region-badge {
    width: 16px;
    height: 16px;
    font-size: 0.55rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .navbar,
  .wa-float,
  .lang-wrap,
  form {
    display: none !important;
  }
  
  body {
    background: #fff;
    color: #000;
  }
  
  .hero {
    min-height: auto;
    padding: 40px 0;
    background: #f5f5f5;
  }
  
  section {
    page-break-inside: avoid;
  }
}
