/* ===== ESTILOS PARA EL DIÁLOGO DE PROMOCIÓN ===== */
/* Diálogo de promoción elegante y moderno */
.promotion-dialog {
    --promotion-panel-border: color-mix(in srgb, var(--theme-accent-primary) 42%, var(--theme-border));
    --promotion-grid-surface: color-mix(in srgb, var(--theme-bg-tertiary) 74%, var(--theme-bg-primary));
    --promotion-card-text: var(--theme-text-primary);
    --promotion-label-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
    display: none;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: var(--theme-modal-bg);
    border: 1px solid var(--promotion-panel-border);
    border-radius: 24px;
    padding: clamp(20px, 3vw, 28px);
    box-sizing: border-box;
    z-index: 10001 !important;
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.8),
        0 0 0 1px color-mix(in srgb, var(--theme-text-primary) 7%, transparent),
        0 0 25px var(--theme-shadow-glow),
        inset 0 1px 0 color-mix(in srgb, var(--theme-text-primary) 12%, transparent);
    pointer-events: auto !important;
    backdrop-filter: blur(16px) saturate(120%);
    animation: promotionDialogFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    width: min(340px, calc(100vw - 48px));
    max-width: 340px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    text-align: center;
    color: var(--theme-text-primary);
    transition: all var(--transition-theme);
}

.promotion-dialog--black {
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.9),
        0 0 0 1px color-mix(in srgb, var(--theme-accent-primary) 14%, transparent),
        0 0 30px var(--theme-shadow-glow),
        inset 0 1px 0 color-mix(in srgb, var(--theme-text-primary) 12%, transparent);
}

.promotion-dialog__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--promotion-panel-border);
    border-radius: 10px;
    background: var(--theme-input-bg);
    color: var(--theme-text-secondary);
    font: 700 1.55rem/1 var(--font-main);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.promotion-dialog__close:hover,
.promotion-dialog__close:focus-visible {
    border-color: var(--theme-accent-primary);
    background: var(--theme-input-bg);
    color: var(--theme-text-primary);
    outline: 2px solid var(--theme-shadow-glow);
    outline-offset: 2px;
}

.promotion-dialog__close:active {
    background: var(--theme-input-bg);
}

.promotion-dialog::before {
    content: "Elige tu promoción";
    display: block;
    color: var(--theme-text-primary);
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: clamp(16px, 2.5vw, 22px);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 12px var(--theme-shadow-glow), 0 2px 4px rgba(0,0,0,0.6);
    transition: color var(--transition-theme);
}

.promotion-dialog::after {
    content: "";
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--theme-accent-primary), var(--theme-text-primary), transparent);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--theme-shadow-glow), 0 0 20px var(--theme-accent-primary);
    transition: all var(--transition-theme);
}

.promotion-dialog--black::after {
    background: linear-gradient(90deg, transparent, var(--theme-accent-primary), var(--theme-accent-secondary), transparent);
    box-shadow: 0 0 10px var(--theme-shadow-glow), 0 0 20px var(--theme-shadow-glow);
}

.promotion-dialog__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 2.5vw, 18px);
    padding: clamp(14px, 2.5vw, 20px);
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    background: var(--promotion-grid-surface);
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--promotion-panel-border) 72%, transparent);
    box-shadow: inset 0 4px 15px color-mix(in srgb, var(--theme-shadow) 72%, transparent);
    transition: all var(--transition-theme);
    position: relative;
}

.promotion-dialog--black .promotion-dialog__grid {
    background: var(--promotion-grid-surface);
    border-color: color-mix(in srgb, var(--promotion-panel-border) 72%, transparent);
    box-shadow: inset 0 4px 20px color-mix(in srgb, var(--theme-shadow) 78%, transparent);
}

.promotion-piece {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    width: 100%;
    min-height: clamp(100px, 20vw, 120px);
    padding: clamp(12px, 2.5vw, 16px);
    box-sizing: border-box;
    border-radius: 14px;
    background: var(--theme-button-bg);
    border: 1px solid var(--promotion-panel-border);
    color: var(--promotion-card-text);
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    cursor: pointer;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 color-mix(in srgb, var(--promotion-card-text) 15%, transparent);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
    overflow: hidden;
}

.promotion-piece::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, var(--theme-accent-primary) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.promotion-piece:hover,
.promotion-piece:focus-visible {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--theme-accent-primary);
    filter: brightness(1.08) saturate(1.04);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.5),
        0 0 20px var(--theme-shadow-glow),
        inset 0 1px 0 color-mix(in srgb, var(--promotion-card-text) 25%, transparent);
}

.promotion-piece:hover::before,
.promotion-piece:focus-visible::before {
    opacity: 0.2;
}

