/* ═══════════════════════════════════════════════════════════════════════════
   MODAL STYLES - Calendario Avvento COOP 2025
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 1: STILI BASE MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-content {
    border-radius: 0;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 0;
    background: transparent;
    position: relative; /* Necessario per il posizionamento assoluto delle frecce carousel */
}

/* Modal fondo - conteneur principal pour header et body */
.modal-fondo {
    position: relative;
    background: white;
    border-radius: 0;
}

.modal-header {
    background: transparent;
    color: white;
    border-radius: 0;
    border: none;
    padding: 0.3rem 0.3rem 0.3rem;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-title {
    font-weight: 600;
}

/* Override Bootstrap close button */
.btn-close {
    filter: none !important;
    background-image: none !important;
    background: #87CEEB !important;
    color: white !important;
    border: none !important;
    border-radius: 0 !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
}

.btn-close:hover {
    background: #6BB6FF !important;
    color: white !important;
    transform: scale(1.1) !important;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    background-color: white;
    border-top: 1px solid #e9ecef;
    padding: 1rem;
    border-radius: 0;
}

/* Giorno 15: il contenitore media occupa la stessa altezza del modal body */
.modal-content.day-15 .modal-body {
    position: relative;
    min-height: clamp(320px, 60vh, 720px);
}

.modal-content.day-15 .offer-media {
    width: 100%;
    height: 450px; /* altezza fissa richiesta */
    min-height: 450px;
    position: relative; /* per posizionare il link all'interno */
}

/* Posizionamento del testo "Clicca qui!" nel giorno 15 */
.modal-content.day-15 .offer-link-red {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 50%; /* mobile: circa metà */
}

/* Dès que la largeur dépasse 393px, on commence à descendre progressivement */
@media (min-width: 394px) {
  .modal-content.day-15 .offer-link-red { top: 55%; }
}
@media (min-width: 480px) {
  .modal-content.day-15 .offer-link-red { top: 60%; }
}
@media (min-width: 768px) {
  .modal-content.day-15 .offer-link-red { top: 70%; }
}
@media (min-width: 992px) {
  .modal-content.day-15 .offer-link-red { top: 75%; } /* ~3/4 sur desktop */
}

/* Paysage (téléphone à l'horizontale): descendre davantage pour éviter chevauchement */
@media (orientation: landscape) and (max-height: 420px) {
  .modal-content.day-15 .offer-link-red { top: 82%; }
}
@media (orientation: landscape) and (max-height: 360px) {
  .modal-content.day-15 .offer-link-red { top: 85%; }
}

/* Frecce carousel per giorni 4 e 19 */
.carousel-arrow {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    background: rgba(135, 206, 235, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 0;
}
@media (max-height: 400px) {
  .carousel-arrow {
    top: 50%;
  }
}

.carousel-arrow:hover {
    background: rgba(107, 182, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-arrow[style*="pointer-events: none"] {
    opacity: 0.3;
    cursor: not-allowed;
}








.day-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.day-case-image {
    width: 50px;
    height: 108px;
    border-radius: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
}

.day-number-modal {
    font-size: 1.7rem;
    font-weight: 700;
    color: #ffffff;
    background: #87CEEB;
    width: 50px;
    height: 50px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-close {
    background: #87CEEB !important; /* Azzurro chiaro */
    color: white !important; /* Croce bianca */
    border: none !important;
    border-radius: 0 !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
}

.custom-close:hover {
    background: #6BB6FF !important; /* Azzurro più scuro */
    color: white !important; /* Croce bianca al hover */
    transform: scale(1.1) !important;
}



/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 2: PULSANTI E CONTROLLI MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

/* Pulsanti di azione */
.btn-download {
    background: #87CEEB !important; /* Azzurro chiaro */
    color: white !important;
    border: none !important;
    border-radius: 0 !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
}

.btn-download:hover {
    background: #6BB6FF !important; /* Azzurro più scuro */
    transform: translateY(-2px) scale(1.1) !important;
    box-shadow: 0 5px 15px rgba(135, 206, 235, 0.3) !important;
}

.btn-share {
    background: #87CEEB !important; /* Azzurro chiaro */
    color: white !important;
    border: none !important;
    border-radius: 0 !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    transition: all 0.3s ease !important;
}

.btn-share:hover {
    background: #6BB6FF !important; /* Azzurro più scuro */
    transform: translateY(-2px) scale(1.1) !important;
    box-shadow: 0 5px 15px rgba(135, 206, 235, 0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 3: CONTENUTI MULTIMEDIALI
   ═══════════════════════════════════════════════════════════════════════════ */

/* Stili per contenuti multimediali */
.offer-image {
    width: 100%;
    max-width: 820px;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.offer-video {
    width: 100%;
    max-width: 820px;
    height: auto;
    border-radius: 0;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.offer-audio {
    width: 100%;
    max-width: 820px;
    height: auto;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 0;
}

.offer-gif {
    width: 100%;
    max-width: 820px;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.offer-iframe {
    width: 100%;
    max-width: 820px;
    height: auto;
    border-radius: 0;
    margin: 0 auto 1rem;
    display: block;
}

/* Player Spotify */
.spotify-player {
    background: #1db954;
    border-radius: 0;
    padding-top: 2rem;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(29, 185, 84, 0.3);
    width: 400px;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spotify-embed {
    border-radius: 0;
    margin-bottom: 1rem;
    width: 100%;
    height: 300px;
}

.spotify-info {
    text-align: center;
    color: white;
}

.spotify-info h5 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.spotify-info p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 4: ELEMENTI INFORMAZIONE OFFERTE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Titolo contenuto */
.content-title {
    color: #dc2626;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    margin: 1rem 0 0.5rem;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Badge ricompensa */
.reward-badge {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
    animation: rewardPulse 2s ease-in-out infinite;
}

.reward-badge h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.reward-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.reward-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 5: ANIMAZIONI
   ═══════════════════════════════════════════════════════════════════════════ */

/* Animazioni per badge e contenuti */
@keyframes rewardPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes rewardEntrance {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 6: STILI RESPONSIVE PER MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

/* Layout responsive per modal */
@media (max-width: 768px) {
    
    
    .offer-image,
    .offer-video,
    .offer-gif,
    .offer-iframe,
    .offer-audio {
        width: 250px;
        height: 250px;
    }
    
    .spotify-player {
        width: 250px;
        height: 250px;
    }
    
    .spotify-embed {
        height: 180px;
    }
    
    /* Video e Spotify nel modal body per mobile */
    .modal-body .offer-video {
        max-width: 100%;
        max-height: 280px; /* Augmenté pour ratio 16:9 */
        aspect-ratio: 16/9; /* Garde le ratio */
    }
    
    .modal-body .spotify-player {
        width: 100%; /* Largeur maximale sur mobile */
        max-width: 100%;
        min-height: 300px;
        padding: 0.5rem;
        margin: 0;
    }
    
    .modal-body .spotify-embed {
        height: 400px; /* Augmenté pour mobile */
    }
    
    .content-title {
        font-size: 0.9rem;
        margin: 0.3rem 0 0.2rem;
        letter-spacing: 0.3px;
    }
    
    .reward-badge h3 {
        font-size: 1.2rem;
    }
    
    .reward-name {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 7: MODAL CONDIVISIONE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Stili per modal di condivisione */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.share-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-content {
    background-image: url('../images/calendar/base popup.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 15px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.share-content h4 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    position: relative;
    z-index: 2;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.share-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer !important;
    transition: all 0.3s ease;  
}

.share-btn:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-2px);
}

.share-close {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1rem;   
    cursor: pointer !important;
    transition: all 0.3s ease;
}

.share-close:hover {
    background: #5a6268;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 8: STILI OFFERTE PRODOTTO
   ═══════════════════════════════════════════════════════════════════════════ */

/* Stili per offerte prodotto */
.offer-popup-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.offer-header {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.offer-title {
    color: #8B0000;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.offer-date {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 600;
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    display: inline-block;
}

.offer-details {
    margin-bottom: 1.5rem;
}

.offer-type {
    text-align: center;
    margin-bottom: 1rem;
}

.type-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.sconto {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.type-badge.prodotto {
    background: linear-gradient(135deg, #007bff, #6610f2);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.type-badge.video {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.type-badge.playlist {
    background: linear-gradient(135deg, #1db954, #17a2b8);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}

.offer-description h4 {
    color: #495057;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.offer-description p {
    color: #6c757d;
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
}

.offer-ean {
    background: #d1ecf1;
    border: 2px solid #17a2b8;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.ean-label {
    color: #0c5460;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ean-code {
    color: #0c5460;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #17a2b8;
    word-break: break-all;
    font-weight: 600;
}

.ean-barcode {
    margin-top: 1rem;
    text-align: center;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #17a2b8;
}

.ean-barcode-image {
    max-width: 200px;
    max-height: 60px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.offer-instructions {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 1.2rem;
    margin-top: 1.5rem;
}

.offer-instructions h5 {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.8rem 0;
    text-align: center;
}

.offer-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.offer-instructions li {
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid #e9ecef;
}

.offer-instructions li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.offer-media {
    margin: 0;
    text-align: center;
}

/* Exception : remove margin pour jours avec media */
.modal-content.day-14 .offer-media,
.modal-content.day-15 .offer-media,
.modal-content.day-16 .offer-media {
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STILI PER VIDEO E SPOTIFY DENTRO MODAL (giorni 14, 15, 16)
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-body .offer-video {
    width: 100%;
    max-width: 100%; /* Prend toute la largeur du modal */
    height: auto;
    aspect-ratio: 16/9; /* Ratio 1920x1080 (16:9) */
    max-height: 450px; /* Augmenté pour accommoder le ratio 16:9 */
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: block;
    object-fit: contain; /* Garde le ratio d'aspect */
}

.modal-body .spotify-player {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 350px;
    margin: 0;
    padding: 0.5rem; /* Petit padding interne minimal */
    box-shadow: 0 8px 25px rgba(29, 185, 84, 0.3);
}

.modal-body .spotify-embed {
    width: 100%;
    max-width: 100%;
    height: 480px; /* Augmenté pour correspondre à la largeur maximisée */
    border-radius: 12px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 9: STILI SPECIFICI PER GIORNO (1-24)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Configurazioni dimensione modal - comune a tutti i giorni (1-24) */
.modal.show .modal-dialog.modal-dialog-centered {
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.modal-content[class*="day-"] {
    width: 96vw;
    max-width: 1100px;
    height: auto;
    max-height: 95vh;
    margin: 2vh auto;
}

@media (min-width: 1200px) {
    .modal-content[class*="day-"] {
        max-width: 1200px;
    }
}

/* Stili comuni per tutti i modal-fondo */
.modal-content[class*="day-"] .modal-fondo {
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
    border-radius: 0;
    overflow: hidden;
    margin: auto;
    position: relative;
    width: 100%;
    height: auto;
    min-height: 70vh;
    max-height: none;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

/* Corpo del modal scrollabile per contenuti lunghi */
.modal-content[class*="day-"] .modal-body {
    flex: 0 1 auto;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

/* Bootstrap-style carousel wrapper pour giorni 4 e 19 */
.modal-content[class*="day-"] .modal-fondo .carousel-slide-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.modal-content[class*="day-"] .modal-fondo .carousel-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
    will-change: transform;
}

.modal-content[class*="day-"] .modal-fondo .carousel-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
    position: relative;
}

/* Assicura che header e body siano sopra i slides */
.modal-content[class*="day-"] .modal-fondo .modal-header,
.modal-content[class*="day-"] .modal-fondo .modal-body {
    position: relative;
    z-index: 1;
}

/* Immagini di sfondo specifiche per ogni giorno */
.modal-content.day-1 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_01.jpg');
}

.modal-content.day-1 .modal-body {
    height: auto;
    max-height: 60vh;  /* Altezza massima del body */
    overflow: hidden;
    padding: 1rem;
}

/* Immagini di sfondo per ogni giorno */
.modal-content.day-2 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_02.jpg');
}

.modal-content.day-3 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_03.jpg');
}

.modal-content.day-4 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_04.jpg');
}

.modal-content.day-5 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_05.jpg');
}

.modal-content.day-6 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_06.jpg');
}

.modal-content.day-7 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_07.jpg');
}

.modal-content.day-8 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_08.jpg');
}

.modal-content.day-9 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_09.jpg');
}

.modal-content.day-10 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_10.jpg');
}

.modal-content.day-11 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_11.jpg');
}

.modal-content.day-12 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_12.jpg');
}

.modal-content.day-13 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_13.jpg');
}

.modal-content.day-14 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_14.jpg');
}

/* Exception : overflow visible SEULEMENT pour le modal-body (pas pour modal-fondo) */
.modal-content.day-14 .modal-body,
.modal-content.day-15 .modal-body,
.modal-content.day-16 .modal-body {
    height: auto;
    min-height: 600px;
    overflow: visible;
    padding: 3rem 0.25rem 1rem !important; /* Plus de padding vers le haut, padding horizontal minimal */
}

/* Pour les jours avec media (14, 15, 16) : le modal-fondo doit s'adapter au contenu sans limite de hauteur */
.modal-content.day-14 .modal-fondo,
.modal-content.day-15 .modal-fondo,
.modal-content.day-16 .modal-fondo {
    height: auto !important; /* S'adapte au contenu */
    max-height: none !important; /* Pas de limite de hauteur */
    overflow: visible !important; /* Permet de voir tout le contenu */
    background-position: center top !important; /* Position fixée en haut pour éviter le décalage */
    background-size: contain !important; /* Garde la taille adaptée */
    pointer-events: none !important; /* Permet les clics à travers pour les enfants */
}

/* Les éléments enfants doivent pouvoir recevoir les clics */
.modal-content.day-14 .modal-fondo > *,
.modal-content.day-15 .modal-fondo > *,
.modal-content.day-16 .modal-fondo > * {
    pointer-events: auto !important;
}

/* Pour les jours avec media (14, 15, 16) : le modal-content lui-même ne doit pas limiter la hauteur */
.modal-content.day-14,
.modal-content.day-15,
.modal-content.day-16 {
    max-height: none !important; /* Pas de limite de hauteur sur le modal-content */
}

/* Le modal-footer pour les jours avec media ne doit pas être fixé */
.modal-content.day-14 .modal-footer,
.modal-content.day-15 .modal-footer,
.modal-content.day-16 .modal-footer {
    position: relative !important; /* Non fixé pour qu'il suive le contenu */
}

/* Pour les jours 14, 15, 16 : rendre le modal scrollable en mode paysage */
@media (max-height: 700px) and (orientation: landscape) {
    /* Le modal-dialog doit permettre le scroll */
    .modal-dialog {
        max-height: 100vh;
        display: flex;
        align-items: flex-start; /* Alignement en haut pour meilleur scroll */
        margin: 0.5rem auto;
    }
    
    .modal-content {
        max-height: 100vh;
        overflow-y: auto; /* Permet de scroller dans le modal */
        overflow-x: hidden;
        margin: 0;
    }
    
    /* Modal-fondo doit s'adapter au contenu pour les jours avec media */
    .modal-content.day-14 .modal-fondo,
    .modal-content.day-15 .modal-fondo,
    .modal-content.day-16 .modal-fondo {
        height: auto !important; /* S'adapte au contenu */
        min-height: auto !important;
        max-height: none !important; /* Pas de limite de hauteur */
        padding: 1.5rem 0.5rem !important; /* Réduire le padding horizontal */
        overflow: visible !important;
    }
    
    .modal-content.day-14 .modal-body,
    .modal-content.day-15 .modal-body,
    .modal-content.day-16 .modal-body {
        overflow: visible !important;
        padding: 0.5rem !important; /* Réduire le padding */
    }
    
    /* Le footer ne doit pas être fixé pour permettre le scroll */
    .modal-content.day-14 .modal-footer,
    .modal-content.day-15 .modal-footer,
    .modal-content.day-16 .modal-footer {
        position: relative;
    }
}

/* Pour les écrans plus larges en mode paysage */
@media (min-width: 600px) and (max-height: 700px) and (orientation: landscape) {
    .modal-content.day-14 .modal-fondo,
    .modal-content.day-15 .modal-fondo,
    .modal-content.day-16 .modal-fondo {
        padding: 1.5rem 1rem !important; /* Plus de padding sur écrans plus larges */
    }
}

.modal-content.day-15 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_15.jpg');
}

.modal-content.day-16 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_16.jpg');
}

.modal-content.day-17 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_17.jpg');
}

.modal-content.day-18 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_18.jpg');
}

.modal-content.day-19 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_19.jpg');
}

.modal-content.day-20 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_20.jpg');
}

.modal-content.day-21 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_21.jpg');
}

.modal-content.day-22 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_22.jpg');
}

.modal-content.day-23 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_23.jpg');
}

.modal-content.day-24 .modal-fondo {
    background-image: url('../images/offers/popup giorni_Pagina_24.jpg');
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 10: ALTRI STILI MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

/* Note: Stili per giorni scaduti (.calendar-day.expired) sono in grid.css */

/* ═══════════════════════════════════════════════════════════════════════════
   SEZIONE 11: REGOLE RESPONSIVE GIORNI SPECIFICI
   ═══════════════════════════════════════════════════════════════════════════ */

/* Adattamenti responsive per gli stili dei giorni (applica a tutti i giorni) */
@media (max-width: 768px) {
    .offer-image,
    .offer-video,
    .offer-gif,
    .offer-iframe {
        max-width: 92vw;
        max-height: 45vh;
    }

    .modal.show .modal-dialog.modal-dialog-centered {
        min-height: 100vh;
        align-items: stretch;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
    }
    .modal-content[class*="day-"] {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        margin: 0 auto;
        border-radius: 0;
    }
    
    .modal-content[class*="day-"] .modal-fondo {
        flex: 1 1 auto;
        max-height: 100%;
        height: 100%;
        background-size: contain;
        display: flex;
        flex-direction: column;
    }
    
    .modal-content[class*="day-"] .modal-body {
        flex: 1 1 auto;
        max-height: 100%;
        overflow-y: auto;
    }
    
    /* Exception pour les jours avec media (14, 15, 16) */
    .modal-content.day-14 .modal-body,
    .modal-content.day-15 .modal-body,
    .modal-content.day-16 .modal-body {
        min-height: 500px; /* Hauteur minimale pour mobile */
        max-height: none !important; /* Pas de limite de hauteur */
        overflow: visible !important;
    }
}

@media (max-width: 480px) {
    .modal-content[class*="day-"] {
        width: 100vw;
        max-width: 100vw;
        margin: 0 auto;
        height: 100vh;
        max-height: 100vh;
    }
    
    .modal-content[class*="day-"] .modal-fondo {
        max-height: 100%;
        background-size: contain;
    }
    
    .modal-content[class*="day-"] .modal-body {
        flex: 1 1 auto;
        max-height: 100%;
        overflow-y: auto;
    }
    
    /* Exception pour les jours avec media (14, 15, 16) */
    .modal-content.day-14 .modal-body,
    .modal-content.day-15 .modal-body,
    .modal-content.day-16 .modal-body {
        min-height: 450px; /* Hauteur minimale pour petits écrans */
        max-height: none !important; /* Pas de limite de hauteur */
        overflow: visible !important;
    }
    
    /* Correction de la position de l'image de fond pour le jour 15 en responsive */
    .modal-content.day-15 .modal-fondo {
        background-position: center top !important;
        padding: 0.5rem !important; /* Réduire le padding pour mieux positionner l'image */
    }
}

/* Adattamenti responsive per stili nuovi */
@media (max-width: 768px) {
    .offer-popup-content {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .offer-title {
        font-size: 1.4rem;
    }
    
    .offer-description h4 {
        font-size: 1.1rem;
    }
    
    .offer-description p {
        font-size: 0.9rem;
    }
    
    .type-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .ean-code {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    
    .offer-instructions {
        padding: 1rem;
    }
    
    .offer-instructions h5 {
        font-size: 1rem;
    }
    
    .offer-instructions li {
        font-size: 0.85rem;
    }
}

.footer-info a {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  cursor: pointer;
}
.footer-info a:hover,
.footer-info a:focus {
  text-decoration: underline dashed;
}
.footer-info a.btn-participa-calendario,
.footer-info a.btn-participa-calendario:hover,
.footer-info a.btn-participa-calendario:focus {
  text-decoration: none !important;
  text-underline-offset: 0 !important;
  text-decoration-line: none !important;
  text-decoration-style: none !important;
}

/* Link rosso per la playlist (giorno 15) */
.offer-link-red {
  color: #d00;
  font-weight: 700;
  text-decoration: underline;
  font-size: 1.15rem;
}
.offer-link-red:hover,
.offer-link-red:focus {
  color: #a00;
  text-decoration: underline;
}

/* Wrapper responsive 16:9 per YouTube (giorni 14 e 16) */
.youtube-wrapper {
  position: relative;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16/9;
}
.youtube-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Spaziatura verticale per il link del giorno 15 */
.modal-content.day-15 .offer-link-red {
  display: inline-block;
  margin-top: clamp(16px, 8vh, 450px);
}
