/* ═══════════════════════════════════════════════
   Cookie Consent — Soria Casas
   Premium GDPR popup · brand-aligned design
   ═══════════════════════════════════════════════ */

/* --- Backdrop overlay --- */
.sc-cookies-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(26, 26, 46, .35);
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s cubic-bezier(.4, 0, .2, 1), visibility .5s;
}
.sc-cookies-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* --- Main popup card --- */
.sc-cookies {
    position: fixed;
    z-index: 99999;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    width: calc(100% - 32px);
    max-width: 520px;
    background: #fff;
    border-radius: 20px;
    box-shadow:
        0 25px 60px rgba(26, 26, 46, .18),
        0 8px 24px rgba(74, 143, 204, .08);
    font-family: 'DM Sans', sans-serif;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity .5s cubic-bezier(.4, 0, .2, 1),
        transform .5s cubic-bezier(.4, 0, .2, 1),
        visibility .5s;
    overflow: hidden;
}
.sc-cookies.sc-cookies--visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Accent bar top */
.sc-cookies::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a8fcc 0%, #6baee0 40%, #f0e8d5 70%, #4a8fcc 100%);
    background-size: 200% 100%;
    animation: sc-cookies-gradient 6s ease infinite;
}
@keyframes sc-cookies-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Inner layout --- */
.sc-cookies__inner {
    padding: 28px 28px 24px;
}

/* --- Header with icon --- */
.sc-cookies__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.sc-cookies__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(74, 143, 204, .1) 0%, rgba(240, 232, 213, .5) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sc-cookies__icon svg {
    width: 22px;
    height: 22px;
    color: #4a8fcc;
}
.sc-cookies__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.2;
    letter-spacing: -.01em;
}

/* --- Description text --- */
.sc-cookies__text {
    font-size: .875rem;
    line-height: 1.65;
    color: #54585e;
    margin-bottom: 22px;
}
.sc-cookies__text a {
    color: #4a8fcc;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(74, 143, 204, .3);
    transition: border-color .2s, color .2s;
}
.sc-cookies__text a:hover {
    color: #3a7fb8;
    border-color: #3a7fb8;
}

/* --- Button group --- */
.sc-cookies__buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

/* --- Buttons --- */
.sc-cookies__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background .25s cubic-bezier(.4, 0, .2, 1),
        color .25s,
        box-shadow .25s,
        transform .15s;
    white-space: nowrap;
    border: none;
    font-family: inherit;
    letter-spacing: .01em;
    position: relative;
    overflow: hidden;
}
.sc-cookies__btn:active {
    transform: scale(.97);
}

/* Accept — primary CTA */
.sc-cookies__btn--accept {
    flex: 1;
    background: #4a8fcc;
    color: #fff;
    box-shadow: 0 4px 14px rgba(74, 143, 204, .25);
}
.sc-cookies__btn--accept:hover {
    background: #3a7fb8;
    box-shadow: 0 6px 20px rgba(74, 143, 204, .35);
}

/* Functional only — secondary */
.sc-cookies__btn--functional {
    flex: 1;
    background: #f7f7f9;
    color: #54585e;
    border: 1px solid #e5e5e5;
}
.sc-cookies__btn--functional:hover {
    background: #eef0f3;
    border-color: #d5d5d5;
}

/* Settings — tertiary */
.sc-cookies__btn--settings {
    background: transparent;
    color: #4a8fcc;
    padding: 12px 14px;
    font-weight: 500;
    gap: 6px;
}
.sc-cookies__btn--settings svg {
    width: 14px;
    height: 14px;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.sc-cookies__btn--settings:hover {
    color: #3a7fb8;
}
.sc-cookies__btn--settings:hover svg {
    transform: rotate(60deg);
}

/* Save — in settings panel */
.sc-cookies__btn--save {
    flex: 1;
    background: #4a8fcc;
    color: #fff;
    box-shadow: 0 4px 14px rgba(74, 143, 204, .25);
}
.sc-cookies__btn--save:hover {
    background: #3a7fb8;
    box-shadow: 0 6px 20px rgba(74, 143, 204, .35);
}

/* --- Settings panel (expandable) --- */
.sc-cookies__settings {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height .45s cubic-bezier(.4, 0, .2, 1),
        opacity .3s cubic-bezier(.4, 0, .2, 1),
        margin .35s;
    margin-top: 0;
}
.sc-cookies__settings.sc-cookies__settings--open {
    max-height: 500px;
    opacity: 1;
    margin-top: 20px;
}

.sc-cookies__settings-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e5e5 20%, #e5e5e5 80%, transparent);
    margin-bottom: 18px;
}