.promotion-dialog--white .promotion-piece {
    --promotion-card-solid: #17201d;
    --promotion-card-text: #fff9ec;
    --promotion-label-shadow: 0 2px 4px rgba(0, 0, 0, 0.82);
    background: var(--silicio-palette-white-bg, linear-gradient(180deg, #26332f 0%, #101714 100%));
    border-color: var(--silicio-palette-white-border, var(--promotion-panel-border));
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.promotion-dialog--black .promotion-piece {
    --promotion-card-solid: #ede4d1;
    --promotion-card-text: #151815;
    --promotion-label-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
    background: var(--silicio-palette-black-bg, linear-gradient(180deg, #f6eedf 0%, #d8ccb6 100%));
    border-color: var(--silicio-palette-black-border, var(--promotion-panel-border));
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.promotion-dialog--white .promotion-piece:hover,
.promotion-dialog--white .promotion-piece:focus-visible,
.promotion-dialog--black .promotion-piece:hover,
.promotion-dialog--black .promotion-piece:focus-visible {
    border-color: var(--theme-accent-primary);
}

.promotion-piece:active {
    transform: translateY(-1px);
    transition: transform 0.12s ease;
}

.promotion-piece__image {
    width: clamp(48px, 14vw, 56px);
    height: clamp(48px, 14vw, 56px);
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.promotion-dialog--white .promotion-piece__image {
    filter:
        drop-shadow(0 5px 9px rgba(0, 0, 0, 0.78))
        drop-shadow(0 0 1px rgba(255, 255, 255, 0.34));
}

.promotion-piece:hover .promotion-piece__image,
.promotion-piece:focus-visible .promotion-piece__image {
    transform: scale(1.1) translateY(-2px);
    filter:
        drop-shadow(0 10px 20px rgba(0,0,0,0.7)) 
        drop-shadow(0 0 15px var(--theme-shadow-glow));
}

.promotion-dialog--black .promotion-piece__image {
    filter:
        drop-shadow(0 4px 7px rgba(0, 0, 0, 0.42))
        drop-shadow(0 0 1px rgba(255, 255, 255, 0.82));
}

.promotion-dialog--black .promotion-piece:hover .promotion-piece__image,
.promotion-dialog--black .promotion-piece:focus-visible .promotion-piece__image {
    filter:
        drop-shadow(0 7px 12px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 3px rgba(255, 255, 255, 0.9));
}

.promotion-piece__label {
    margin-top: 10px;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    color: var(--promotion-card-text);
    text-shadow: var(--promotion-label-shadow);
    transition: all var(--transition-theme);
    position: relative;
    z-index: 1;
}

/* Animación de entrada del diálogo */
@keyframes promotionDialogFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.promotion-piece::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
    transition: none;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}

.promotion-piece:hover::after,
.promotion-piece:focus-visible::after {
    animation: shine 0.7s ease forwards;
}

@keyframes shine {
    0% { left: -100%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 200%; opacity: 0; }
}

@media only screen and (max-width: 767px) {
    .promotion-dialog {
        width: min(88vw, 300px) !important;
        max-width: 300px;
        padding: clamp(16px, 4vw, 20px) !important;
        border-radius: 18px !important;
    }

    .promotion-dialog::before {
        font-size: 0.95rem !important;
        margin-bottom: clamp(12px, 3vw, 16px) !important;
    }

    .promotion-dialog::after {
        top: 50px;
        width: 72px;
    }

    .promotion-dialog__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(10px, 3vw, 14px) !important;
        padding: clamp(10px, 3vw, 14px) !important;
    }

    .promotion-piece {
        min-height: clamp(92px, 22vw, 110px);
    }

    .promotion-piece__image {
        width: clamp(38px, 15vw, 48px);
        height: clamp(38px, 15vw, 48px);
    }
}

@media only screen and (max-width: 480px) {
    .promotion-dialog {
        width: min(94vw, 260px) !important;
        max-width: 260px;
        padding: clamp(14px, 5vw, 18px) !important;
    }

    .promotion-dialog__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(8px, 4vw, 12px) !important;
        padding: clamp(8px, 4vw, 12px) !important;
    }

    .promotion-piece {
        min-height: clamp(88px, 26vw, 102px);
        padding: 9px 8px;
    }

    .promotion-piece__image {
        width: clamp(34px, 18vw, 44px);
        height: clamp(34px, 18vw, 44px);
    }

    .promotion-piece__label {
        font-size: 0.66rem;
        letter-spacing: 1.2px;
    }

    .promotion-dialog__close {
        top: 7px;
        right: 7px;
        width: 36px;
        height: 36px;
    }
}

@media only screen and (max-width: 360px) {
    .promotion-dialog {
        width: min(300px, calc(100vw - 24px)) !important;
        padding: clamp(12px, 5vw, 16px) !important;
    }

    .promotion-dialog__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(8px, 4.5vw, 12px) !important;
        padding: clamp(8px, 4.5vw, 12px) !important;
    }

    .promotion-piece {
        min-height: clamp(84px, 32vw, 104px);
    }
}

/* ===== MÓVILES HORIZONTALES ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .promotion-dialog {
        width: min(260px, calc(100vw - 32px)) !important;
        max-width: 260px !important;
        padding: clamp(12px, 2vw, 16px) !important;
    }

    .promotion-dialog::before {
        font-size: 0.85rem !important;
        margin-bottom: clamp(10px, 1.5vw, 14px) !important;
    }

    .promotion-dialog__grid {
        gap: clamp(8px, 1.8vw, 12px) !important;
        padding: clamp(10px, 1.8vw, 14px) !important;
    }

    .promotion-piece {
        min-height: clamp(80px, 16vw, 96px) !important;
        padding: clamp(8px, 1.6vw, 10px) !important;
    }

    .promotion-piece__image {
        width: clamp(36px, 11vw, 44px) !important;
        height: clamp(36px, 11vw, 44px) !important;
    }

    .promotion-piece__label {
        font-size: 0.65rem !important;
        letter-spacing: 1.2px !important;
    }
}
