/**
 * Estilos del Sistema de Promociones - Cárnicas Vallesol
 * Colores: Marrón oscuro (#2C1810), Dorado (#C5A572), Rojo (#8B0000)
 * 
 * @package Cárnicas Vallesol
 * @since 2.0
 */

/* ==========================================================================
   Variables CSS - Usando colores del theme
   ========================================================================== */
:root {
    --cv-promo-primario: #8B0000;
    --cv-promo-dorado: #C5A572;
    --cv-promo-oscuro: #5C0000;
    --cv-promo-claro: #FDF8F3;
    --cv-promo-blanco: #ffffff;
    --cv-promo-texto: #333333;
    --cv-promo-shadow: 0 4px 20px rgba(92, 0, 0, 0.15);
    --cv-promo-shadow-hover: 0 8px 30px rgba(92, 0, 0, 0.25);
    --cv-promo-radius: 15px;
    --cv-promo-transition: all 0.3s ease;
    --cv-promo-fuente-titulo: 'Playfair Display', serif;
    --cv-promo-fuente-texto: 'Open Sans', sans-serif;
}

/* ==========================================================================
   Botón de Promociones
   ========================================================================== */
.cv-promo-boton {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    font-family: var(--cv-promo-fuente-texto);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--cv-promo-transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.cv-promo-boton:hover {
    transform: translateY(-3px);
    box-shadow: var(--cv-promo-shadow-hover);
}

.cv-promo-boton:active {
    transform: translateY(0);
}

/* Estilos de botón */
.cv-promo-boton--primario {
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro);
}

.cv-promo-boton--primario:hover {
    background: var(--cv-promo-blanco);
    color: var(--cv-promo-oscuro);
}

.cv-promo-boton--secundario {
    background: var(--cv-promo-blanco);
    color: var(--cv-promo-primario);
}

.cv-promo-boton--secundario:hover {
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro);
}

.cv-promo-boton--outline {
    background: transparent;
    border: 2px solid var(--cv-promo-dorado);
    color: var(--cv-promo-dorado);
}

.cv-promo-boton--outline:hover {
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro);
}

/* Tamaños */
.cv-promo-boton--pequeño {
    padding: 10px 20px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.cv-promo-boton--grande {
    padding: 18px 45px;
    font-size: 1rem;
}

/* Badge de notificación */
.cv-promo-boton__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: var(--cv-promo-primario);
    border-radius: 50%;
    border: 2px solid var(--cv-promo-blanco);
}

/* Animación pulse */
.cv-promo-pulse {
    animation: cvPromoPulse 2s infinite;
}

@keyframes cvPromoPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 0, 0, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(139, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 0, 0, 0);
    }
}

/* ==========================================================================
   Modal de Promociones
   ========================================================================== */
.cv-promo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--cv-promo-transition);
}

.cv-promo-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.cv-promo-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(92, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.cv-promo-modal__contenido {
    position: relative;
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    background: var(--cv-promo-blanco);
    border-radius: var(--cv-promo-radius);
    box-shadow: var(--cv-promo-shadow-hover);
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.95);
    transition: var(--cv-promo-transition);
    overflow: hidden;
}

.cv-promo-modal[aria-hidden="false"] .cv-promo-modal__contenido {
    transform: translateY(0) scale(1);
}

.cv-promo-modal__cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--cv-promo-transition);
    z-index: 10;
    color: var(--cv-promo-blanco);
}

.cv-promo-modal__cerrar:hover {
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro);
}

.cv-promo-modal__header {
    padding: 30px 35px;
    background: linear-gradient(135deg, #6B0000 0%, #8B0000 100%);
    color: var(--cv-promo-blanco);
}

.cv-promo-modal__titulo {
    margin: 0;
    font-family: var(--cv-promo-fuente-titulo);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--cv-promo-blanco);
}

.cv-promo-modal__body {
    padding: 25px 35px 35px;
    overflow-y: auto;
    flex: 1;
    background: var(--cv-promo-claro);
}

/* Loading spinner */
.cv-promo-loading {
    text-align: center;
    padding: 50px;
}

.cv-promo-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--cv-promo-claro);
    border-top-color: var(--cv-promo-dorado);
    border-radius: 50%;
    animation: cvPromoSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes cvPromoSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Items del modal */
.cv-promo-modal-item {
    display: flex;
    gap: 20px;
    padding: 25px;
    margin-bottom: 20px;
    background: var(--cv-promo-blanco);
    border-radius: var(--cv-promo-radius);
    border-left: 5px solid var(--cv-promo-color, var(--cv-promo-dorado));
    box-shadow: var(--cv-promo-shadow);
    transition: var(--cv-promo-transition);
}

.cv-promo-modal-item:hover {
    transform: translateX(5px);
    box-shadow: var(--cv-promo-shadow-hover);
}

