/* Tocho — estilos sobre MDB 5 (Material Design for Bootstrap) */

:root {
    --brand: #e0237a;
    --brand-dark: #b8165f;
    --brand-2: #ff7a59;
    --teal: #12b5a6;
    --ink: #1f2433;
    --muted: #6b7280;
    --surface: #ffffff;
    --bg: #f4f5fb;
    --radius: 1rem;
    --shadow-1: 0 2px 6px rgba(31, 36, 51, .06), 0 8px 24px rgba(31, 36, 51, .06);
    --shadow-2: 0 10px 30px rgba(224, 35, 122, .18), 0 4px 10px rgba(31, 36, 51, .08);
    --gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
    min-height: 100vh;
}

[x-cloak] { display: none !important; }

/* Botón principal con la marca */
.btn-primary {
    --mdb-btn-bg: var(--brand);
    --mdb-btn-hover-bg: var(--brand-dark);
    --mdb-btn-focus-bg: var(--brand-dark);
    --mdb-btn-active-bg: var(--brand-dark);
    --mdb-btn-box-shadow: 0 4px 9px -4px var(--brand);
    --mdb-btn-box-shadow-state: 0 8px 9px -4px rgba(224, 35, 122, .35), 0 4px 18px 0 rgba(224, 35, 122, .2);
}
.btn-gradient {
    background: var(--gradient);
    color: #fff;
    border: 0;
    box-shadow: 0 6px 16px -6px rgba(224, 35, 122, .7);
}
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(1.05); box-shadow: var(--shadow-2); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--gradient) !important; color: #fff; }

