/* ==========================================================================
   HOJA DE ESTILOS UNIFICADA "COZY" - JARDINARÍA LA PALMA
   ========================================================================== */

/* --- 1. CONFIGURACIÓN GENERAL Y VARIABLES --- */
:root {
  --cozy-bg: #fbf9f6;          /* Fondo crema suave y cálido */
  --cozy-green: #607c68;       /* Verde salvia principal para botones y enlaces */
  --cozy-green-dark: #2f3e35;  /* Gris verdoso oscuro para textos legibles */
  --cozy-terracota: #d99b77;   /* Tono tierra cálido para acentos e interacción */
  --cozy-muted: #7c887f;       /* Gris suave para textos secundarios y licencias */
  --cozy-white: #ffffff;
  
  --fuente-titulos: 'Playfair Display', Georgia, serif;
  --fuente-cuerpo: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  --radius-cozy: 16px;         /* Curvaturas suaves orgánicas */
  --radius-boton: 30px;        /* Botones redondeados amigables */
  --sombra-cozy: 0 12px 32px rgba(96, 124, 104, 0.05);
  --transicion: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base del Sitio */
body {
  background-color: var(--cozy-bg);
  color: var(--cozy-green-dark);
  font-family: var(--fuente-cuerpo);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

#contenedor {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Tipografías Globales */
h1, h2, h3, h4 {
  font-family: var(--fuente-titulos);
  font-weight: 600;
  color: var(--cozy-green-dark);
  margin-top: 0;
}

a {
  color: var(--cozy-green);
  text-decoration: none;
  transition: var(--transicion);
}

a:hover {
  color: var(--cozy-terracota);
}

/* --- 2. DISEÑO DE LA CABECERA (cabecera.inc) --- */
header {
  background-color: var(--cozy-white);
  border-radius: var(--radius-cozy);
  padding: 35px 20px;
  margin-bottom: 30px;
  box-shadow: var(--sombra-cozy);
  border: 1px solid rgba(96, 124, 104, 0.06);
  text-align: center;
  position: relative;
}

header h1 {
  font-size: 2.8rem;
  margin: 10px 0 5px 0;
  letter-spacing: -1px;
}

header h2 {
  font-family: var(--fuente-cuerpo);
  color: var(--cozy-muted);
  font-size: 1.05rem;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.5px;
}

/* Botón de Panel Admin */
.botonmenu {
  display: inline-block;
  background-color: transparent;
  color: var(--cozy-muted) !important;
  border: 1px solid rgba(96, 124, 104, 0.2);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 15px;
  transition: var(--transicion);
}

.botonmenu:hover {
  background-color: var(--cozy-green);
  color: var(--cozy-white) !important;
  border-color: var(--cozy-green);
}

/* --- 3. CATÁLOGO / ESCAPARATE (index.php) --- */
.escaparate {
  display: flex;
  gap: 30px; 
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px 0;
}

.tarjeta-planta {
  background: var(--cozy-white);
  border: 1px solid rgba(96, 124, 104, 0.06);
  border-radius: var(--radius-cozy);
  width: 280px; 
  overflow: hidden;
  box-shadow: var(--sombra-cozy);
  display: flex;
  flex-direction: column;
  transition: var(--transicion);
}

.tarjeta-planta:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(96, 124, 104, 0.1);
}

/* Imagen en el Escaparate */
.contenedor-img {
  width: 100%;
  height: 260px; /* Estabiliza todas las imágenes a la misma altura */
  overflow: hidden;
  background-color: #f5f3ef;
}

.contenedor-img img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Adapta y centra las fotos sin deformarlas */
  transition: transform 0.5s ease;
}

.tarjeta-planta:hover .contenedor-img img {
  transform: scale(1.04);
}

/* Bloques de Texto del Catálogo */
.info-producto {
  padding: 20px 20px 10px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Distribuye el espacio para que los botones queden alineados */
}