.cv-promo-modal-item:last-child {
    margin-bottom: 0;
}

.cv-promo-modal-item--destacada {
    border-left-color: var(--cv-promo-primario);
    background: linear-gradient(135deg, #fff 0%, var(--cv-promo-claro) 100%);
    position: relative;
}

.cv-promo-modal-item--destacada::after {
    content: '⭐';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.2rem;
}

.cv-promo-modal-item__imagen {
    flex-shrink: 0;
    width: 130px;
    position: relative;
}

.cv-promo-modal-item__imagen img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
}

.cv-promo-modal-item__badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--cv-promo-primario);
    color: var(--cv-promo-blanco);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.cv-promo-modal-item__info {
    flex: 1;
}

.cv-promo-modal-item__info h3 {
    margin: 0 0 10px;
    font-family: var(--cv-promo-fuente-titulo);
    font-size: 1.3rem;
    color: var(--cv-promo-oscuro);
}

.cv-promo-modal-item__info p {
    margin: 0 0 10px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cv-promo-modal-item__cupon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0 !important;
}

.cv-promo-modal-item__cupon code {
    background: var(--cv-promo-claro);
    border: 2px dashed var(--cv-promo-dorado);
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
    color: var(--cv-promo-oscuro);
    cursor: pointer;
    transition: var(--cv-promo-transition);
}

.cv-promo-modal-item__cupon code:hover {
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro);
}

.cv-promo-copiar-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: var(--cv-promo-transition);
}

.cv-promo-copiar-btn:hover {
    transform: scale(1.2);
}

.cv-promo-modal-item__fecha {
    font-size: 0.85rem !important;
    color: #888 !important;
}

.cv-promo-modal-item__boton {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 25px;
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro) !important;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--cv-promo-transition);
}

.cv-promo-modal-item__boton:hover {
    background: var(--cv-promo-oscuro);
    color: var(--cv-promo-blanco) !important;
    transform: translateX(5px);
}

/* Modal vacío */
.cv-promo-modal-vacio {
    text-align: center;
    padding: 50px;
    background: var(--cv-promo-blanco);
    border-radius: var(--cv-promo-radius);
}

.cv-promo-modal-vacio__icono {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
}

.cv-promo-modal-vacio h3 {
    margin: 0 0 10px;
    font-family: var(--cv-promo-fuente-titulo);
    color: var(--cv-promo-oscuro);
}

.cv-promo-modal-vacio p {
    margin: 0;
    color: #666;
}

/* ==========================================================================
   Lista de Promociones (Shortcode)
   ========================================================================== */
.cv-promo-lista {
    display: grid;
    gap: 30px;
}

.cv-promo-lista--cols-1 { grid-template-columns: 1fr; }
.cv-promo-lista--cols-2 { grid-template-columns: repeat(2, 1fr); }
.cv-promo-lista--cols-3 { grid-template-columns: repeat(3, 1fr); }
.cv-promo-lista--cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .cv-promo-lista--cols-3,
    .cv-promo-lista--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .cv-promo-lista--cols-2,
    .cv-promo-lista--cols-3,
    .cv-promo-lista--cols-4 {
        grid-template-columns: 1fr;
    }
}

/* Card de Promoción */
.cv-promo-card {
    background: var(--cv-promo-blanco);
    border-radius: var(--cv-promo-radius);
    box-shadow: var(--cv-promo-shadow);
    overflow: hidden;
    transition: var(--cv-promo-transition);
}

.cv-promo-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--cv-promo-shadow-hover);
}

.cv-promo-card--destacada {
    border: 3px solid var(--cv-promo-dorado);
    position: relative;
}

.cv-promo-card--destacada::before {
    content: '⭐ DESTACADA';
    position: absolute;
    top: 15px;
    left: -35px;
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro);
    padding: 6px 45px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    transform: rotate(-45deg);
    z-index: 5;
}

.cv-promo-card__imagen {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.cv-promo-card__imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--cv-promo-transition);
}

.cv-promo-card:hover .cv-promo-card__imagen img {
    transform: scale(1.08);
}

.cv-promo-card__descuento {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--cv-promo-primario);
    color: var(--cv-promo-blanco);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 700;
}

.cv-promo-card__contenido {
    padding: 25px;
}

.cv-promo-card__titulo {
    margin: 0 0 12px;
    font-family: var(--cv-promo-fuente-titulo);
    font-size: 1.4rem;
    color: var(--cv-promo-oscuro);
}

.cv-promo-card__descripcion {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 18px;
}

.cv-promo-card__descripcion p {
    margin: 0;
}

