/* Cookie consent modal (frontend/partials/cookie-consent). */

[x-cloak] .cookie-consent,
.cookie-consent[x-cloak] {
    display: none;
}

body.yc-modal-open {
    overflow: hidden;
}

.cookie-consent {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: var(--font-sans, "Plus Jakarta Sans", system-ui, sans-serif);
}

.cookie-consent__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(15, 23, 42, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.cookie-consent__wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
}

.cookie-consent__content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
    will-change: transform, opacity;
}

.cookie-consent__pop {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.cookie-consent__pop--from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
}

.cookie-consent__pop--to {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.cookie-consent__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cookie-consent__close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.cookie-consent__icon-wrap {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.25rem;
}

.cookie-consent__icon {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    /* color-mix() fallbacks: browsers without support keep the solid
       brand color + a plain rgba shadow instead of the gradient. */
    background: var(--colorPrimary, #f66542);
    background: linear-gradient(
        135deg,
        var(--colorPrimary, #f66542),
        color-mix(in srgb, var(--colorPrimary, #f66542) 60%, #a78bfa)
    );
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--colorPrimary, #f66542) 30%, transparent);
}

.cookie-consent__title {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.cookie-consent__desc {
    text-align: center;
    font-size: 0.925rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    padding: 0 0.5rem;
}

.cookie-consent__desc a {
    color: var(--colorPrimary, #f66542);
    font-weight: 600;
}

.cookie-consent__actions {
    display: flex;
    gap: 0.75rem;
}

.cookie-consent__accept,
.cookie-consent__save {
    border-radius: 12px;
    font-weight: 700;
    padding: 0.7rem 1rem;
    font-size: 0.925rem;
    background: var(--colorPrimary, #f66542);
    border: 1px solid var(--colorPrimary, #f66542);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--colorPrimary, #f66542) 30%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cookie-consent__accept:hover,
.cookie-consent__save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.20);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--colorPrimary, #f66542) 40%, transparent);
    background: var(--colorPrimary, #f66542);
    background: color-mix(in srgb, var(--colorPrimary, #f66542) 90%, #000);
    border-color: var(--colorPrimary, #f66542);
    border-color: color-mix(in srgb, var(--colorPrimary, #f66542) 90%, #000);
    filter: brightness(0.94);
}

.cookie-consent__accept {
    flex: 1.3;
}

.cookie-consent__decline,
.cookie-consent__back {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.7rem 1rem;
    font-size: 0.925rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cookie-consent__decline:hover,
.cookie-consent__back:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.cookie-consent__decline {
    flex: 1;
}

.cookie-consent__customize {
    display: block;
    width: 100%;
    border: 0;
    background: none;
    padding: 1.5rem 0 0;
    font-size: 0.925rem;
    font-weight: 700;
    color: var(--colorPrimary, #f66542);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: opacity 0.15s ease;
    text-align: center;
}

.cookie-consent__customize:hover {
    opacity: 0.8;
}

.cookie-consent button:focus-visible {
    outline: 2px solid var(--colorPrimary, #f66542);
    outline-offset: 2px;
}

/* Settings view */
.cookie-consent__settings-header {
    text-align: center;
    margin-bottom: 1rem;
}

.cookie-consent__settings-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.cookie-consent__settings-intro {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

.cookie-consent__categories {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.25rem 1.25rem;
    margin-bottom: 1.5rem;
}

.cookie-consent__category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
}

.cookie-consent__category + .cookie-consent__category {
    border-top: 1px solid #e2e8f0;
}

.cookie-consent__category-icon {
    width: 2rem;
    height: 2rem;
    flex: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    background: var(--colorPrimary, #f66542);
    background: linear-gradient(
        135deg,
        var(--colorPrimary, #f66542),
        color-mix(in srgb, var(--colorPrimary, #f66542) 60%, #a78bfa)
    );
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--colorPrimary, #f66542) 25%, transparent);
}

.cookie-consent__category-required .cookie-consent__category-icon {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
}

.cookie-consent__category-body {
    flex: 1;
    min-width: 0;
}

.cookie-consent__category-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 2px;
}

.cookie-consent__badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0a7d45;
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 8px;
    border-radius: 999px;
}

.cookie-consent__category-help {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #94a3b8;
    margin: 0;
}

.cookie-consent__switch {
    position: relative;
    width: 40px;
    height: 24px;
    flex: none;
    margin-left: 0.25rem;
}

.cookie-consent__switch input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.cookie-consent__switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 180ms ease;
}

.cookie-consent__switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 180ms ease;
}

.cookie-consent__switch input:checked ~ .cookie-consent__switch-track {
    background: var(--colorPrimary, #f66542);
}

.cookie-consent__switch input:checked ~ .cookie-consent__switch-thumb {
    transform: translateX(16px);
}

.cookie-consent__switch input:focus-visible ~ .cookie-consent__switch-track {
    outline: 2px solid var(--colorPrimary, #f66542);
    outline-offset: 2px;
}

[dir="rtl"] .cookie-consent__switch input:checked ~ .cookie-consent__switch-thumb {
    transform: translateX(-16px);
}

[dir="rtl"] .cookie-consent__switch-thumb {
    left: auto;
    right: 3px;
}

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

.cookie-consent__back {
    flex: 1;
}

.cookie-consent__save {
    flex: 1.3;
}

@media (max-width: 575.98px) {
    .cookie-consent__content {
        padding: 2rem 1.25rem 1.5rem;
        border-radius: 16px;
    }

    .cookie-consent__title {
        font-size: 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent__pop,
    .cookie-consent__accept,
    .cookie-consent__save,
    .cookie-consent__switch-track,
    .cookie-consent__switch-thumb {
        transition: none;
    }
}