.info-producto h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.info-producto p {
  color: var(--cozy-muted);
  font-size: 0.9rem;
  margin: 0 0 15px 0;
  line-height: 1.5;
  /* Limita descripciones largas a un bloque limpio de 2 líneas */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Precio en el catálogo */
.precio-etiqueta {
  font-size: 1.25rem;
  color: var(--cozy-green);
  margin-top: auto !important; /* Empuja el precio al fondo de la tarjeta */
  font-weight: 600;
}

.acciones {
  padding: 0 20px 20px 20px;
}

/* Botón Más Información */
.btn-secundario {
  display: block;
  text-align: center;
  background: transparent;
  color: var(--cozy-green);
  border: 1.5px solid var(--cozy-green);
  padding: 9px 20px;
  border-radius: var(--radius-boton);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transicion);
}

.btn-secundario:hover {
  background: var(--cozy-green);
  color: var(--cozy-white);
}

/* --- 4. FICHA DETALLE DE PRODUCTO (producto.php) --- */
.detalle-producto {
  display: flex;
  gap: 50px;
  padding: 40px 0;
  align-items: flex-start;
}

.bloque-imagen {
  flex: 1;
  max-width: 480px;
  box-shadow: var(--sombra-cozy);
  border-radius: var(--radius-cozy);
  overflow: hidden;
}

.bloque-imagen img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-cozy);
  display: block;
}

.bloque-info {
  flex: 1;
}

/* Textos informativos de planta */
.bloque-info h1 {
  font-size: 2.4rem;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.bloque-info h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cozy-muted);
  margin-bottom: 10px;
}

.descripcion-texto {
  font-size: 1.05rem;
  color: #4e5952;
  line-height: 1.7;
  margin-bottom: 25px;
}

/* Precio destacado en la ficha */
.precio-destacado {
  font-size: 1.75rem;
  color: var(--cozy-green);
  margin: 20px 0;
  font-weight: 600;
}

/* Meta datos (ID, Stock) */
.meta-producto {
  color: var(--cozy-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(96, 124, 104, 0.1);
  padding-top: 15px;
  margin-bottom: 30px;
}

/* Botón Añadir al Carrito (Usa el color terracota de acento para llamar a la acción) */
.btn-principal {
  background: var(--cozy-terracota);
  color: var(--cozy-white);
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-boton);
  box-shadow: 0 6px 20px rgba(217, 155, 119, 0.2);
  cursor: pointer;
  transition: var(--transicion);
}

.btn-principal:hover {
  background: #c98a63;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(217, 155, 119, 0.35);
}

/* Enlace de regreso */
.enlace-volver {
  display: inline-block;
  margin-top: 20px;
  color: var(--cozy-muted);
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--cozy-muted);
  transition: var(--transicion);
}

.enlace-volver:hover {
  color: var(--cozy-terracota);
  border-color: var(--cozy-terracota);
}

/* --- 5. MENSAJES DE CONTROL Y ERRORES --- */
.sin-productos {
  text-align: center;
  width: 100%;
  padding: 40px;
  color: var(--cozy-muted);
  font-size: 1.1rem;
}

.error-conexion {
  color: #c94c4c;
  font-weight: bold;
  text-align: center;
  width: 100%;
  padding: 20px;
  background: rgba(201, 76, 76, 0.05);
  border-radius: var(--radius-cozy);
}

/* --- 6. PIE DE PÁGINA (piedepagina.inc) --- */
footer {
  margin-top: 60px;
  padding: 30px 20px;
  background-color: var(--cozy-white);
  border-top: 1px solid rgba(96, 124, 104, 0.08);
  border-radius: var(--radius-cozy) var(--radius-cozy) 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--cozy-muted);
  line-height: 1.8;
  box-shadow: 0 -5px 25px rgba(96, 124, 104, 0.02);
}

footer img {
  opacity: 0.85;
  margin-bottom: 10px;
  transition: var(--transicion);
}

footer img:hover {
  opacity: 1;
}

footer a {
  color: var(--cozy-green);
  font-weight: 500;
}

footer a:hover {
  color: var(--cozy-terracota);
  text-decoration: underline;
}

/* --- 7. RESPONSIVE (Móviles y Tablets) --- */
@media (max-width: 800px) {
  .escaparate {
    gap: 20px;
  }
  
  .detalle-producto {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  
  .bloque-imagen {
    max-width: 100%;
  }
  
  header h1 {
    font-size: 2.2rem;
  }
}