/* Cookie consent banner + preferences dialog (template-parts/cookie-banner.php) */

.cookie-banner,
.cookie-dialog-backdrop,
.cookie-table-wrapper,
.cookie-settings-button {
    direction: rtl;
    font-family: 'Heebo', sans-serif;
    color: #2A2A2A;
}

.cookie-banner[hidden],
.cookie-dialog-backdrop[hidden] {
    display: none !important;
}

/* Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99990;
    background: #F7F4F1;
    border-top: 1.5px solid rgba(42, 42, 42, 0.2);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cookie-banner-text {
    margin: 0;
    flex: 1;
    font-size: 15px;
    line-height: 1.6;
}

.cookie-banner-text a,
.cookie-dialog-intro a {
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    align-items: center;
}

/* Buttons. Accept and reject share one style on purpose: rejecting must be as easy as accepting. */
.cookie-btn {
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    padding: 0.6rem 1.5rem;
    border-radius: 48px;
    border: 1px solid #2A2A2A;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-btn-primary {
    background: #2A2A2A;
    color: #FFFFFF;
}

.cookie-btn-secondary {
    background: transparent;
    color: #2A2A2A;
}

.cookie-btn-link {
    background: transparent;
    color: #2A2A2A;
    border-color: transparent;
    text-decoration: underline;
    padding-inline: 0.5rem;
}

.cookie-btn:hover {
    opacity: 0.85;
}

.cookie-btn:focus-visible,
.cookie-dialog-close:focus-visible,
.cookie-settings-button:focus-visible,
.cookie-category input:focus-visible,
.cookie-dialog:focus-visible {
    outline: 2px solid #2A2A2A;
    outline-offset: 2px;
}

/* Preferences dialog */
html.cookie-dialog-open {
    overflow: hidden;
}

.cookie-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99991;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-dialog {
    background: #FFFFFF;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.75rem;
    box-sizing: border-box;
    border-radius: 8px;
}

.cookie-dialog:focus {
    outline: none;
}

.cookie-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cookie-dialog-header h2 {
    font-size: 22px;
    font-weight: 500;
}

.cookie-dialog-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #2A2A2A;
    padding: 0 0.25rem;
}

.cookie-dialog-intro {
    margin: 0 0 1rem;
    font-size: 15px;
    line-height: 1.6;
}

.cookie-categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cookie-category {
    border-top: 1px solid rgba(42, 42, 42, 0.15);
    padding: 0.9rem 0;
}

.cookie-category-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.cookie-category input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #2A2A2A;
    flex-shrink: 0;
}

.cookie-category input:disabled {
    cursor: not-allowed;
}

.cookie-category-name {
    font-size: 17px;
    font-weight: 500;
}

.cookie-category-badge {
    font-size: 13px;
    background: #D2E3E7;
    padding: 0.1rem 0.6rem;
    border-radius: 48px;
}

.cookie-category-description {
    margin: 0.35rem 0 0;
    padding-inline-start: calc(20px + 0.6rem);
    font-size: 14px;
    line-height: 1.5;
}

.cookie-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* Footer link + shortcode button */
.cookie-settings-button {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
}

/* [ivtheme_cookie_table] on the privacy policy page */
.cookie-table-title {
    font-size: 18px;
    font-weight: 500;
    margin: 1.5rem 0 0.5rem;
}

.cookie-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cookie-table th,
.cookie-table td {
    border: 1px solid rgba(42, 42, 42, 0.2);
    padding: 0.5rem 0.75rem;
    text-align: right;
    vertical-align: top;
}

.cookie-table th {
    background: #F7F4F1;
    font-weight: 500;
}

@media (max-width: 768px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .cookie-banner-text {
        font-size: 14px;
    }

    .cookie-banner-actions {
        flex-wrap: wrap;
    }

    .cookie-banner-actions .cookie-btn-primary {
        flex: 1;
    }

    .cookie-dialog {
        padding: 1.25rem;
    }

    .cookie-dialog-actions .cookie-btn {
        flex: 1 1 100%;
    }
}
