/* legacy: capa de transición del cutover (docs/design-system/CUTOVER.md D4). No agregar reglas aquí. */
@layer legacy {
/* ============================================================
   SHELL CSS — v4 (legacy, se vacía módulo a módulo)
   Queda: reset `*`/body y restos de header/bottom-nav/payment-drawer del POS v4.
   El nav inferior, la hoja y el chip de cuenta son kx-nav / kx-sheet / kx-menu (components/kx.css);
   el layout de `.main-content` está en css/modules/shell.css.
   ============================================================ */

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

body {
    overflow-x: hidden;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== LEGACY: COMPACT HEADER (for backwards compatibility) ===== */
.header {
    background: var(--surface-1);
    padding: 8px 20px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    height: var(--navbar-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: var(--z-fixed);
}

.store-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-icon-vivid {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.store-icon-vivid i {
    color: var(--white);
}

.store-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--fg-1);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-button-compact {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    color: var(--fg-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-button-compact:active {
    transform: scale(0.92);
}

/* ===== LEGACY: MAIN CONTAINER (for backwards compatibility) ===== */
.main-container {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - var(--navbar-h));
}

.view-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-container.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-1);
    padding: 12px 20px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border);
    z-index: var(--z-fixed);
    height: var(--bottom-nav-height);
}

.nav-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--fg-2);
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background: var(--bg);
}

.nav-button.active {
    color: var(--accent);
    background: var(--accent-tint);
}

.nav-button-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button-label {
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-body);
}

.nav-button:active {
    transform: scale(0.95);
}

/* ===== PAYMENT DRAWER ===== */

.payment-method {
    background: var(--bg);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.payment-method:hover {
    transform: scale(1.05);
}

.payment-method:active {
    transform: scale(0.95);
}

.payment-method.cash {
    border-color: var(--warn);
}

.payment-method.cash:hover {
    background: color-mix(in srgb, var(--warn) var(--tint-bg-amt), var(--surface-1));
    border-color: var(--warn);
}

.payment-method.card {
    border-color: var(--accent-tint);
}

.payment-method.card:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
}

.payment-method.transfer {
    border-color: var(--accent-tint);
}

.payment-method.transfer:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
}

.close-drawer {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--bad);
    color: var(--white);
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.close-drawer:active {
    transform: scale(0.9);
}

/* ===== SUCCESS OVERLAY ===== */
.success-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.success-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.success-content {
    text-align: center;
    color: var(--white);
    animation: success-pop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes success-pop {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-icon {
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
}

.success-text {
    font-size: 56px;
    font-weight: 900;
    margin-bottom: 12px;
}

.success-subtext {
    font-size: 24px;
    font-weight: 600;
    opacity: 0.9;
}

/* Shake animation for cart */
.shake {
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-button-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {

    .success-text {
        font-size: 42px;
    }
}

}
