/* ================================================================
   MARLA CENTER MENÚ — Estilos
================================================================ */

:root {
    --mc-primary:    #2563eb;
    --mc-primary-h:  #1d4ed8;
    --mc-success:    #16a34a;
    --mc-success-h:  #15803d;
    --mc-danger:     #dc2626;
    --mc-secondary:  #6b7280;
    --mc-secondary-h:#4b5563;
    --mc-bg:         #f1f5f9;
    --mc-surface:    #ffffff;
    --mc-border:     #e2e8f0;
    --mc-text:       #1e293b;
    --mc-text-muted: #64748b;
    --mc-shadow:     0 2px 8px rgba(0,0,0,.08);
    --mc-shadow-lg:  0 8px 24px rgba(0,0,0,.12);
    --mc-radius:     12px;
    --mc-radius-sm:  8px;
    --mc-changed:    #fef3c7;
    --mc-changed-border: #f59e0b;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

.mc-body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--mc-bg);
    color: var(--mc-text);
    min-height: 100vh;
}

/* ================================================================
   BOTONES
================================================================ */
.mc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--mc-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s, box-shadow .2s;
    white-space: nowrap;
}
.mc-btn:active { transform: scale(.97); }

.mc-btn-primary  { background: var(--mc-primary);   color: #fff; }
.mc-btn-primary:hover  { background: var(--mc-primary-h); box-shadow: 0 4px 12px rgba(37,99,235,.35); }

.mc-btn-success  { background: var(--mc-success);   color: #fff; }
.mc-btn-success:hover  { background: var(--mc-success-h); box-shadow: 0 4px 12px rgba(22,163,74,.35); }

.mc-btn-secondary { background: var(--mc-secondary); color: #fff; }
.mc-btn-secondary:hover { background: var(--mc-secondary-h); }

.mc-btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 16px; }
.mc-btn-sm   { padding: 6px 14px; font-size: 13px; }

/* ================================================================
   LOGIN
================================================================ */
.mc-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    padding: 20px;
}

.mc-login-card {
    background: var(--mc-surface);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--mc-shadow-lg);
}

.mc-login-logo {
    text-align: center;
    margin-bottom: 36px;
}
.mc-logo-icon { font-size: 56px; display: block; margin-bottom: 8px; }
.mc-login-logo h1 { font-size: 26px; font-weight: 700; color: var(--mc-text); }
.mc-subtitle { color: var(--mc-text-muted); font-size: 14px; margin-top: 4px; }

.mc-login-form { display: flex; flex-direction: column; gap: 20px; }

.mc-field-group { display: flex; flex-direction: column; gap: 6px; }
.mc-field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.mc-field-group input,
.mc-select {
    padding: 12px 16px;
    border: 2px solid var(--mc-border);
    border-radius: var(--mc-radius-sm);
    font-size: 15px;
    color: var(--mc-text);
    background: var(--mc-bg);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}
.mc-field-group input:focus,
.mc-select:focus {
    border-color: var(--mc-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    background-color: #fff;
}

.mc-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--mc-radius-sm);
    font-size: 14px;
    font-weight: 500;
}
.mc-alert-error { background: #fef2f2; color: var(--mc-danger); border: 1px solid #fecaca; }

/* ================================================================
   HEADER
================================================================ */
.mc-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--mc-surface);
    border-bottom: 1px solid var(--mc-border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--mc-shadow);
}

.mc-header-left { display: flex; align-items: center; gap: 14px; }
.mc-header-icon { font-size: 32px; }
.mc-header-title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.mc-header-empleado { font-size: 13px; color: var(--mc-text-muted); }

.mc-header-right { display: flex; align-items: center; gap: 10px; }

/* ================================================================
   BARRA DE CAMBIOS PENDIENTES
================================================================ */
.mc-cambios-bar {
    position: sticky;
    top: 65px;
    z-index: 99;
    background: #fef3c7;
    border-bottom: 2px solid #f59e0b;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

/* ================================================================
   MAIN
================================================================ */
.mc-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.mc-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--mc-text-muted);
    font-size: 16px;
    line-height: 2;
}

/* ================================================================
   CATEGORÍAS
================================================================ */
.mc-categoria {
    background: var(--mc-surface);
    border-radius: var(--mc-radius);
    border: 1px solid var(--mc-border);
    overflow: hidden;
    box-shadow: var(--mc-shadow);
}

