/* legacy: capa de transición del cutover (docs/design-system/CUTOVER.md D4). No agregar reglas aquí. */
@layer legacy {
/**
 * V4 Design System - Modals
 * Modal system with backdrop, dialogs, and drawers
 */

/* ===== MODAL BACKDROP ===== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modal-fade-in 0.3s ease;
}

/* ===== MODAL CONTAINER ===== */

.modal {
    background: var(--surface-1);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-slide-up 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Wide Modal */

/* Form Modal (fixed width, used by forms like supplier edit) */



/* Full Width Modal */

/* ===== MODAL SECTIONS ===== */

.modal-header {
    padding: 28px 28px 20px;
    border-bottom: 2px solid var(--border);
}

.modal-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--fg-1);
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg-2);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 20px 28px 28px;
    display: flex;
    gap: 12px;
}

/* ===== MODAL BUTTONS ===== */

.modal-button {
    flex: 1;
    height: 52px;
    border-radius: var(--r-md);
    border: none;
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-body, 'Poppins', system-ui, sans-serif);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-button.cancel {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--fg-2);
}

.modal-button.cancel:hover {
    background: var(--surface-2);
    border-color: var(--fg-2);
}

.modal-button.primary {
    background: var(--ok);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.modal-button.primary:hover {
    background: var(--ok);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.modal-button.danger {
    background: var(--bad);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.modal-button.danger:hover {
    background: var(--bad-shade);
}

.modal-button:active {
    transform: scale(0.96);
}

/* ===== MODAL CONTENT COMPONENTS ===== */

/* Current Stock Display */
.current-stock-display {
    background: var(--bg);
    padding: 16px;
    border-radius: var(--r-md);
    margin-bottom: 24px;
}

.current-stock-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-2);
    margin-bottom: 6px;
}

.current-stock-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--fg-1);
}

/* Quantity Adjuster (for stock modals) */
.quantity-adjuster {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.adjust-btn {
    width: 60px;
    height: 60px;
    border-radius: var(--r-pill);
    border: none;
    background: var(--accent);
    color: var(--white);
    font-size: 32px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.adjust-btn:hover {
    background: var(--accent-dark);
    transform: scale(1.05);
}

.adjust-btn:active {
    transform: scale(0.95);
}

.adjust-quantity-display {
    font-size: 48px;
    font-weight: 900;
    color: var(--fg-1);
    min-width: 100px;
    text-align: center;
}

/* Section Titles in Modals */
.adjust-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--fg-1);
    margin-bottom: 16px;
}

/* New Stock Preview */
.new-stock-preview {
    background: var(--ok-tint);
    padding: 16px;
    border-radius: var(--r-md);
    text-align: center;
}

.new-stock-preview-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ok);
    margin-bottom: 6px;
}

.new-stock-preview-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--ok);
}

/* ===== DRAWER STYLE (Bottom Sheet) ===== */

.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-1);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: var(--z-drawer);
    max-height: 80vh;
    overflow-y: auto;
}

.drawer.open {
    transform: translateY(0);
}

.drawer-header {
    padding: 32px;
    text-align: center;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface-1);
    z-index: 1;
}

.drawer-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--fg-1);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.drawer-body {
    padding: 32px;
}

.close-drawer {
    width: 56px;
    height: 56px;
    border-radius: var(--r-pill);
    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);
}

/* ===== CLOSE BUTTON (top right X) ===== */

/* ===== MODAL ANIMATIONS ===== */
/* Portado de css/v4/animations.css (hoja huérfana, borrada en 4.4) — .modal-backdrop invoca esta animación en la línea 18. */
@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
}
