/* ================================
   ESTILOS GENERALES - VIVERO ECOVIDA
   Diseño moderno y responsivo 2025
================================= */

/* Variables CSS para consistencia */
:root {
  --primary-color: #2E7D32;
  --primary-dark: #1B5E20;
  --primary-light: #A5D6A7;
  --secondary-color: #66BB6A;
  --accent-color: #4CAF50;
  --text-dark: #333333;
  --text-light: #666666;
  --bg-light: #F4F6F8;
  --bg-white: #FFFFFF;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode variables */
body.dark-mode {
  --bg-light: #1a1a1a;
  --bg-white: #2a2a2a;
  --text-dark: #e0e0e0;
  --text-light: #b0b0b0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Links de navegación mejorados */
.navbar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
  box-shadow: var(--shadow-md);
  padding: 1rem 0;
  transition: var(--transition);
  border: none !important;
}

.navbar-dark,
.navbar-light {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.navbar-brand:hover {
  transform: scale(1.05);
  color: #ffffff !important;
}

.navbar-brand i {
  color: #ffffff !important;
}

.navbar .nav-link {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar .nav-link i {
  color: rgba(255, 255, 255, 0.95) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

.navbar .nav-link:hover i,
.navbar .nav-link.active i {
  color: #ffffff !important;
}

.navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: var(--transition);
  transform: translateX(-50%);
}

.navbar .nav-link:hover::after {
  width: 70%;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.5) !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
}

.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(255, 255, 255, 0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Encabezados hero mejorados */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  position: relative;
  overflow: hidden;
  padding: 80px 0;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  z-index: 0;
}

header h1 {
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

header p {
  position: relative;
  z-index: 1;
  animation: fadeInUp 1s ease-out;
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Secciones mejoradas */
section {
  padding: 80px 0;
  position: relative;
}

section h2 {
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 50px;
  font-size: 2.5rem;
  position: relative;
  display: inline-block;
  width: 100%;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}


/* Tarjetas de productos modernas */
.card {
  border: none;
  border-radius: var(--border-radius);
  background: var(--bg-white);
  transition: var(--transition);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transition: var(--transition);
}

.card:hover::before {
  transform: scaleX(1);
}

.card img {
  height: 250px;
  object-fit: cover;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  transition: var(--transition);
}

.card:hover img {
  transform: scale(1.1);
}

.card-img-top {
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.card-text {
  color: var(--text-light);
  flex: 1;
  margin-bottom: 1rem;
}

.card h5 {
  font-weight: 600;
  color: var(--primary-color);
}

/* Botones modernos */
.btn {
  border-radius: 50px;
  padding: 12px 30px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: -1;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-success {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.btn-primary {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1976D2, #1565C0);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* Formularios modernos */
form {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

form label {
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  display: block;
}

form input,
form textarea,
form select {
  border: 2px solid #E0E0E0;
  border-radius: 10px;
  padding: 12px 16px;
  width: 100%;
  transition: var(--transition);
  background: var(--bg-white);
  color: var(--text-dark);
  font-family: 'Poppins', sans-serif;
}

form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.1);
  transform: translateY(-2px);
}

form input::placeholder,
form textarea::placeholder {
  color: #999;
}

form button {
  margin-top: 1rem;
}

form button:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  transition: var(--transition);
}

/* Sección de contacto */
.hero-contacto {
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.6);
  padding: 100px 0;
}

.contact-info {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.contact-info i {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 1rem;
}


/* Footer moderno */
footer {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0d3d0d 100%);
  color: white;
  font-size: 0.95rem;
  padding: 3rem 0 1rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
}

footer a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

footer a:hover {
  color: var(--primary-light);
  transform: translateX(5px);
}

footer h5 {
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: white;
  position: relative;
  padding-bottom: 0.5rem;
}

footer h5::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--secondary-color);
  border-radius: 2px;
}

footer .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin-right: 10px;
  transition: var(--transition);
}

footer .social-links a:hover {
  background: var(--primary-color);
  transform: translateY(-5px) rotate(360deg);
}

footer .copyright {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

/* Badges y etiquetas */
.badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.85rem;
}

.badge-success {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.badge-info {
  background: linear-gradient(135deg, #2196F3, #1976D2);
}

.badge-warning {
  background: linear-gradient(135deg, #FF9800, #F57C00);
}

/* Precio destacado */
.price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 1rem 0;
}

.price-old {
  font-size: 1rem;
  text-decoration: line-through;
  color: var(--text-light);
  margin-right: 0.5rem;
}

/* Spinner de carga */
.spinner {
  border: 3px solid rgba(46, 125, 50, 0.1);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Alertas modernas */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  color: var(--primary-dark);
  border-left: 4px solid var(--primary-color);
}

.alert-danger {
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
  color: #C62828;
  border-left: 4px solid #F44336;
}

.alert-info {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  color: #1565C0;
  border-left: 4px solid #2196F3;
}

/* Testimonios */
.testimonial {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  position: relative;
  transition: var(--transition);
}

.testimonial:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.testimonial::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: var(--primary-light);
  font-family: Georgia, serif;
  opacity: 0.3;
}

/* Breadcrumb */
.breadcrumb {
  background: var(--bg-white);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '›';
  color: var(--text-light);
}

.breadcrumb-item.active {
  color: var(--primary-color);
  font-weight: 500;
}

/* Grid de productos */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Scroll to top button */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Responsividad mejorada */
@media (max-width: 1200px) {
  section h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 992px) {
  section {
    padding: 60px 0;
  }
  
  section h2 {
    font-size: 2rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

/* ================================
   RESPONSIVE DESIGN MEJORADO
================================= */

/* Tablets y móviles grandes (max 991px) */
@media (max-width: 991px) {
  .hero {
    height: 70vh !important;
  }
  
  .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
    padding: 8px 12px;
  }
  
  .navbar-collapse {
    background: rgba(44, 95, 45, 0.98);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
  }
  
  .navbar .nav-link {
    padding: 12px 15px !important;
    text-align: center;
    border-radius: 8px;
    margin: 5px 0;
  }
  
  .navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

@media (max-width: 768px) {
  .hero {
    height: 65vh !important;
  }
  
  header {
    padding: 60px 0;
  }
  
  header h1 {
    font-size: 1.8rem;
  }

  section {
    padding: 50px 0;
  }
  
  section h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .card img,
  .card-img-top {
    height: 200px;
    object-fit: cover;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  form {
    padding: 1.5rem;
  }
  
  .form-control,
  .form-select {
    font-size: 16px !important; /* Evita zoom automático en iOS */
    padding: 12px;
  }
  
  .btn {
    padding: 10px 24px;
    font-size: 0.9rem;
    width: 100%;
    margin-bottom: 10px;
  }
  
  .btn-group .btn {
    width: auto;
  }
  
  footer {
    padding: 2rem 0 1rem;
  }
  
  .scroll-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
  
  /* Tablas responsivas */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .hero {
    height: 60vh !important;
    padding: 20px;
  }
  
  header h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  
  header p.lead {
    font-size: 0.95rem;
  }
  
  header .btn {
    font-size: 0.85rem;
    padding: 10px 20px;
  }
  
  section {
    padding: 40px 0;
  }
  
  section h2 {
    font-size: 1.5rem;
  }
  
  section p {
    font-size: 0.9rem;
  }
  
  .card {
    margin-bottom: 20px;
  }
  
  .card img,
  .card-img-top {
    height: 180px;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .card-text {
    font-size: 0.85rem;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .navbar {
    padding: 0.5rem 0;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .navbar .nav-link {
    padding: 14px 20px !important;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
  
  form {
    padding: 1rem;
  }
  
  textarea.form-control {
    min-height: 120px;
  }
  
  footer {
    text-align: center;
  }
  
  .scroll-top {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }
  
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
}

/* Landscape mode para móviles */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    height: 100vh !important;
  }
  
  header {
    padding: 40px 0;
  }
  
  section {
    padding: 30px 0;
  }
  
  .navbar-collapse {
    max-height: 60vh;
    overflow-y: auto;
  }
}

/* Tablets en landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hero {
    height: 85vh !important;
  }
}

/* Tablets portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero {
    height: 65vh !important;
  }
}

/* Pantallas grandes (1920px+) */
@media (min-width: 1920px) {
  .container {
    max-width: 1400px;
  }
  
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  header h1 {
    font-size: 3.5rem;
  }
  
  section h2 {
    font-size: 2.8rem;
  }
}

/* Mejoras de accesibilidad táctil */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .nav-link,
  .card {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(76, 175, 80, 0.2);
  }
  
  .btn:active,
  .nav-link:active {
    transform: scale(0.98);
  }
  
  .navbar .nav-link {
    min-height: 48px;
  }
  
  .btn {
    min-height: 44px;
  }
}

/* Animaciones de entrada */
.fade-in {
  animation: fadeInUp 0.8s ease-out;
}

.fade-in-delay {
  animation: fadeInUp 1s ease-out 0.2s both;
}

/* Utilidades */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-hover {
  transition: var(--transition);
}

.shadow-hover:hover {
  box-shadow: var(--shadow-lg);
}

/* Print styles */
@media print {
  header, footer, .navbar, .btn, .scroll-top {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card,
  section {
    page-break-inside: avoid;
  }
}