.mc-categoria-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(90deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid var(--mc-border);
    cursor: pointer;
    user-select: none;
    transition: background .2s;
}
.mc-categoria-header:hover { background: linear-gradient(90deg, #f1f5f9, #e2e8f0); }

.mc-categoria-nombre {
    font-size: 17px;
    font-weight: 700;
    color: var(--mc-text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.mc-categoria-count {
    font-size: 13px;
    font-weight: 400;
    color: var(--mc-text-muted);
}

.mc-toggle-icon {
    font-size: 18px;
    transition: transform .25s;
    color: var(--mc-text-muted);
}
.mc-toggle-icon.collapsed { transform: rotate(-90deg); }

/* ================================================================
   GRID DE PRODUCTOS
================================================================ */
.mc-productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px;
    transition: all .3s;
}
.mc-productos-grid.hidden { display: none; }

/* ================================================================
   TARJETA DE PRODUCTO
================================================================ */
.mc-card {
    background: var(--mc-surface);
    border: 2px solid var(--mc-border);
    border-radius: var(--mc-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.mc-card:hover { box-shadow: var(--mc-shadow-lg); }
.mc-card[data-changed="true"] {
    border-color: var(--mc-changed-border);
    background: var(--mc-changed);
}

/* IMAGEN */
.mc-card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    cursor: pointer;
    background: #f8fafc;
    flex-shrink: 0;
}

.mc-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}
.mc-card-img-wrapper:hover .mc-card-img { transform: scale(1.05); }

.mc-no-img {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    width: 100%;
    height: 100%;
    background: #f1f5f9;
}

.mc-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 6px;
    opacity: 0;
    transition: opacity .2s;
}
.mc-card-img-wrapper:hover .mc-img-overlay { opacity: 1; }

/* CUERPO */
.mc-card-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.mc-nombre-input {
    width: 100%;
    border: 1px solid var(--mc-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mc-text);
    background: transparent;
    outline: none;
    transition: border-color .2s, background .2s;
    resize: none;
    line-height: 1.4;
    min-height: 48px;
}
.mc-nombre-input:focus {
    border-color: var(--mc-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.mc-card-id {
    font-size: 11px;
    color: var(--mc-text-muted);
    padding: 0 2px;
}

/* ================================================================
   FAB (Botón flotante)
================================================================ */
.mc-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--mc-success);
    color: #fff;
    font-size: 24px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(22,163,74,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s, box-shadow .2s;
    z-index: 200;
}
.mc-fab:hover {
    background: var(--mc-success-h);
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(22,163,74,.55);
}
.mc-fab:active { transform: scale(.95); }

/* ================================================================
   TOAST
================================================================ */
.mc-toast {
    position: fixed;
    bottom: 100px;
    right: 28px;
    background: #1e293b;
    color: #fff;
    padding: 14px 22px;
    border-radius: var(--mc-radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--mc-shadow-lg);
    z-index: 300;
    max-width: 320px;
    animation: mc-slide-in .3s ease;
}
.mc-toast.success { background: var(--mc-success); }
.mc-toast.error   { background: var(--mc-danger); }

@keyframes mc-slide-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   MODAL AVISO TPV
================================================================ */
#mc-modal-tpv {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.mc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.mc-modal-box {
    position: relative;
    background: var(--mc-surface);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(0,0,0,.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: mc-modal-in .25s ease;
}

@keyframes mc-modal-in {
    from { opacity: 0; transform: scale(.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.mc-modal-icon { font-size: 52px; line-height: 1; }

.mc-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--mc-text);
}

.mc-modal-msg {
    font-size: 15px;
    color: var(--mc-text);
    line-height: 1.6;
}

.mc-modal-hint {
    background: #f1f5f9;
    border-left: 3px solid var(--mc-primary);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--mc-text-muted);
    line-height: 1.7;
    text-align: left;
}
.mc-modal-hint em { color: var(--mc-primary); font-style: normal; font-weight: 600; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 640px) {
    .mc-header { padding: 12px 16px; }
    .mc-header-title { font-size: 16px; }
    .mc-header-right { gap: 8px; }
    .mc-btn { padding: 8px 14px; font-size: 13px; }
    .mc-main { padding: 16px; gap: 20px; }
    .mc-productos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .mc-fab { width: 52px; height: 52px; font-size: 20px; bottom: 20px; right: 20px; }
}
