/* ─── FUENTES VELONOX ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ─── RESET Y VARIABLES ──────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Paleta Velonox */
    --ink: #0F1A14;          /* verde casi negro (fondos oscuros) */
    --panel: #1A2820;        /* paneles oscuros */
    --border-dark: #243B2C;  /* bordes sobre oscuro */
    --border-dark-2: #2A4A38;
    --primary: #1D7A4F;      /* verde marca */
    --primary-dark: #166442;
    --primary-hover: #22904F;
    --mint: #C8D8C0;         /* texto claro sobre oscuro */
    --mint-soft: #B0BEB8;
    --muted: #6B8A7A;        /* texto apagado */
    --muted-2: #4A6A5A;
    --sand: #D6C5A0;         /* acento arena */
    --bg: #F5F5F3;           /* fondo claro */
    --surface: #ffffff;
    --line: #E8E8E4;         /* bordes sobre claro */
    --text: #0F1A14;
    --text-soft: #7A7A72;
    --danger: #DC2626;
    --success: #1D7A4F;
    --gray-500: #64748b;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(15,26,20,0.08);
    --radius: 2px;
    --font-head: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-head); }

/* ─── NAVBAR ──────────────────────────────────────────────────────── */
nav {
    background: var(--ink);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .logo {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: var(--mint);
    letter-spacing: -.5px;
    text-decoration: none;
}
nav .logo .accent { color: var(--primary); }

nav .nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav .nav-links a {
    text-decoration: none;
    color: var(--mint);
    font-weight: 400;
    font-size: 13px;
    opacity: .7;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    transition: opacity 0.2s, background 0.2s;
}

nav .nav-links a:hover { opacity: 1; background: rgba(255,255,255,0.04); }

/* ─── BOTONES ─────────────────────────────────────────────────────── */
.btn {
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: .02em;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* ─── CONTENEDOR ─────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* ─── GRID DE PRODUCTOS ───────────────────────────────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ─── CARD DE PRODUCTO ────────────────────────────────────────────── */
.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(15,26,20,0.10);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #E8ECE6;
}

.product-card .card-body { padding: 1rem; }
.product-card h3 { font-size: 1rem; margin-bottom: 0.4rem; color: var(--text); }
.product-card .price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.8rem;
}
.product-card .stock { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 0.8rem; }

/* ─── FORMULARIOS ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 500; font-size: 0.9rem; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--surface);
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ─── ALERTAS ─────────────────────────────────────────────────────── */
.alert {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
}
.alert-error { background: #fee2e2; color: var(--danger); }
.alert-success { background: #dcfce7; color: var(--success); }

/* ─── CARRITO ─────────────────────────────────────────────────────── */
.cart-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); background: #E8ECE6; }
.cart-item .item-info { flex: 1; }
.cart-item .item-name { font-weight: 600; margin-bottom: 0.3rem; color: var(--text); }
.cart-item .item-price { color: var(--primary); font-weight: 600; }

.cart-total {
    background: var(--ink);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: right;
    margin-top: 1rem;
}

.cart-total .total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-head);
    color: var(--mint);
    margin-bottom: 1rem;
}

/* ─── LOADING ─────────────────────────────────────────────────────── */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ─── PAGE HEADER ─────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 { font-size: 1.8rem; color: var(--text); }

/* ─── BRANDING Y COMPONENTES RESTANTES ─────────────────────────────── */
.logo.text-brand {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--mint);
    text-decoration: none;
}

.logo.text-brand .accent {
    color: var(--primary);
}

.auth-container {
    max-width: 460px;
    margin: 4rem auto;
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 45px rgba(15,26,20,0.08);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 2rem;
    letter-spacing: -.025em;
}

.tab-buttons {
    display: flex;
    margin-bottom: 1.5rem;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid var(--primary);
    background: rgba(29,122,79,0.08);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
}

.result-box {
    max-width: 500px;
    margin: 6rem auto;
    text-align: center;
    background: var(--surface);
    padding: 3rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 45px rgba(15,26,20,0.08);
}

.result-box .icon { font-size: 4rem; margin-bottom: 1rem; }

.result-box h2 { margin-bottom: 1rem; color: var(--ink); font-family: var(--font-head); }

.result-box p { color: var(--gray-500); margin-bottom: 2rem; }

.cart-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 25px rgba(15,26,20,0.05);
}

.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 16px; background: #E8ECE6; }

.cart-total {
    background: var(--ink);
    padding: 1.5rem;
    border-radius: 18px;
    text-align: right;
    margin-top: 1rem;
}

.cart-total .total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-head);
    color: var(--mint);
    margin-bottom: 1rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

footer {
    background: var(--ink);
    color: var(--mint-soft);
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--muted);
}

@media (max-width: 860px) {
    nav { padding: 0 1rem; }
    .nav-links { display: none; }
    .container { padding: 1.5rem; }
    .products-grid, .cart-item { gap: 1rem; }
}
