/*
 * Component: Cookie consent banner (inc/tracking.php + assets/js/consent.js)
 *
 * Same visual language as the cart drawer and footer: near-black panel,
 * Inter, green primary action, 4px radius, hairline borders. Accept and
 * Reject have the same size and weight on purpose.
 */

.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300; /* above header (100), drawers (200) and the WhatsApp button */
    background-color: #0d0d0d;
    border-top: 1px solid #222;
    color: #ccc;
    font-family: var(--font-base, 'Inter', sans-serif);
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent__inner {
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    padding: 1.25rem var(--container-pad, 1.5rem);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem 2rem;
    align-items: center;
}

.cookie-consent__title {
    margin: 0 0 0.35rem;
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.cookie-consent__desc {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #aaa;
    max-width: 68ch;
}

.cookie-consent__link {
    color: var(--color-green, #a6ce39);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.cookie-consent__link:hover {
    color: #fff;
}

/* Preferences (Configurar) – second row, full width */
.cookie-consent__prefs {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 1rem;
    border-top: 1px solid #222;
}

.cookie-consent__prefs[hidden] {
    display: none;
}

.cookie-consent__fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.5rem;
}

.cookie-consent__option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #999;
    cursor: pointer;
}

.cookie-consent__option strong {
    display: block;
    color: #e0e0e0;
    font-weight: 600;
}

.cookie-consent__option input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 0.15rem;
    accent-color: var(--color-green, #a6ce39);
    cursor: pointer;
}

.cookie-consent__option input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Actions */
.cookie-consent__actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.cookie-consent__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 7.5rem;
    padding: 10px 18px;
    font-family: var(--font-base, 'Inter', sans-serif);
    font-size: var(--text-sm, 0.875rem);
    font-weight: 600;
    line-height: 1.2;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.cookie-consent__btn[hidden] {
    display: none;
}

.cookie-consent__btn:focus-visible {
    outline: 2px solid var(--color-green, #a6ce39);
    outline-offset: 2px;
}

.cookie-consent__btn--primary {
    background: var(--color-green, #a6ce39);
    border-color: var(--color-green, #a6ce39);
    color: #000;
}

.cookie-consent__btn--primary:hover {
    background: var(--color-lime, #d7e61a);
    border-color: var(--color-lime, #d7e61a);
}

.cookie-consent__btn--outline {
    background: transparent;
    border-color: #444;
    color: #e0e0e0;
}

.cookie-consent__btn--outline:hover {
    border-color: #888;
    color: #fff;
}

.cookie-consent__btn--text {
    min-width: 0;
    padding-inline: 0.5rem;
    background: transparent;
    color: #aaa;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-consent__btn--text:hover {
    color: #fff;
}

/* Footer "Configurar cookies" trigger – looks like the other legal links */
.footer-legal__link--button {
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    line-height: inherit;
}

/* Mobile */
@media (max-width: 768px) {
    .cookie-consent__inner {
        grid-template-columns: 1fr;
        padding-block: 1rem;
    }

    .cookie-consent__fieldset {
        grid-template-columns: 1fr;
    }

    .cookie-consent__prefs,
    .cookie-consent__actions {
        grid-column: auto;
        grid-row: auto;
    }

    .cookie-consent__actions {
        justify-content: stretch;
    }

    .cookie-consent__btn--outline,
    .cookie-consent__btn--primary {
        flex: 1 1 0;
        min-width: 0;
    }

    .cookie-consent__btn--text {
        order: 3;
        flex-basis: 100%;
    }
}
