/* ==========================================================================
   Cookie Consent – Raykom Custom Responsive Override
   ========================================================================== */

/* ── Base container ── */
.ch-cookie-consent {
    position: fixed !important;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.ch-cookie-consent--bottom {
    bottom: 0;
}

.ch-cookie-consent--top {
    top: 0;
}

/* ── Inner wrapper ── */
.ch-cookie-consent__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

/* ── Content (title, intro, link) ── */
.ch-cookie-consent__content {
    flex: 1 1 500px;
    min-width: 0;
}

/* ── Dark Theme ── */
.ch-cookie-consent--dark-theme {
    background-color: #1a1a2e;
    color: #e0e0e0;
    border-top: 3px solid #00b4d8;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__title {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__intro {
    color: #c0c0c0;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 6px 0;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__read-more {
    color: #00b4d8;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__read-more:hover {
    text-decoration: underline;
    color: #48cae4;
}

/* ── Form ── */
.ch-cookie-consent__form {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Simplified mode: hide detail categories by default ── */
.ch-cookie-consent--simplified .ch-cookie-consent__form {
    flex-direction: row;
    align-items: center;
}

.ch-cookie-consent--simplified .ch-cookie-consent__category-group {
    display: none;
    width: 100%;
    margin-top: 16px;
}

/* ── Category items (shown when details toggled) ── */
.ch-cookie-consent__category {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.ch-cookie-consent__category:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__category {
    border-color: rgba(255, 255, 255, 0.15);
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__category:first-child {
    border-color: rgba(255, 255, 255, 0.15);
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__category-title {
    color: #fff;
    font-size: 0.95rem;
    margin: 0 0 4px 0;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__category-description {
    color: #aaa;
    font-size: 0.82rem;
    margin: 0;
}

/* ── Toggle buttons (Oui/Non) ── */
.ch-cookie-consent__category-toggle {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ch-cookie-consent__category-toggle input {
    opacity: 0;
    position: absolute;
    left: -10000px;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__category-toggle input + label {
    background-color: transparent;
    color: #ccc;
    border: 1.5px solid #555;
    padding: 5px 18px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    width: auto;
    margin-right: 8px;
    text-align: center;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__category-toggle input:checked + label,
.ch-cookie-consent--dark-theme .ch-cookie-consent__category-toggle input + label:hover {
    background-color: #00b4d8;
    color: #fff;
    border-color: #00b4d8;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__category-toggle input:checked + label {
    background-image: none;
}

/* ── Button group ── */
.ch-cookie-consent__btn-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.ch-cookie-consent__btn-wrapper {
    margin: 0;
}

.ch-cookie-consent__btn-wrapper:nth-child(2) {
    flex-grow: 0;
}

/* ── Buttons ── */
.ch-cookie-consent__btn {
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    border: none;
    display: inline-block;
    box-shadow: none;
}

/* "Tout accepter" – primary */
.ch-cookie-consent--dark-theme .ch-cookie-consent__btn {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: #fff;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__btn:hover {
    background: linear-gradient(135deg, #48cae4, #0096c7);
    transform: translateY(-1px);
}

/* "Refuser tout" – secondary */
.ch-cookie-consent--dark-theme .ch-cookie-consent__btn--secondary {
    background: transparent;
    color: #ccc;
    border: 1.5px solid #555;
}

.ch-cookie-consent--dark-theme .ch-cookie-consent__btn--secondary:hover {
    border-color: #00b4d8;
    color: #00b4d8;
}

/* ── Toggle details link ── */
.ch-cookie-consent__toggle-details {
    cursor: pointer;
    font-size: 0.82rem;
    color: #888;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin: 0;
}

.ch-cookie-consent__toggle-details:hover {
    color: #00b4d8;
}

.ch-cookie-consent__toggle-details-hide {
    display: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* ── Tablet (< 992px) ── */
@media screen and (max-width: 991px) {
    .ch-cookie-consent__inner {
        padding: 20px 24px;
        flex-direction: column;
        align-items: stretch;
    }

    .ch-cookie-consent__content {
        flex: 1 1 auto;
    }

    .ch-cookie-consent__form {
        justify-content: flex-start;
    }
}

/* ── Mobile (< 641px) ── */
@media screen and (max-width: 641px) {
    .ch-cookie-consent__inner {
        padding: 16px 16px;
        gap: 14px;
    }

    .ch-cookie-consent--dark-theme .ch-cookie-consent__title {
        font-size: 1rem;
    }

    .ch-cookie-consent--dark-theme .ch-cookie-consent__intro {
        font-size: 0.82rem;
    }

    .ch-cookie-consent__btn-group {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .ch-cookie-consent__btn-wrapper {
        width: 100%;
    }

    .ch-cookie-consent__btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.9rem;
        text-align: center;
    }

    .ch-cookie-consent__toggle-details {
        text-align: center;
        width: 100%;
        display: block;
    }

    .ch-cookie-consent__category {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 10px;
    }

    .ch-cookie-consent__category-toggle {
        margin-top: 0;
    }
}

/* ── Petit mobile (< 400px) ── */
@media screen and (max-width: 400px) {
    .ch-cookie-consent__inner {
        padding: 14px 12px;
        gap: 10px;
    }

    .ch-cookie-consent--dark-theme .ch-cookie-consent__title {
        font-size: 0.92rem;
    }

    .ch-cookie-consent--dark-theme .ch-cookie-consent__intro {
        font-size: 0.78rem;
        line-height: 1.4;
    }

    .ch-cookie-consent__btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}