/* --- Category row --- */
.sc-cookies__category {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #fafbfc;
    border: 1px solid #f0f0f2;
    transition: background .2s, border-color .2s;
}
.sc-cookies__category:hover {
    background: #f5f7fa;
    border-color: #e5e8ed;
}
.sc-cookies__category:last-of-type {
    margin-bottom: 16px;
}

/* Category icon */
.sc-cookies__cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sc-cookies__cat-icon svg {
    width: 18px;
    height: 18px;
}
.sc-cookies__cat-icon--necessary {
    background: rgba(74, 143, 204, .1);
    color: #4a8fcc;
}
.sc-cookies__cat-icon--statistics {
    background: rgba(99, 179, 130, .1);
    color: #63b382;
}
.sc-cookies__cat-icon--marketing {
    background: rgba(217, 150, 80, .1);
    color: #d99650;
}

/* Category info */
.sc-cookies__cat-info {
    flex: 1;
    min-width: 0;
}
.sc-cookies__cat-name {
    font-weight: 600;
    font-size: .8125rem;
    color: #1a1a2e;
    margin-bottom: 2px;
}
.sc-cookies__cat-desc {
    font-size: .75rem;
    color: #7a7f87;
    line-height: 1.4;
}

/* --- Toggle switch (premium) --- */
.sc-cookies__toggle {
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.sc-cookies__toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.sc-cookies__toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d5d8dd;
    border-radius: 26px;
    transition: background .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s;
}
.sc-cookies__toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
.sc-cookies__toggle input:checked + .sc-cookies__toggle-slider {
    background: #4a8fcc;
    box-shadow: 0 0 0 2px rgba(74, 143, 204, .15);
}
.sc-cookies__toggle input:checked + .sc-cookies__toggle-slider::before {
    transform: translateX(20px);
}
.sc-cookies__toggle input:disabled + .sc-cookies__toggle-slider {
    opacity: .5;
    cursor: default;
}
.sc-cookies__toggle input:focus-visible + .sc-cookies__toggle-slider {
    box-shadow: 0 0 0 3px rgba(74, 143, 204, .3);
}

/* Necessary always-on badge */
.sc-cookies__always-on {
    font-size: .675rem;
    font-weight: 600;
    color: #4a8fcc;
    background: rgba(74, 143, 204, .08);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .03em;
    text-transform: uppercase;
    flex-shrink: 0;
    white-space: nowrap;
}

/* --- Settings buttons row --- */
.sc-cookies__settings-buttons {
    display: flex;
    gap: 10px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .sc-cookies {
        bottom: 12px;
        max-width: none;
        width: calc(100% - 24px);
        border-radius: 16px;
    }
    .sc-cookies__inner {
        padding: 22px 20px 20px;
    }
    .sc-cookies__buttons {
        flex-direction: column;
        gap: 8px;
    }
    .sc-cookies__btn--settings {
        align-self: center;
    }
    .sc-cookies__settings-buttons {
        flex-direction: column;
    }
    .sc-cookies__category {
        padding: 12px;
    }
}

/* --- Floating re-open button --- */
.sc-cookies-reopen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99998;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow:
        0 4px 16px rgba(26, 26, 46, .08),
        0 1px 4px rgba(0, 0, 0, .04);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        box-shadow .25s cubic-bezier(.4, 0, .2, 1),
        transform .25s cubic-bezier(.4, 0, .2, 1),
        border-color .25s;
    padding: 0;
}
.sc-cookies-reopen:hover {
    box-shadow:
        0 6px 20px rgba(74, 143, 204, .15),
        0 2px 8px rgba(0, 0, 0, .06);
    transform: translateY(-2px);
    border-color: rgba(74, 143, 204, .3);
}
.sc-cookies-reopen:active {
    transform: translateY(0) scale(.95);
}
.sc-cookies-reopen svg {
    width: 20px;
    height: 20px;
    color: #4a8fcc;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.sc-cookies-reopen:hover svg {
    transform: rotate(60deg);
}
.sc-cookies-reopen--hidden {
    display: none;
}

/* --- Hide reCAPTCHA v3 badge (invisible mode) --- */
.grecaptcha-badge {
    visibility: hidden !important;
}
