/* =============================================
   Cookie Consent — Decker, Pex, Levi
   Theme-matched | Israel Privacy Law Compliant
   ============================================= */

/* Banner */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #12141D;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.25);
    animation: ccSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: "Heebo", sans-serif;
}

/* Force correct direction — RTL bootstrap is always loaded */
[dir="ltr"].cc-banner,
[dir="ltr"].cc-banner * {
    direction: ltr;
    text-align: left;
}

[dir="rtl"].cc-banner,
[dir="rtl"].cc-banner * {
    direction: rtl;
    text-align: right;
}

[dir="ltr"].cc-banner .cc-banner-actions {
    justify-content: flex-start;
}

[dir="rtl"].cc-banner .cc-banner-actions {
    justify-content: flex-end;
}

[dir="ltr"].cc-banner .cc-btn,
[dir="rtl"].cc-banner .cc-btn,
[dir="ltr"].cc-banner .cc-banner-privacy-link,
[dir="rtl"].cc-banner .cc-banner-privacy-link {
    text-align: center;
}

@keyframes ccSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes ccFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ccScaleIn {
    from { transform: scale(0.92) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 30px;
}

.cc-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.cc-banner-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.cc-banner-text {
    color: #d4d6dc;
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
}

.cc-banner-text strong {
    color: #b17d39;
    display: inline;
    margin-left: 4px;
}

/* RTL adjustments */
[dir="rtl"] .cc-banner-text strong {
    margin-left: 0;
    margin-right: 0;
}

/* Buttons row */
.cc-banner-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.cc-btn {
    font-family: "Heebo", sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 10px 28px;
    white-space: nowrap;
}

.cc-btn:focus-visible {
    outline: 2px solid #b17d39;
    outline-offset: 2px;
}

.cc-btn-primary {
    background: #b17d39;
    color: #fff;
}

.cc-btn-primary:hover {
    background: #c98e45;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(177, 125, 57, 0.35);
}

.cc-btn-secondary {
    background: transparent;
    color: #d4d6dc;
    border: 1px solid rgba(212, 214, 220, 0.3);
}

.cc-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 214, 220, 0.5);
}

.cc-btn-link {
    background: transparent;
    color: #b17d39;
    padding: 10px 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cc-btn-link:hover {
    color: #c98e45;
}

.cc-banner-privacy-link {
    color: #a4a5a8;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
    padding: 10px 6px;
    white-space: nowrap;
    margin-inline-start: auto;
}

.cc-banner-privacy-link:hover {
    color: #b17d39;
}

/* Overlay */
.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ccFadeIn 0.3s ease;
    font-family: "Heebo", sans-serif;
}

/* Modal */
.cc-modal {
    background: #fff;
    border-radius: 16px;
    width: 94%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: ccScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
}

/* Force correct direction on modal */
[dir="ltr"].cc-modal,
[dir="ltr"].cc-modal * {
    direction: ltr;
    text-align: left;
}

[dir="rtl"].cc-modal,
[dir="rtl"].cc-modal * {
    direction: rtl;
    text-align: right;
}

[dir="ltr"].cc-modal .cc-modal-privacy,
[dir="rtl"].cc-modal .cc-modal-privacy {
    text-align: center;
}

.cc-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: #5e6062;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

[dir="rtl"] .cc-modal-close {
    right: auto;
    left: 14px;
}

.cc-modal-close:hover {
    background: #f4f5f6;
    color: #12141D;
}

.cc-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 28px 28px 0;
}

.cc-modal-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.cc-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #12141D;
    margin: 0 0 8px;
}

.cc-modal-intro {
    font-size: 14px;
    color: #5e6062;
    line-height: 1.65;
    margin: 0;
}

.cc-modal-intro strong {
    color: #b17d39;
}

