@charset "UTF-8";

/* ESTÉTICA REGLA DE ORO (INTACTA) */
:root { 
    --lp-negro: #121212; --lp-dorado: #d4af37; --lp-gris: #e0e5ec;
    --shadow: 5px 5px 10px rgba(163,177,198,0.6), -5px -5px 10px rgba(255,255,255, 0.5);
    --inner-shadow: inset 3px 3px 6px #a3b1c6, inset -3px -3px 6px #ffffff;
    --lp-error: #c0392b; --lp-ok: #27ae60;
}

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

body { 
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif; 
    background: var(--lp-gris); margin: 0; color: #444; font-size: 15px; 
    overflow-x: hidden; -webkit-font-smoothing: antialiased;
}

@media (max-width: 600px) { body { font-size: 0.85rem; } }

button { cursor: pointer; user-select: none; border: none; font-family: inherit; }

/* HEADER */
.header-main { 
    background: #ffffff; padding: 10px 20px; border-bottom: 4px solid var(--lp-dorado); 
    position: relative; box-shadow: 0 4px 20px rgba(0,0,0,0.08); 
    display: flex; align-items: center; min-height: 125px; 
    transition: all 0.3s ease; z-index: 100;
}
.header-center { justify-content: center; } 
.header-between { justify-content: space-between; } 

.logo-img { height: 95px; width: auto; display: block; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }

