/* assets/promo-modal.css */

/* ---------------------------------------------------------------- */
/* BASE MODAL (Encapsulado con prefijo wc-promo-) */
/* ---------------------------------------------------------------- */

.wc-promo-modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1050; 
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wc-promo-modal-overlay.active {
    display: block;
    opacity: 1;
}

.wc-promo-modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    border-radius: 0.5rem;
    position: relative;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.wc-promo-modal-overlay.active .wc-promo-modal-content {
    transform: translateY(0);
}

.wc-promo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.wc-promo-modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 1.5rem;
    color: #333;
}

.wc-promo-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    color: #000;
}

.wc-promo-modal-body {
    padding: 1rem;
}

.wc-promo-modal-body-center {
    text-align: center;
}

.wc-promo-modal-footer {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

/* ---------------------------------------------------------------- */
/* BOTONES Y SPINNER BASE (Reemplazo de clases de Bootstrap) */
/* ---------------------------------------------------------------- */

.wc-promo-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.3rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    display: inline-block;
    border: 1px solid transparent;
    margin: 0 0.5rem;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.wc-promo-btn-success {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.wc-promo-btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

.wc-promo-btn-secondary {
    color: #6c757d;
    background-color: #fff;
    border-color: #6c757d;
}

.wc-promo-btn-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Spinner CSS Simple */
.wc-promo-spinner-container {
    text-align: center;
}

.wc-promo-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -0.125em;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: wc-promo-spinner-spin 0.75s linear infinite;
    color: #0d6efd; /* Color primario */
}

@keyframes wc-promo-spinner-spin {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------- */
/* DETALLE DE PRODUCTO (Encapsulado sin grid de Bootstrap) */
/* ---------------------------------------------------------------- */

.wc-promo-detail-layout {
    display: flex;
    flex-wrap: wrap; 
    gap: 1.5rem; 
}

.wc-promo-detail-image {
    flex: 0 0 40%; 
    max-width: 40%;
    text-align: center;
}

.wc-promo-product-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.wc-promo-detail-info {
    flex: 0 0 55%; 
    max-width: 55%;
}

.wc-promo-detail-title {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.wc-promo-detail-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff; /* Color primario */
    margin-bottom: 1rem;
}

.wc-promo-detail-list {
    list-style: none;
    padding-left: 0;
}

/* Responsive para dispositivos pequeños */
@media (max-width: 768px) {
    .wc-promo-detail-layout {
        flex-direction: column; 
    }
    
    .wc-promo-detail-image,
    .wc-promo-detail-info {
        flex: 1 1 100%; 
        max-width: 100%;
    }
    .wc-promo-detail-image {
        order: -1; /* Mover la imagen arriba en vista móvil */
    }
}


/* ---------------------------------------------------------------- */
/* ESTILOS DE DARK MODE PARA MODALES (Encapsulado) */
/* ---------------------------------------------------------------- */

body.wc-promo-dark-modal-active .wc-promo-modal-content {
    background-color: #212529; 
    border-color: #343a40 !important;
}

body.wc-promo-dark-modal-active .wc-promo-modal-title,
body.wc-promo-dark-modal-active .wc-promo-modal-body,
body.wc-promo-dark-modal-active .wc-promo-detail-price {
    color: #f8f9fa;
}

body.wc-promo-dark-modal-active .wc-promo-modal-close {
    color: #f8f9fa;
}

body.wc-promo-dark-modal-active .wc-promo-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.wc-promo-dark-modal-active .wc-promo-modal-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Estilos de confirmación Dark Mode */
.wc-promo-modal-confirm {
    border: 4px solid #198754; 
}
.wc-promo-success-header {
    background-color: #198754;
    color: #fff;
}
.wc-promo-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.wc-promo-dark-modal-active .wc-promo-modal-confirm {
    border-color: #75b798;
}
body.wc-promo-dark-modal-active .wc-promo-success-header {
    background-color: #0f5132 !important; 
}

body.wc-promo-dark-modal-active .wc-promo-btn-secondary {
    color: #adb5bd;
    border-color: #adb5bd;
    background-color: transparent;
}
body.wc-promo-dark-modal-active .wc-promo-btn-secondary:hover {
    background-color: #adb5bd;
    color: #1a1a1a;
}