/* Cookie groups */
.cc-modal-body {
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cc-cookie-group {
    border-bottom: 1px solid #eef0f4;
    padding: 16px 0;
}

.cc-cookie-group:last-child {
    border-bottom: none;
}

.cc-cookie-essential {
    background: #f9fafb;
    margin: 0 -28px;
    padding: 16px 28px;
    border-radius: 10px;
}

.cc-cookie-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cc-cookie-info {
    flex: 1;
    min-width: 0;
}

.cc-cookie-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #12141D;
    margin-bottom: 4px;
}

.cc-cookie-desc {
    display: block;
    font-size: 13px;
    color: #828282;
    line-height: 1.5;
}

/* Toggle switch */
.cc-toggle {
    flex-shrink: 0;
}

.cc-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-toggle label {
    display: block;
    width: 48px;
    height: 26px;
    background: #d4d6dc;
    border-radius: 26px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cc-toggle label::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    right: auto;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

[dir="rtl"] .cc-toggle label::after {
    left: auto;
    right: 3px;
}

[dir="ltr"] .cc-toggle label::after {
    left: 3px;
    right: auto;
}

.cc-toggle input:checked + label {
    background: #b17d39;
}

.cc-toggle input:checked + label::after {
    transform: translateX(22px);
}

[dir="rtl"] .cc-toggle input:checked + label::after {
    transform: translateX(-22px);
}

.cc-toggle-locked label {
    opacity: 0.7;
    cursor: not-allowed;
}

.cc-toggle-locked input:checked + label {
    background: #1a1d62;
}

/* Modal footer actions */
.cc-modal-actions {
    display: flex;
    gap: 10px;
    padding: 0 28px 16px;
}

.cc-modal-actions .cc-btn-primary {
    flex: 1;
}

.cc-modal-actions .cc-btn-secondary {
    color: #5e6062;
    border-color: #d4d6dc;
}

.cc-modal-actions .cc-btn-secondary:hover {
    background: #f4f5f6;
    color: #12141D;
}

.cc-modal-privacy {
    text-align: center;
    padding: 0 28px 20px;
}

.cc-modal-privacy a {
    color: #a4a5a8;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.cc-modal-privacy a:hover {
    color: #b17d39;
}

/* Re-open floating button */
.cc-reopen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99998;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #12141D;
    border: 2px solid #b17d39;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    animation: ccFadeIn 0.4s ease;
}

[dir="rtl"] .cc-reopen-btn {
    left: auto;
    right: 20px;
}

.cc-reopen-btn:hover {
    background: #b17d39;
    transform: scale(1.1);
}

/* Mobile */
@media (max-width: 768px) {
    .cc-banner-inner {
        padding: 18px 16px;
    }

    .cc-banner-content {
        flex-direction: column;
        gap: 10px;
    }

    .cc-banner-icon {
        display: none;
    }

    .cc-banner-text {
        font-size: 13.5px;
    }

    .cc-banner-actions {
        flex-direction: column;
        gap: 8px;
    }

    .cc-btn {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 14px;
    }

    .cc-btn-link {
        width: auto;
        margin: 0 auto;
    }

    .cc-banner-privacy-link {
        width: 100%;
        text-align: center !important;
        margin-inline-start: 0;
    }

    .cc-modal {
        width: 96%;
        max-height: 85vh;
        border-radius: 14px;
    }

    .cc-modal-header {
        padding: 22px 18px 0;
        flex-direction: column;
        gap: 8px;
    }

    .cc-modal-icon {
        display: none;
    }

    .cc-modal-body {
        padding: 16px 18px;
    }

    .cc-cookie-essential {
        margin: 0 -18px;
        padding: 14px 18px;
    }

    .cc-modal-actions {
        padding: 0 18px 14px;
        flex-direction: column;
    }

    .cc-modal-privacy {
        padding: 0 18px 18px;
    }

    .cc-cookie-row {
        gap: 12px;
    }

    .cc-cookie-label {
        font-size: 14px;
    }

    .cc-cookie-desc {
        font-size: 12px;
    }

    .cc-reopen-btn {
        bottom: 14px;
        left: 14px;
        width: 40px;
        height: 40px;
    }

    [dir="rtl"] .cc-reopen-btn {
        left: auto;
        right: 14px;
    }
}
