/* Cookie Consent Banner - AgroBridge Group
   GDPR-compliant cookie consent UI */

/* Banner Container */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--surface-card);
    border-top: 1px solid rgb(var(--brand-gold-rgb) / 0.25);
    padding: 1.25rem 1.5rem;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -4px 20px rgb(var(--shadow-rgb) / 0.18);
}

.cookie-banner.cookie-banner--visible {
    transform: translateY(0);
}

.cookie-banner.cookie-banner--hidden {
    transform: translateY(100%);
    pointer-events: none;
}

/* Inner Layout */
.cookie-banner__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Text */
.cookie-banner__text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    flex: 1;
    margin: 0;
}

.cookie-banner__text a {
    color: var(--oro-oscuro);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__text a:hover {
    color: var(--brand-primary-text);
}

/* Buttons */
.cookie-banner__actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-banner__btn {
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.cookie-banner__btn--accept {
    background: linear-gradient(135deg, var(--oro) 0%, var(--oro-claro) 100%);
    color: var(--on-gold);
}

.cookie-banner__btn--accept:hover {
    background: var(--oro-claro);
    transform: translateY(-1px);
}

.cookie-banner__btn--accept:active {
    transform: translateY(0);
}

.cookie-banner__btn--manage {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--hairline-strong);
}

.cookie-banner__btn--manage:hover {
    border-color: var(--oro);
    color: var(--oro-oscuro);
}

/* Preferences Panel */
.cookie-banner__prefs {
    display: none;
    max-width: 1100px;
    margin: 1rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--hairline);
}

.cookie-banner__prefs.cookie-banner__prefs--open {
    display: block;
}

.cookie-banner__prefs-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.cookie-banner__prefs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Toggle Item */
.cookie-banner__toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 160px;
}

.cookie-banner__toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cookie-banner__toggle-label--disabled {
    color: var(--text-muted);
}

/* Switch */
.cookie-banner__switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.cookie-banner__switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-banner__switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hairline-strong);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cookie-banner__switch-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--surface-card);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.cookie-banner__switch input:checked + .cookie-banner__switch-slider {
    background: var(--brand-primary-fill);
}

.cookie-banner__switch input:checked + .cookie-banner__switch-slider::before {
    transform: translateX(18px);
    background: var(--surface-card);
}

.cookie-banner__switch input:disabled + .cookie-banner__switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-banner__switch input:focus-visible + .cookie-banner__switch-slider {
    outline: 2px solid var(--oro);
    outline-offset: 2px;
}

/* Save Preferences Button */
.cookie-banner__btn--save {
    background: linear-gradient(135deg, var(--oro) 0%, var(--oro-claro) 100%);
    color: var(--on-gold);
}

.cookie-banner__btn--save:hover {
    background: var(--oro-claro);
    transform: translateY(-1px);
}

.cookie-banner__btn--save:active {
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .cookie-banner {
        padding: 1rem;
    }

    .cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cookie-banner__text {
        font-size: 0.825rem;
    }

    .cookie-banner__actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cookie-banner__btn {
        width: 100%;
        text-align: center;
        padding: 0.7rem 1rem;
    }

    .cookie-banner__prefs-list {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner {
        transition: none;
    }

    .cookie-banner__btn {
        transition: none;
    }

    .cookie-banner__switch-slider,
    .cookie-banner__switch-slider::before {
        transition: none;
    }
}
