/* ============================================================
   styles.css — Base global del sitio Vivero Shop
   
   Este archivo se carga en TODAS las páginas (públicas y admin).
   Define los tokens de color, layouts fundamentales, botones
   base, skeleton loaders y utilidades compartidas.
   
   NO tocar sin entender el impacto global.
   ============================================================ */

/* ── VARIABLES GLOBALES ─────────────────────────────────────
   Colores base por defecto (neutros). Las secciones Hogar y
   Regalos los pisan con sus propios valores en sus CSS.
   Cambiando aquí solo afectás páginas que no tienen sección.
   ─────────────────────────────────────────────────────────── */
:root {
    /* Colores base neutros para evitar parpadeos */
    --primary-color: #555;
    --secondary-color: #888;
    --accent-color: #eee;
    --light-bg: #ffffff;
    --beige-accent: #f9f9f9;

    /* Paleta de verdes — usada en toda la tienda */
    --vivero-green: #6a994e;
    /* Verde medio — texto de acento */
    --vivero-green-dark: #386641;
    /* Verde oscuro — navbar logo, hovers fuertes */
    --vivero-green-light: #a7c957;
    /* Verde lima — detalles secundarios */
    --vivero-bg: #f2f7f2;
    /* Verde muy pálido — fondos de sección */

    --green-accent: #f0fdf4;
    /* Casi blanco verde — fondos de hover */
    --pastel-green: #dcfce7;
    /* Verde pastel — fondo navbar general */
    --pastel-green-dark: #bbf7d0;
    /* Verde pastel oscuro — bordes y tags */
    --logo-green: #6a994e;
    /* Verde del logo ("Vivero") */

    --glass-bg: rgba(255, 255, 255, 0.8);
    /* Fondo glassmorphism */
    --glass-border: rgba(255, 255, 255, 0.4);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Animación suave estándar */
}

/* ── RESET BÁSICO ───────────────────────────────────────────
   Elimina margin y padding del navegador. box-sizing: border-box
   hace que padding y border se cuenten dentro del ancho del elemento.
   ─────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── BODY GLOBAL ────────────────────────────────────────────
   Fuente base, fondo blanco y scroll vertical habilitado.
   overflow-x: hidden evita scroll horizontal accidental.
   ─────────────────────────────────────────────────────────── */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── TIPOGRAFÍA — Títulos ───────────────────────────────────
   h1, h2, h3 usan Playfair Display (serif elegante).
   El texto normal usa Outfit (sans-serif moderno).
   ─────────────────────────────────────────────────────────── */
h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
}

/* ── LANDING PAGE — Contenedor dividido en 2 mitades ────────
   La página de inicio (index.html) tiene dos paneles:
   izquierda (Hogar) y derecha (Regalos), side by side.
   ─────────────────────────────────────────────────────────── */
.landing-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Cada mitad del landing */
.section {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: var(--transition);
    overflow: hidden;
    cursor: pointer;
}

/* Overlay oscuro semi-transparente sobre la imagen de fondo */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
}

/* Texto y botón encima del overlay (z-index 5 > 1) */
.content {
    position: relative;
    z-index: 5;
    padding: 2.5rem;
    color: white;
    max-width: 450px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 20px;
}

/* Imágenes de fondo de cada mitad — cambialas en assets/ */
.left-section {
    background: url('../assets/indoor-plants.jpg') center/cover no-repeat;
}

.right-section {
    background: url('../assets/gift-plants.jpg') center/cover no-repeat;
}

/* Al hover, la mitad se expande un 10% */
.section:hover {
    flex: 1.1;
}

/* Sección bloqueada (próximamente) — en escala de grises */
.section.blocked {
    filter: grayscale(100%) contrast(1.2);
    cursor: not-allowed;
}

.section.blocked:hover {
    flex: 1;
    /* No se expande al hover */
}

/* ── EMOJI FLOTANTE (animación decorativa) ──────────────────
   El emoji que flota y rota en el landing. Solo cosmético.
   Si querés quitarlo, removelo del HTML (index.html).
   ─────────────────────────────────────────────────────────── */
/*.emoji-float {
    position: absolute;
    top: 20%;
    right: 10%;
    font-size: 2.5rem;
    z-index: 3;
    animation: float 4s ease-in-out infinite;
    opacity: 0.8;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-30px) rotate(10deg);
    }
}*/

