/* ===== VARIABLES Y SETUP ===== */
:root {
    --bg-color: #f4f1ec;
    --dark-mate: #1a1a1a;
    --gold-premium: #c5a059;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

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

body {
    margin: 0;
    background-color: var(--bg-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== CONTENEDOR PDF ===== */
#pdf-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 15px 220px 15px;
    /* Espacio extra abajo para que los botones no tapen el contenido */
}

#pdf-container canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ===== PANEL INFERIOR (CONTENEDOR DE BOTONES) ===== */
#botones {
    position: fixed;
    bottom: 20px; /* Separación del borde inferior */
    left: 50%;
    transform: translateX(-50%); /* Centrado perfecto */
    
    /* Ajuste de ancho con "padding" visual */
    width: 90%; /* Ocupa el 90% de la pantalla */
    max-width: 450px; /* Evita que se vea muy largo en tablets */

    /* Glassmorphism y estilo */
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow);
    border-radius: 24px; /* Bordes redondeados en todas las esquinas */
    z-index: 9999;
}
#botones h1 {
    margin: 0 0 12px 0;
    font-size: 11px;
    /* Título más discreto */
    font-weight: 800;
    color: var(--dark-mate);
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
}

/* ===== GRID DE BOTONES ===== */
.grupo-botones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}
/* ===== ESTILO PREMIUM DE BOTÓN ===== */
.btn-premium {
    display: flex;
    align-items: center; 
    
    /* CAMBIO: Alineación al inicio para control total del desfase */
    justify-content: flex-start; 
    
    gap: 0; /* Quitamos el gap general para usar el margin del icono */
    padding: 12px 15px;
    background: var(--dark-mate);
    color: #ffffff;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap; 
}

/* Iconos de Font Awesome */
.btn-premium i {
    font-size: 1.1rem;
    color: var(--gold-premium);
    
    /* SOLUCIÓN: Ancho fijo para que todos los iconos ocupen lo mismo */
    width: 25px; 
    display: flex;
    justify-content: center; /* Centra el icono dentro de esos 25px */
    align-items: center;
    
    /* Separación consistente con el texto */
    margin-right: 4px; 
}

/* Texto del botón */
.btn-premium span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
    
    /* Opcional: Asegura que el texto se alinee a la izquierda del espacio sobrante */
    text-align: left; 
    flex: 1; 
}

/* Feedback Táctil al presionar */
.btn-premium:active {
    transform: scale(0.92);
    background: var(--gold-premium);
}

.btn-premium:active i,
.btn-premium:active span {
    color: var(--dark-mate);
}

/* Ajuste para pantallas muy pequeñas */
@media (max-width: 360px) {
    .btn-premium span {
        font-size: 9px;
    }

    .btn-premium i {
        font-size: 1.2rem;
    }
}
/* ===== CORRECCIONES PARA CELULAR ===== */
.grupo-botones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.btn-premium { white-space: normal; min-width: 0; min-height: 44px; padding: 10px; }
.btn-premium i { flex-shrink: 0; margin-right: 8px; }
.btn-premium span { line-height: 1.25; }
#botones { bottom: calc(12px + env(safe-area-inset-bottom)); padding: 16px; }
#botones h1 { text-align: center; }
#estado { text-align: center; padding: 16px; }

/* Celular en horizontal: una sola fila para no tapar el menú */
@media (orientation: landscape) and (max-height: 500px) {
    #botones { width: 96%; max-width: 760px; padding: 8px; }
    #botones h1 { display: none; }
    .grupo-botones { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
}

/* Enlace a facturación, separado de los botones de pedido */
.enlace-factura {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; margin-top: 8px;
    font-size: 11px; font-weight: 700; color: var(--dark-mate); text-decoration: underline; opacity: 0.8;
}
@media (orientation: landscape) and (max-height: 500px) {
    .enlace-factura { min-height: 32px; margin-top: 4px; }
}
