/* ==========================================================================
   QUÍMICA BOSS - Decoración Mes Patrio (Septiembre - Fiestas Patrias)
   Colores Oficiales: Verde (#006847), Blanco (#FFFFFF), Rojo (#CE1126), Oro (#D4AF37)
   ========================================================================== */

:root {
    --patrio-verde: #006847;
    --patrio-verde-glow: rgba(0, 104, 71, 0.45);
    --patrio-blanco: #ffffff;
    --patrio-rojo: #ce1126;
    --patrio-rojo-glow: rgba(206, 17, 38, 0.45);
    --patrio-oro: #d4af37;
    --patrio-oro-glow: rgba(212, 175, 55, 0.5);
    --patrio-amarillo: #f59e0b;
}

/* ── 1. Listón Tricolor en Barra Superior / Navbar ───────────────────────── */
.navbar::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 5px !important;
    background: linear-gradient(90deg, 
        #006847 0%, #006847 33.33%, 
        #ffffff 33.33%, #ffffff 66.66%, 
        #ce1126 66.66%, #ce1126 100%
    ) !important;
    z-index: 1200 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}



/* ── 3. Guirnalda de Papel Picado (Recuadro en Blanco) ─────────────────── */
#patrio-garland-container {
    position: relative;
    width: 100%;
    background: #ffffff;
    height: 105px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1020;
    pointer-events: none;
    transition: all 0.3s ease;
}

#patrio-garland-container.hidden {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.patrio-garland-string {
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(90deg, #d4af37, #d4af37 12px, #b8860b 12px, #b8860b 24px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    position: relative;
}

.patrio-flags-track {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 0 8px;
    position: relative;
    top: -1px;
}

.patrio-flag {
    width: 62px;
    height: 78px;
    transform-origin: top center;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.22));
    transition: transform 0.3s ease;
}

/* Authentic Mexican breeze swaying animation */
@keyframes patrioSwayA {
    0% { transform: rotate(-3.5deg) skewX(-1.5deg); }
    50% { transform: rotate(1.5deg) skewX(0.5deg); }
    100% { transform: rotate(3.5deg) skewX(2deg); }
}

@keyframes patrioSwayB {
    0% { transform: rotate(3deg) skewX(1deg); }
    50% { transform: rotate(-1deg) skewX(-0.5deg); }
    100% { transform: rotate(-4deg) skewX(-2deg); }
}

.patrio-flag:nth-child(odd) {
    animation: patrioSwayA 3.4s ease-in-out infinite alternate;
}

.patrio-flag:nth-child(even) {
    animation: patrioSwayB 2.9s ease-in-out infinite alternate-reverse;
}

.patrio-flag:nth-child(3n) {
    animation-duration: 3.8s;
}

.patrio-flag:nth-child(4n) {
    animation-duration: 2.6s;
}

@media (max-width: 768px) {
    #patrio-garland-container {
        height: 82px;
    }
    .patrio-flag {
        width: 44px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    #patrio-garland-container {
        height: 70px;
    }
    .patrio-flag {
        width: 36px;
        height: 46px;
    }
}

/* ── 4. Confeti y Chispas Patrias (Tricolor Confetti) ───────────────────── */
#patrio-confetti-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99998;
    overflow: hidden;
}

.patrio-particle {
    position: absolute;
    top: -30px;
    pointer-events: none;
    will-change: transform, opacity;
    animation-name: patrioFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes patrioFall {
    0% {
        transform: translateY(0) rotate(0deg) rotateY(0deg);
        opacity: 0.95;
    }
    80% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(105vh) rotate(540deg) rotateY(360deg);
        opacity: 0;
    }
}

/* ── 5. Modal de Bienvenida Patrio (Celebration Popup) ───────────────────── */
#patrio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 20, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    animation: patrioFadeIn 0.4s ease forwards;
}

@keyframes patrioFadeIn {
    to { opacity: 1; }
}

@keyframes patrioFadeOut {
    to { opacity: 0; pointer-events: none; }
}