/* Barra superior */
.app-navbar {
    background: var(--gradient);
    box-shadow: 0 4px 20px rgba(224, 35, 122, .25);
}
.app-navbar .navbar-brand { font-weight: 800; letter-spacing: .5px; color: #fff; }
.app-navbar .nav-link { color: rgba(255, 255, 255, .85) !important; border-radius: .6rem; padding: .5rem .8rem !important; transition: background .2s; }
.app-navbar .nav-link:hover, .app-navbar .nav-link.active { color: #fff !important; background: rgba(255, 255, 255, .18); }
.app-navbar .navbar-toggler { color: #fff; }
.brand-logo {
    width: 34px; height: 34px; border-radius: 10px;
    display: inline-grid; place-items: center;
    background: rgba(255, 255, 255, .2); backdrop-filter: blur(6px);
}

/* Tarjetas con efecto de elevación */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-lift { transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
.card-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }

.page-title { font-weight: 700; letter-spacing: -.3px; }
.page-header { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }

/* Indicadores */
.stat { position: relative; overflow: hidden; }
.stat .stat-icon {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
    background: var(--gradient); color: #fff; font-size: 1.25rem; box-shadow: var(--shadow-2);
}
.stat .stat-value { font-size: 1.6rem; font-weight: 700; }

/* Imagen de producto */
.product-thumb {
    aspect-ratio: 4 / 3; width: 100%; object-fit: cover;
    border-radius: calc(var(--radius) - .25rem);
    background: linear-gradient(135deg, #ffe1ee, #ffe9df);
}
.product-initials {
    aspect-ratio: 4 / 3; width: 100%; display: grid; place-items: center;
    border-radius: calc(var(--radius) - .25rem);
    font-size: 2rem; font-weight: 800; color: #fff; background: var(--gradient);
    text-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

/* Punto de venta */
.pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; }
@media (max-width: 991.98px) { .pos-layout { grid-template-columns: 1fr; } }
.pos-cart { position: sticky; top: 1rem; max-height: calc(100vh - 6rem); display: flex; flex-direction: column; }
@media (max-width: 991.98px) { .pos-cart { position: static; max-height: none; } }
.pos-cart-items { overflow-y: auto; flex: 1 1 auto; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .85rem; }
@media (max-width: 575.98px) { .pos-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; } }
.pos-product {
    cursor: pointer; border: 0; padding: .5rem; text-align: left; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow-1);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s;
}
.pos-product:hover { transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-2); }
.pos-product:active { transform: scale(.97); }
.pos-product .name { font-weight: 600; font-size: .92rem; line-height: 1.2; margin-top: .45rem; }
.pos-product .price { color: var(--brand); font-weight: 700; font-size: .9rem; }
.chip-filter {
    border: 0; border-radius: 2rem; padding: .45rem 1rem; background: #fff; color: var(--ink);
    box-shadow: var(--shadow-1); font-weight: 500; white-space: nowrap; transition: all .2s;
}
.chip-filter.active { background: var(--gradient); color: #fff; box-shadow: var(--shadow-2); }
.chips-scroll { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem .1rem .6rem; scrollbar-width: thin; }
.pay-option {
    border: 2px solid #e5e7eb; border-radius: .9rem; padding: .6rem .3rem; background: #fff;
    text-align: center; cursor: pointer; transition: all .15s; font-size: .85rem; font-weight: 600; width: 100%;
}
.pay-option i { display: block; font-size: 1.3rem; margin-bottom: .2rem; color: var(--muted); }
.pay-option.active { border-color: var(--brand); background: #fff0f6; color: var(--brand); }
.pay-option.active i { color: var(--brand); }
.option-pill {
    border: 2px solid #e5e7eb; border-radius: 2rem; padding: .4rem .9rem; background: #fff;
    cursor: pointer; font-size: .9rem; transition: all .15s; user-select: none;
}
.option-pill.active { border-color: var(--brand); background: #fff0f6; color: var(--brand); font-weight: 600; }
.option-pill.removed { border-color: #dc3545; background: #fff1f2; color: #dc3545; text-decoration: line-through; }
.qty-control { display: inline-flex; align-items: center; gap: .4rem; }
.qty-control button { width: 34px; height: 34px; border-radius: 50%; padding: 0; }
.cart-line { border-bottom: 1px dashed #e5e7eb; padding: .6rem 0; animation: slideIn .25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.total-box { background: var(--gradient); color: #fff; border-radius: .9rem; padding: .8rem 1rem; }

/* Modal propio (controlado por Alpine) */
.app-modal-backdrop {
    position: fixed; inset: 0; background: rgba(17, 20, 32, .55); backdrop-filter: blur(3px);
    z-index: 1050; display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
@media (min-width: 576px) { .app-modal-backdrop { align-items: center; padding: 1rem; } }
.app-modal {
    background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
    border-radius: 1.25rem 1.25rem 0 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    animation: popIn .25s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 576px) { .app-modal { border-radius: 1.25rem; } }
@keyframes popIn { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: none; } }
.app-modal-header { position: sticky; top: 0; background: #fff; z-index: 2; padding: 1rem 1.25rem; border-bottom: 1px solid #f0f0f4; }
.app-modal-body { padding: 1rem 1.25rem; }
.app-modal-footer { position: sticky; bottom: 0; background: #fff; padding: .9rem 1.25rem; border-top: 1px solid #f0f0f4; }

/* Pantalla de preparación */
.kitchen-body { background: #12141c; color: #e8e9ef; }
.kitchen-body .app-navbar { display: none; }
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.kitchen-card {
    background: #1d2030; border-radius: 1rem; overflow: hidden; border-top: 6px solid #6c757d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: popIn .35s ease; display: flex; flex-direction: column;
}
.kitchen-card.status-pending { border-top-color: #ffb020; }
.kitchen-card.status-preparing { border-top-color: #3b9eff; }
.kitchen-card.status-ready { border-top-color: #22c55e; }
.kitchen-card.is-late { box-shadow: 0 0 0 2px #ef4444, 0 10px 30px rgba(239, 68, 68, .35); }
.kitchen-card .k-head { padding: .8rem 1rem; display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, .03); }
.kitchen-card .k-ticket { font-size: 1.6rem; font-weight: 800; }
.kitchen-card .k-customer { font-size: 1.1rem; font-weight: 600; color: #fff; }
.kitchen-card .k-items { padding: .6rem 1rem; flex: 1; }
.kitchen-card .k-item { padding: .45rem 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.kitchen-card .k-qty { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; margin-right: .5rem; }
.mod-removed { color: #ff8a8a; }
.mod-topping { color: #6ee7a7; }
.mod-option { color: #93c5fd; }
.kitchen-card .k-actions { padding: .75rem 1rem; display: flex; gap: .5rem; }
.kitchen-card .k-actions .btn { flex: 1; font-size: 1rem; padding: .7rem; }
.kitchen-toolbar { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* Login */
.login-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 1rem;
    background: radial-gradient(circle at 20% 20%, #ffd6e8 0, transparent 40%),
                radial-gradient(circle at 80% 80%, #ffe2d6 0, transparent 40%), var(--bg);
}
.login-card { width: 100%; max-width: 400px; backdrop-filter: blur(12px); background: rgba(255, 255, 255, .85); }
.login-logo { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--gradient); color: #fff; font-size: 2rem; box-shadow: var(--shadow-2); }

/* Avisos flotantes */
.toast-stack { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
.app-toast { min-width: 260px; border-radius: .8rem; padding: .8rem 1rem; color: #fff; box-shadow: var(--shadow-2); animation: popIn .3s ease; display: flex; gap: .6rem; align-items: flex-start; }
.app-toast.success { background: linear-gradient(135deg, #16a34a, #12b5a6); }
.app-toast.error { background: linear-gradient(135deg, #dc2626, #e0237a); }

/* Tablas */
.table > :not(caption) > * > * { padding: .75rem .75rem; }
.table-hover tbody tr { transition: background .15s; }

/* Ticket impreso (80 mm) */
.ticket { width: 80mm; max-width: 100%; margin: 1rem auto; background: #fff; padding: 6mm 5mm; font-family: "Courier New", monospace; font-size: 12px; color: #000; box-shadow: var(--shadow-1); }
.ticket h1 { font-size: 16px; text-align: center; margin: 0 0 2mm; }
.ticket .t-number { font-size: 34px; font-weight: 800; text-align: center; line-height: 1; margin: 2mm 0; }
.ticket .t-name { font-size: 18px; font-weight: 700; text-align: center; text-transform: uppercase; }
.ticket hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; opacity: 1; }
.ticket table { width: 100%; }
.ticket .right { text-align: right; }
@media print {
    body { background: #fff; }
    .no-print { display: none !important; }
    .ticket { box-shadow: none; margin: 0; padding: 0 2mm; }
    @page { size: 80mm auto; margin: 2mm; }
}
