/* ============================================================
   cookie-consent.css — Vindhya Millets Privacy & Cookie Consent
   Accessible, Responsive & Dark-Mode Compatible
   ============================================================ */

/* ── Floating Consent Banner ───────────────────────────────── */
.vm-cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 980px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border: 1.5px solid #EADBCC;
    border-radius: 18px;
    padding: 22px 28px;
    box-shadow: 0 16px 45px rgba(84, 35, 17, 0.16);
    z-index: 1000005 !important;
    display: none;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.vm-cookie-banner.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.vm-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.vm-banner-text-wrap {
    flex: 1;
    min-width: 280px;
}

.vm-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #542311;
    margin: 0 0 6px;
}

.vm-banner-desc {
    font-size: 0.88rem;
    color: #6E5E56;
    line-height: 1.55;
    margin: 0;
}

.vm-banner-desc a {
    color: #2D6A4F;
    font-weight: 700;
    text-decoration: underline;
}

.vm-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vm-btn-accept {
    background: #2D6A4F;
    color: #FFFFFF !important;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
    transition: all 0.2s ease;
}

.vm-btn-accept:hover {
    background: #1E4634;
    transform: translateY(-1px);
}

.vm-btn-reject {
    background: #FAF7F2;
    color: #542311 !important;
    border: 1.5px solid #EADBCC;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vm-btn-reject:hover {
    background: #EFE9E0;
    border-color: #D6C7B7;
}

.vm-btn-customize {
    background: transparent;
    color: #2D6A4F !important;
    border: none;
    padding: 9px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

/* ── Preferences Modal Backdrop & Dialog ───────────────────── */
.vm-cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(36, 22, 16, 0.65);
    backdrop-filter: blur(6px);
    z-index: 2000000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.vm-cookie-modal.active {
    display: flex;
    opacity: 1;
}

.vm-modal-dialog {
    background: #FFFFFF;
    border-radius: 20px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    border: 1.5px solid #EADBCC;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.vm-modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid #EADBCC;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FAF8F5;
}

.vm-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #542311;
}

.vm-modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #8C7C73;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

.vm-modal-close-btn:hover {
    color: #241610;
    background: #EFE8E0;
}

.vm-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
}

.vm-modal-intro {
    font-size: 0.88rem;
    color: #6E5E56;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ── Category Accordion Items ──────────────────────────────── */
.vm-cat-item {
    border: 1.5px solid #EADBCC;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 14px;
    background: #FAF9F6;
}

.vm-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.vm-cat-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vm-cat-title-wrap h4 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #542311;
}

.vm-cat-badge-req {
    background: #EAF5ED;
    color: #2D6A4F;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
}

.vm-cat-desc {
    margin: 0;
    font-size: 0.82rem;
    color: #6E5E56;
    line-height: 1.5;
}

/* ── Toggle Switch ─────────────────────────────────────────── */
.vm-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.vm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.vm-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #D9CFC4;
    border-radius: 24px;
    transition: 0.25s;
}

.vm-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.vm-toggle input:checked + .vm-toggle-slider {
    background-color: #2D6A4F;
}

.vm-toggle input:checked + .vm-toggle-slider:before {
    transform: translateX(20px);
}

.vm-modal-footer {
    padding: 18px 28px;
    border-top: 1px solid #EADBCC;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: #FAF8F5;
    flex-wrap: wrap;
}

/* Permanent footer cookie prefs button */
.cookie-prefs-link-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.cookie-prefs-link-btn:hover {
    color: #2D6A4F;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vm-cookie-banner {
        left: 12px !important;
        right: 12px !important;
        bottom: calc(84px + env(safe-area-inset-bottom, 12px)) !important;
        width: calc(100% - 24px) !important;
        max-width: 440px !important;
        margin: 0 auto !important;
        padding: 16px 16px !important;
        border-radius: 18px !important;
        box-shadow: 0 16px 42px rgba(20, 61, 31, 0.28), 0 0 0 1.5px rgba(234, 219, 204, 0.9) !important;
        z-index: 1000005 !important;
    }
    .vm-banner-content {
        gap: 12px !important;
    }
    .vm-banner-text-wrap {
        width: 100% !important;
        min-width: 100% !important;
    }
    .vm-banner-title {
        font-size: 0.96rem !important;
        margin-bottom: 4px !important;
    }
    .vm-banner-desc {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
    }
    .vm-banner-actions {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }
    .vm-btn-accept, .vm-btn-reject {
        flex: 1 !important;
        min-width: 110px !important;
        text-align: center !important;
        padding: 10px 14px !important;
        font-size: 0.84rem !important;
    }
    .vm-btn-customize {
        width: 100% !important;
        text-align: center !important;
        padding: 6px 0 !important;
        font-size: 0.82rem !important;
    }

    /* Modal Mobile */
    .vm-cookie-modal {
        padding: 12px;
    }
    .vm-modal-dialog {
        max-height: 92vh;
        border-radius: 16px;
    }
    .vm-modal-header {
        padding: 16px 18px;
    }
    .vm-modal-header h3 {
        font-size: 1.1rem;
    }
    .vm-modal-body {
        padding: 16px 16px 10px;
    }
    .vm-cat-item {
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    .vm-modal-footer {
        padding: 12px 16px;
        flex-direction: column-reverse;
        gap: 8px;
    }
    .vm-modal-footer button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