.cv-promo-card__cupon {
    background: var(--cv-promo-claro);
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cv-promo-card__cupon-label {
    font-size: 0.85rem;
    color: #666;
}

.cv-promo-card__cupon-codigo {
    background: var(--cv-promo-blanco);
    border: 2px dashed var(--cv-promo-dorado);
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
    color: var(--cv-promo-oscuro);
    cursor: pointer;
    transition: var(--cv-promo-transition);
}

.cv-promo-card__cupon-codigo:hover {
    background: var(--cv-promo-dorado);
    border-color: var(--cv-promo-dorado);
}

.cv-promo-card__fecha {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 18px;
}

.cv-promo-card__boton {
    display: block;
    text-align: center;
    padding: 14px 25px;
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro) !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: var(--cv-promo-transition);
}

.cv-promo-card__boton:hover {
    background: var(--cv-promo-oscuro);
    color: var(--cv-promo-blanco) !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   Banner de Promoción
   ========================================================================== */
.cv-promo-banner {
    display: flex;
    background: var(--cv-promo-blanco);
    border-radius: var(--cv-promo-radius);
    box-shadow: var(--cv-promo-shadow);
    overflow: hidden;
}

.cv-promo-banner--completo {
    min-height: 380px;
}

.cv-promo-banner--compacto {
    min-height: 220px;
}

.cv-promo-banner__imagen {
    flex: 1;
    min-width: 40%;
}

.cv-promo-banner__imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-promo-banner__contenido {
    flex: 1;
    padding: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #6B0000 0%, #8B0000 100%);
    color: var(--cv-promo-blanco);
}

.cv-promo-banner__descuento {
    display: inline-block;
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro);
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    align-self: flex-start;
}

.cv-promo-banner__titulo {
    margin: 0 0 18px;
    font-family: var(--cv-promo-fuente-titulo);
    font-size: 2.2rem;
    color: inherit;
}

.cv-promo-banner__descripcion {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 25px;
    opacity: 0.95;
}

.cv-promo-banner__descripcion p {
    margin: 0;
}

.cv-promo-banner__cupon {
    background: rgba(255,255,255,0.15);
    padding: 14px 22px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: inline-block;
}

.cv-promo-banner__cupon code {
    background: var(--cv-promo-blanco);
    color: var(--cv-promo-oscuro);
    padding: 6px 18px;
    border-radius: 6px;
    margin-left: 12px;
    font-weight: 700;
    font-size: 1.1rem;
}

.cv-promo-banner__fecha {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 25px;
}

.cv-promo-banner__boton {
    display: inline-block;
    padding: 16px 40px;
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro) !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--cv-promo-transition);
    align-self: flex-start;
}

.cv-promo-banner__boton:hover {
    background: var(--cv-promo-blanco);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .cv-promo-banner {
        flex-direction: column;
    }
    
    .cv-promo-banner__imagen {
        height: 220px;
    }
    
    .cv-promo-banner__contenido {
        padding: 30px;
    }
    
    .cv-promo-banner__titulo {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   Barra Superior de Promoción
   ========================================================================== */
.cv-promo-barra {
    position: relative;
    padding: 14px 20px;
    background: linear-gradient(135deg, #6B0000 0%, #8B0000 100%);
    color: var(--cv-promo-blanco);
    text-align: center;
}

.cv-promo-barra__contenido {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.cv-promo-barra__texto {
    font-size: 0.95rem;
}

.cv-promo-barra__texto code {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    color: var(--cv-promo-dorado);
}

.cv-promo-barra__boton {
    display: inline-block;
    padding: 8px 22px;
    background: var(--cv-promo-dorado);
    color: var(--cv-promo-oscuro) !important;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--cv-promo-transition);
}

.cv-promo-barra__boton:hover {
    background: var(--cv-promo-blanco);
    transform: scale(1.05);
}

/* ==========================================================================
   Estados y Utilidades
   ========================================================================== */
.cv-promo-vacio {
    text-align: center;
    padding: 50px;
    background: var(--cv-promo-claro);
    border-radius: var(--cv-promo-radius);
    color: #666;
}

/* Toast de notificación */
.cv-promo-toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--cv-promo-oscuro);
    color: var(--cv-promo-blanco);
    padding: 14px 28px;
    border-radius: 10px;
    box-shadow: var(--cv-promo-shadow-hover);
    z-index: 100000;
    animation: cvPromoSlideIn 0.3s ease;
    font-weight: 500;
}

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

/* Responsive del modal */
@media (max-width: 576px) {
    .cv-promo-modal__contenido {
        width: 95%;
        max-height: 90vh;
    }
    
    .cv-promo-modal__header {
        padding: 20px 25px;
    }
    
    .cv-promo-modal__titulo {
        font-size: 1.5rem;
    }
    
    .cv-promo-modal__body {
        padding: 20px;
    }
    
    .cv-promo-modal-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .cv-promo-modal-item__imagen {
        width: 100%;
    }
    
    .cv-promo-modal-item__imagen img {
        height: 160px;
    }
}