.patrio-modal-card {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    max-width: 520px;
    width: 100%;
    padding: 40px 32px 32px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 40px rgba(0, 104, 71, 0.15);
    border: 2px solid rgba(212, 175, 55, 0.5);
    transform: translateY(30px) scale(0.94);
    animation: patrioModalPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

@keyframes patrioModalPop {
    to {
        transform: translateY(0) scale(1);
    }
}

/* Tricolor Top Accent Line inside Modal */
.patrio-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, 
        #006847 0%, #006847 33.33%, 
        #ffffff 33.33%, #ffffff 66.66%, 
        #ce1126 66.66%, #ce1126 100%
    );
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.patrio-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.patrio-modal-close:hover {
    background: #ce1126;
    color: #ffffff;
    transform: rotate(90deg);
}

.patrio-modal-emojis {
    font-size: 2.6rem;
    margin-bottom: 12px;
    line-height: 1;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15));
    letter-spacing: 6px;
}

.patrio-badge-pill {
    display: inline-block;
    background: linear-gradient(135deg, #006847 0%, #008751 100%);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 18px;
    border-radius: 20px;
    margin-bottom: 14px;
    box-shadow: 0 3px 10px rgba(0, 104, 71, 0.3);
}

.patrio-modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 14px 0;
    color: #111827;
    line-height: 1.25;
}

.patrio-modal-title span.patrio-green {
    color: #006847;
}

.patrio-modal-title span.patrio-red {
    color: #ce1126;
}

.patrio-modal-desc {
    color: #4b5563;
    font-size: 0.98rem;
    line-height: 1.65;
    margin: 0 0 26px 0;
}

.patrio-modal-desc strong {
    color: #111827;
}

.patrio-modal-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #006847 0%, #008751 40%, #ce1126 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 14px 38px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(206, 17, 38, 0.35);
    transition: all 0.25s ease;
}

.patrio-modal-cta:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 25px rgba(206, 17, 38, 0.45);
    color: #ffffff;
}

/* ── 6. Widget Flotante Inferior (Bottom-Left Floating Badge) ────────────── */
#patrio-float-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99997;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 50px;
    padding: 8px 18px 8px 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 15px rgba(0, 104, 71, 0.12);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: patrioSlideUp 0.6s ease forwards;
    user-select: none;
}

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

#patrio-float-widget:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2), 0 0 20px rgba(206, 17, 38, 0.25);
    border-color: var(--patrio-rojo);
}

.patrio-float-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #006847 0%, #ffffff 50%, #ce1126 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-right: 10px;
    flex-shrink: 0;
    animation: patrioPulse 2.5s infinite ease-in-out;
}

@keyframes patrioPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.patrio-float-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.patrio-float-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.15;
}

.patrio-float-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: #006847;
    letter-spacing: 0.3px;
}

/* Mini menú emergente */
#patrio-menu-card {
    position: fixed;
    bottom: 85px;
    left: 24px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    padding: 20px;
    width: 300px;
    z-index: 99998;
    display: none;
    animation: patrioMenuPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes patrioMenuPop {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#patrio-menu-card.show {
    display: block;
}

.patrio-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.patrio-menu-title {
    font-weight: 700;
    color: #006847;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.patrio-menu-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.patrio-menu-close:hover {
    color: #ce1126;
}

.patrio-menu-item-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.patrio-menu-item-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

.patrio-menu-item-btn.active {
    background: rgba(0, 104, 71, 0.08);
    border-color: #006847;
    color: #006847;
}

/* Mobile responsive */
@media (max-width: 640px) {
    #patrio-float-widget {
        bottom: 16px;
        left: 16px;
        padding: 6px 14px 6px 8px;
    }
    .patrio-float-icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 18px;
        margin-right: 8px;
    }
    .patrio-float-title {
        font-size: 0.8rem;
    }
    .patrio-float-sub {
        font-size: 0.68rem;
    }
    #patrio-menu-card {
        left: 16px;
        bottom: 74px;
        width: calc(100vw - 32px);
        max-width: 310px;
    }
}
