/* =========================================
   1. CORE, VARIABLES & FONTS
   ========================================= */
:root {
    --dark-bg: #1a1d1c;       
    --accent-cream: #e0d9c5;  
    --gold-muted: #a3905d;    
    --white: #ffffff;
    --bg-paper: #f4f1ea;      
    --primary: var(--dark-bg);
    --accent: var(--accent-cream);
    --text-main: #1a1d1c;
    --text-muted: #666666;
    --gray-border: #d1c7ac;   
    --success: #2e7d32;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-paper);
    color: var(--text-main);
    overflow-x: hidden; /* Evita scroll horizontal accidental */
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; font-weight: 700; }

/* =========================================
   2. HEADER RESPONSIVO (2 NIVELES)
   ========================================= */
.main-header {
    background-color: var(--dark-bg);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--accent-cream);
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link img { height: 50px; width: auto; } /* Más pequeño para móviles */

.header-nav {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    overflow-x: auto; /* Scroll horizontal si son muchos links */
    width: 100%;
    justify-content: center;
    padding-bottom: 5px;
}

.header-nav a {
    color: var(--accent-cream);
    text-decoration: none;
    font-size: 0.7rem;
    text-transform: uppercase;
    white-space: nowrap;
    font-weight: bold;
}

/* =========================================
   3. CONTENEDORES DINÁMICOS
   ========================================= */
.container {
    max-width: 800px;
    margin: 15px auto;
    padding: 20px 15px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* =========================================
   4. MENÚ & CARDS (MOBILE OPTIMIZED)
   ========================================= */
.products-modern-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una columna por defecto en móvil */
    gap: 12px;
}

.product-modern-card {
    border: 1px solid var(--gray-border);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

/* Botón "+" más grande para pulgares */
.btn-add-modern {
    width: 45px !important;
    height: 45px !important;
    font-size: 1.2rem;
}

/* =========================================
   5. CARRITO & TABLAS RESPONSIVAS
   ========================================= */
.table-nota {
    width: 100%;
    font-size: 0.85rem;
}

.table-nota th, .table-nota td {
    padding: 10px 5px;
}

.total-row th { font-size: 1.3rem; }

/* =========================================
   6. BOTONES ACCIÓN (FULL WIDTH EN MÓVIL)
   ========================================= */
.btn-confirmar, .btn-pagar, .btn-primary-gloria {
    width: 100%;
    display: block;
    border-radius: 8px;
    padding: 18px;
    font-size: 1rem;
    margin-bottom: 10px;
}

/* =========================================
   7. MEDIA QUERIES (TABLETS & DESKTOP)
   ========================================= */
@media (min-width: 768px) {
    .header-container { flex-direction: row; justify-content: space-between; }
    .header-nav { width: auto; margin-top: 0; }
    .logo-link img { height: 70px; }
    .container { margin: 30px auto; padding: 40px; }
    .products-modern-grid { grid-template-columns: 1fr 1fr; } /* 2 columnas en desktop */
    .btn-confirmar { width: auto; min-width: 250px; margin: 20px auto; }
}

/* =========================================
   8. AJUSTES EXTRA MÓVIL (PANTALLAS PEQUEÑAS)
   ========================================= */
@media (max-width: 400px) {
    .logo-link img { height: 40px; }
    .header-nav { gap: 10px; }
    .header-nav a { font-size: 0.6rem; }
    .card-price { font-size: 1rem; }
}

/* =========================================
   9. ELEMENTOS DE UI REPETITIVOS
   ========================================= */
.instrucciones-cliente {
    display: flex;
    overflow-x: auto; /* Scroll si el móvil es muy angosto */
    gap: 10px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 10px;
}

.paso { min-width: 80px; } /* Evita que se colapsen en móvil */