/* ── BADGE GENÉRICO ─────────────────────────────────────────
   Tag de texto pequeño con bordes redondeados. Usado en landing
   y en páginas de sección para labels de categoría.
   ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* ── BOTÓN BASE ─────────────────────────────────────────────
   Estilo base de todos los <button class="btn"> del sitio.
   Cada sección pisa el color con sus propias reglas.
   ─────────────────────────────────────────────────────────── */
.btn {
    padding: 0.9rem 2.8rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1.5rem;
}

/* Variante principal: verde con sombra */
.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 20px rgba(45, 90, 39, 0.4);
}

.primary-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(45, 90, 39, 0.6);
}

/* Botón deshabilitado — gris, sin interacción */
.btn.disabled {
    background-color: #444;
    color: #aaa;
    cursor: not-allowed;
}

/* Dashboard Styles */
.categories-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.dashboard-container {
    background: var(--light-bg);
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    border-radius: 30px;
    padding: 3rem;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: var(--beige-accent);
    border: none;
    color: var(--dark-text);
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--green-accent);
    transform: rotate(90deg);
}

.title {
    font-size: 2.8rem;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-style: italic;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem;
}

.category-card {
    background: white;
    border-radius: 25px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
}

.category-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.card-image {
    height: 200px;
    width: 100%;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.card-info {
    padding: 1.8rem;
    text-align: center;
}

.card-info h3 {
    margin-bottom: 0.4rem;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.card-info p {
    color: var(--secondary-color);
    font-size: 0.95rem;
    font-weight: 300;
}

@media (max-width: 768px) {
    .landing-container {
        flex-direction: column;
        height: auto;
    }

    .section {
        height: 50vh;
        min-height: 400px;
    }

    .section:hover {
        flex: 1;
    }

    /* Paneles flotantes del landing: reducir tamaño en tablet/mobile */
    .content {
        padding: 1.5rem;
        max-width: 78%;
        background: rgba(0, 0, 0, 0.35);
    }

    .content h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .dashboard-container {
        padding: 1.5rem;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        position: fixed;
        bottom: 0;
    }

    .title {
        font-size: 1.8rem;
    }

    .btn {
        width: 100%;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    /* Paneles flotantes del landing: ajuste fino para pantallas pequeñas */
    .content {
        padding: 1.1rem 1rem;
        max-width: 88%;
    }

    .content h2 {
        font-size: 1.25rem;
    }

    .content p {
        font-size: 0.82rem;
    }
}

/* Touch targets optimization */
button,
.btn,
a.sidebar-item,
.category-item {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .landing-container {
        flex-direction: column;
    }

    .section:hover {
        flex: 1;
    }

    .title {
        font-size: 2rem;
    }
}

/* ── LOADER / SPINNER ───────────────────────────────────────
   Indicador de carga circular. Aparece mientras JS trae datos.
   Afecta: <div class="loading-state"> y <div class="spinner">
   ─────────────────────────────────────────────────────────── */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    width: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(45, 90, 37, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    /* El arco giratorio toma el color primario */
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── SKELETON LOADERS ───────────────────────────────────────
   Placeholders animados que muestran la forma del contenido
   mientras carga. Usados en tarjetas de productos y títulos.
   Afecta: cualquier elemento con clase .skeleton
   ─────────────────────────────────────────────────────────── */
.skeleton {
    background-color: #e2e5e7;
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.2) 20%,
            rgba(255, 255, 255, 0.5) 60%,
            rgba(255, 255, 255, 0));
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
}

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

    100% {
        background-position: -100% 0;
    }
}

/* Variantes de skeleton por tipo de contenido */
.skeleton-text {
    height: 1.2rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Línea de texto */
.skeleton-h1 {
    height: 3rem;
    width: 70%;
    margin-bottom: 1rem;
}

/* Título grande */
.skeleton-price {
    height: 2.5rem;
    width: 40%;
}

/* Precio */
.skeleton-img {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

/* Imagen */
.skeleton-btn {
    height: 50px;
    width: 100%;
    border-radius: 30px;
}

/* Botón */

/* Utilities */
.hidden {
    display: none !important;
}

.skeleton-card {
    pointer-events: none;
    height: 380px;
}

.skeleton-card .product-image {
    height: 250px !important;
    background-color: #eee;
}

.skeleton-card .product-info {
    padding: 1rem;
}