/* store.css - Optimizado para AHD Clean */

/* ===== VARIABLES ===== */
:root {
    --primary: #1a365d;
    --primary-light: #2a5298;
    --accent: #002bff;
    --success: #38a169;
    --danger: #e53e3e;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --white: #ffffff;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-lg: 1rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ===== NAVEGACIÓN (CORREGIDA) ===== */
.nav {
    background: var(--primary);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left { display: flex; align-items: center; gap: 1rem; }
.nav-left a { color: var(--white); text-decoration: none; font-size: 0.9rem; font-weight: 500; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem; /* Espacio entre Rastreo y Carrito */
}

/* Botón de Rastreo Compacto */
.btn-rastreo-nav { 
    background: var(--white); 
    color: var(--primary); 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-weight: 700; 
    font-size: 0.8rem; 
    cursor: pointer; 
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.btn-rastreo-nav:hover { background: var(--bg-light); transform: scale(1.05); }

/* Carrito Circular e Indicador (Badge) */
.carrito-link {
    background: var(--accent);
    color: var(--white);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    text-decoration: none;
    flex-shrink: 0; /* Evita que se aplaste */
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: var(--white);
    font-size: 10px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

/* ===== FILTROS ===== */
.filtros {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.filtros form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filtro-grupo input, .filtro-grupo select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
}

/* ===== GRID DE PRODUCTOS ===== */
.productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.producto {
    border: 1px solid #edf2f7;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.producto:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.producto-imagen {
    height: 180px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.producto-imagen img { max-width: 100%; max-height: 100%; object-fit: contain; }

.categoria-tag {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 800;
}

.precio {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.5rem 0 1rem;
}

.producto-botones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: auto;
}

.btn-add {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

/* ===== MODAL DE RASTREO ===== */
.modal-rastreo {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--radius-lg);
    position: relative;
}

.timeline {
    margin-top: 1.5rem;
    border-left: 2px solid #eee;
    padding-left: 1.5rem;
}

.step { margin-bottom: 1rem; color: #cbd5e1; position: relative; }
.step i { position: absolute; left: -32px; background: white; }
.step.active { color: var(--primary); font-weight: 700; }
.step.active i { color: var(--success); }

/* ===== SECCIÓN CARRITO ===== */
.carrito-seccion {
    max-width: 800px;
    margin: 3rem auto;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.tabla-carrito { width: 100%; border-collapse: collapse; }
.tabla-carrito th { text-align: left; padding: 1rem; border-bottom: 2px solid var(--bg-light); }
.tabla-carrito td { padding: 1rem; border-bottom: 1px solid var(--bg-light); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-left span { display: none; }
    .productos { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .nav-right span { display: none; } /* Solo icono de camión en móvil */
    .productos { grid-template-columns: 1fr; }
    .producto-botones { grid-template-columns: 1fr; }
}