.info-bar { position: absolute; top: 135px; right: 20px; z-index: 999; display: none; align-items: center; gap: 15px; }
.user-label { text-align: right; font-size: 0.75rem; font-weight: 600; color: #555; max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { background: var(--lp-error); color: white; padding: 8px 12px; border-radius: 8px; font-weight: bold; font-size: 0.7rem; box-shadow: var(--shadow); }

@media (max-width: 600px) {
    .header-main { min-height: 100px; padding: 5px 15px; }
    .logo-img { height: 75px; } 
    .info-bar { top: 115px; gap: 8px; right: 10px; }
    .user-label { font-size: 0.65rem; max-width: 160px; }
    .btn-logout { padding: 6px 10px; font-size: 0.65rem; }
}

.main-wrapper { display: flex; justify-content: center; padding: 30px 15px; padding-bottom: 80px; }

/* CARDS */
.card { width: 100%; max-width: 500px; background: var(--lp-gris); padding: 25px; border-radius: 20px; box-shadow: var(--shadow); display: none; }
.card.active { display: block; animation: fadeIn 0.4s ease-out; }
#view-form { max-width: 900px; }
.card-wide { max-width: 1100px; }

/* TABS */
.tabs-login { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.tab-log { flex: 1 1 auto; padding: 12px 15px; border-radius: 12px; color: #777; text-transform: uppercase; font-size: 0.75rem; background: var(--lp-gris); box-shadow: var(--shadow); font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; min-width: 100px; text-align: center; }
.tab-log.active-user { background: var(--lp-negro); color: white; box-shadow: var(--inner-shadow); }
.tab-log.active-admin { background: var(--lp-dorado); color: white; box-shadow: var(--inner-shadow); }

/* COLORES MENÚS */
.tab-log.platos-active { background: #d35400; color: white; box-shadow: var(--inner-shadow); } 
.tab-log.bocadillo-active { background: #16a085; color: white; box-shadow: var(--inner-shadow); } 
.tab-log.ensalada-active { background: #27ae60; color: white; box-shadow: var(--inner-shadow); } 
.tab-log.medio-active { background: #2980b9; color: white; box-shadow: var(--inner-shadow); } 
.tab-log.carta-active { background: #8e44ad; color: white; box-shadow: var(--inner-shadow); } 

.tabs-admin { display: flex; gap: 8px; margin-bottom: 20px; padding: 8px; border-radius: 15px; background: #d1d9e6; box-shadow: var(--inner-shadow); overflow-x: auto; }
.tab-ad { padding: 8px 15px; border-radius: 10px; font-weight: 600; color: #666; white-space: nowrap; font-size: 0.75rem; background: transparent; }
.tab-ad.active { background: var(--lp-gris); color: var(--lp-dorado); box-shadow: var(--shadow); }

/* INPUTS */
input:not([type="checkbox"]), textarea, select { width: 100%; padding: 12px; margin-bottom: 10px; border-radius: 10px; background: var(--lp-gris); box-shadow: var(--inner-shadow); font-size: 0.95rem; color: #333; border: none; font-family: inherit; }

/* UTILS */
.pass-wrapper { position: relative; width: 100%; }
.pass-toggle { position: absolute; right: 12px; top: 12px; cursor: pointer; font-size: 1.1rem; color: #777; z-index: 10; }
.button-group { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
.btn-opt { padding: 12px; background: var(--lp-gris); border-radius: 10px; font-weight: 500; text-align: left; box-shadow: var(--shadow); font-size: 0.85rem; color: #555; width: 100%; text-transform: uppercase; }
.btn-opt.selected { box-shadow: var(--inner-shadow); color: var(--lp-dorado); font-weight: 700; border: 1px solid var(--lp-dorado); }
.btn-opt.carta-selected { box-shadow: var(--inner-shadow); color: #8e44ad; font-weight: 700; border: 1px solid #8e44ad; }
.submit-btn { width: 100%; padding: 15px; background: var(--lp-negro); color: var(--lp-dorado); border-radius: 12px; font-weight: 800; box-shadow: var(--shadow); text-transform: uppercase; font-size: 0.9rem; margin-top: 10px; letter-spacing: 1px; }
.submit-btn:active { transform: translateY(2px); box-shadow: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.section-h { font-size: 0.85rem; font-weight: 700; color: var(--lp-dorado); margin: 15px 0 5px 0; text-transform: uppercase; border-left: 4px solid var(--lp-dorado); padding-left: 8px; letter-spacing: 0.5px; }
.stock-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; background: #f0f3f7; padding: 5px; border-radius: 8px; box-shadow: var(--inner-shadow); }
.qty-btn { width: 30px; height: 30px; border-radius: 5px; background: var(--lp-negro); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.login-footer { margin-top: 25px; padding-top: 15px; border-top: 1px solid rgba(212, 175, 55, 0.3); text-align: center; font-size: 0.75rem; color: #666; }
.perm-list { display: flex; flex-direction: column; gap: 8px; margin: 15px 0; }
.perm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: white; border-radius: 8px; box-shadow: 2px 2px 5px rgba(0,0,0,0.05); }
.perm-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--lp-dorado); margin: 0; }
.order-summary-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem; font-family: 'Poppins', sans-serif; }
.order-summary-table td { padding: 8px; border-bottom: 1px solid #eee; }
.order-summary-table tr:last-child td { border-bottom: none; }
.order-summary-table .lbl { font-weight: 600; color: #555; width: 35%; }
.order-summary-table .val { color: #000; font-weight: 400; }

.login-warning {
    text-align: center; font-size: 0.8rem; color: var(--lp-dorado); font-weight: 600; 
    margin: 15px 0; padding: 10px; border: 1px dashed var(--lp-dorado); border-radius: 10px;
    background: rgba(212, 175, 55, 0.05);
}

.header-fecha { width: 100%; padding: 10px; margin: 15px 0 10px 0; background: #e0e5ec; border-bottom: 2px solid var(--lp-dorado); text-align: center; font-weight: 800; color: var(--lp-negro); border-radius: 8px; font-size: 0.9rem; text-transform: uppercase; }

/* COLORES COMANDAS */
.comanda-green { border-left: 6px solid #27ae60 !important; background-color: #f0fff4 !important; }
.comanda-orange { border-left: 6px solid #e67e22 !important; background-color: #fffaf0 !important; }
.comanda-blue { border-left: 6px solid #2980b9 !important; background-color: #eaf2f8 !important; }

/* ADMIN - BLOQUES AVANZADOS */
.admin-section-block { background: white; padding: 15px; border-radius: 10px; margin-bottom: 15px; border: 1px solid #eee; }
.adv-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; background: #eee; padding: 5px; border-radius: 5px; font-size: 0.7rem; }
.adv-check { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.adv-check input { width: 16px; height: 16px; accent-color: var(--lp-dorado); margin: 0; }

/* ESTILOS HERENCIA, STOCK Y DIMMED */
.inherited-section { opacity: 0.7; background-color: #fafafa; border: 1px dashed #999; pointer-events: none; position: relative; }
.inherited-section::after { content: '🔒 Solo lectura (Heredado)'; position: absolute; top: 5px; right: 5px; font-size: 0.65rem; background: #555; color: white; padding: 2px 5px; border-radius: 3px; }
.hidden-visually { display: none !important; }

.dynamic-section { transition: all 0.3s ease; border: 2px solid transparent; padding: 5px; border-radius: 10px; }
.section-dimmed { opacity: 0.4; filter: grayscale(1); background-color: #f9f9f9; }
.section-dimmed:hover { opacity: 0.8; cursor: pointer; background-color: #fff; filter: grayscale(0.2); box-shadow: 0 0 10px rgba(0,0,0,0.1); }

/* CARTA */
.cart-modern { background: #fff; border-radius: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); padding: 15px; border: 1px solid rgba(0,0,0,0.05); position: relative; overflow: hidden; margin-bottom: 10px; }
.cart-modern::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: linear-gradient(90deg, var(--lp-dorado), #f1c40f); }
.cart-item-modern { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px dashed #eee; transition: all 0.3s ease; animation: slideIn 0.3s ease; }
.cart-item-modern:last-child { border-bottom: none; }
.cart-item-info { display: flex; flex-direction: column; }
.cart-item-name { font-weight: 600; font-size: 0.9rem; color: #333; }
.cart-item-desc { font-size: 0.75rem; color: #999; }
.cart-item-actions { display: flex; align-items: center; gap: 10px; }
.cart-price-tag { font-weight: bold; color: var(--lp-dorado); font-size: 0.95rem; }
.btn-remove-modern { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 1px solid #eee; color: #e74c3c; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; box-shadow: 1px 1px 3px rgba(0,0,0,0.1); }
.btn-opt.item-in-cart { border: 2px solid var(--lp-dorado); background: #fffcf0; color: var(--lp-negro); position: relative; box-shadow: var(--inner-shadow); }
.btn-opt.item-in-cart::after { content: '✔'; position: absolute; top: 8px; right: 10px; font-size: 1rem; color: var(--lp-dorado); font-weight: 800; }
.cart-empty-msg { text-align: center; padding: 20px; color: #aaa; font-style: italic; font-size: 0.85rem; display: flex; flex-direction: column; align-items: center; gap: 5px; }

/* ESTILOS DE IMPRESIÓN (MODIFICADO PROFUNDAMENTE) */
#print-zone { display: none; } 
@media print {
    @page { size: 80mm auto; margin: 0; }
    body { margin: 0; padding: 0; background: white; }
    body * { visibility: hidden; height: 0; overflow: hidden; }
    #print-zone, #print-zone * { visibility: visible; display: block; position: relative; width: 78mm; font-size: 10pt; font-family: monospace; line-height: 1.2; height: auto; overflow: visible; margin: 0 auto; color: black !important; }
    
    /* IMAGEN GRANDE */
    #print-zone .print-logo { 
        width: 100%; /* Ocupa ancho disponible hasta 180px */
        max-width: 250px; 
        height: auto; 
        margin: 0 auto 10px auto; 
        display: block !important; 
    }
    
    /* TEXTO FALLBACK SI NO HAY IMAGEN (Estilo Logotipo) */
    #print-zone .print-logo-text {
        font-family: 'Times New Roman', serif;
        font-size: 20pt;
        font-weight: 900;
        text-align: center;
        text-transform: uppercase;
        margin-bottom: 15px;
        line-height: 1.1;
        color: black !important;
        border: 2px solid black;
        padding: 10px;
        border-radius: 10px;
    }
    
    #print-zone .print-name { font-size: 16pt; font-weight: 900; text-transform: uppercase; text-align: center; margin-bottom: 5px; border-bottom: 2px solid black; padding-bottom: 5px; }
    #print-zone .print-menu-type { font-size: 14pt; font-weight: 800; text-align: center; margin-bottom: 10px; border: 2px solid black; padding: 5px; background: #eee; }
    #print-zone .print-data { margin-bottom: 5px; }
    #print-zone .cut-zone { height: 1cm; width: 100%; border-top: 1px dashed #ccc; margin-top: 10px; }
    #print-zone .print-header-main { text-align: center; font-size: 20pt; font-weight: 900; margin-bottom: 10px; line-height: 1.1; font-family: sans-serif; }
}