﻿/* Utilidades para accesibilidad */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Banner posicionado en esquina inferior izquierda */
.cookie-consent-corner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    max-width: 420px;
    width: calc(100% - 40px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e5e7eb;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cookie-banner-content {
    padding: 0;
}

/* ==================== VISTA COMPACTA ==================== */
.cookie-compact {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 16px;
    align-items: center;
}

.cookie-icon {
    font-size: 32px;
    line-height: 1;
}

.cookie-text {
    min-width: 0;
}

.cookie-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.cookie-summary {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

.cookie-link {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

    .cookie-link:hover {
        color: #1d4ed8;
    }

    .cookie-link:focus {
        outline: 3px solid #2563eb;
        outline-offset: 2px;
        border-radius: 2px;
    }

.cookie-actions-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-reject-compact,
.btn-accept-compact {
    min-height: 36px;
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-reject-compact {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

    .btn-reject-compact:hover {
        background: #e5e7eb;
    }

    .btn-reject-compact:focus {
        outline: 3px solid #6b7280;
        outline-offset: 2px;
    }

.btn-accept-compact {
    background: #10b981;
    color: #ffffff;
}

    .btn-accept-compact:hover {
        background: #059669;
    }

    .btn-accept-compact:focus {
        outline: 3px solid #10b981;
        outline-offset: 2px;
    }

/* ==================== VISTA EXPANDIDA ==================== */
.cookie-expanded {
    padding: 20px;
}

.cookie-header-expanded {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.cookie-title-expanded {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: all 0.2s;
}

    .btn-close:hover {
        background: #f3f4f6;
        color: #111827;
    }

    .btn-close:focus {
        outline: 3px solid #2563eb;
        outline-offset: 2px;
    }

.cookie-intro-expanded {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #6b7280;
}

.cookie-categories-compact {
    border: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cookie-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

    .cookie-option:hover {
        background: #f3f4f6;
    }

    .cookie-option:focus-within {
        border-color: #2563eb;
        outline: 2px solid #2563eb;
        outline-offset: 1px;
    }

    .cookie-option input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        flex-shrink: 0;
    }

        .cookie-option input[type="checkbox"]:focus {
            outline: 3px solid #2563eb;
            outline-offset: 2px;
        }

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    flex: 1;
}

.required-mini {
    background: #10b981;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.cookie-links-compact {
    text-align: center;
    padding: 12px 0;
    border-top: 2px solid #e5e7eb;
    font-size: 13px;
    margin-bottom: 16px;
}

    .cookie-links-compact a {
        color: #2563eb;
        text-decoration: underline;
        font-weight: 500;
    }

        .cookie-links-compact a:hover {
            color: #1d4ed8;
        }

        .cookie-links-compact a:focus {
            outline: 3px solid #2563eb;
            outline-offset: 2px;
            border-radius: 2px;
        }

.cookie-actions-expanded {
    display: flex;
    gap: 8px;
}

    .cookie-actions-expanded button {
        flex: 1;
        min-height: 40px;
        padding: 10px 12px;
        border: 2px solid transparent;
        border-radius: 6px;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s;
    }

        .cookie-actions-expanded button:focus {
            outline: 3px solid #1d4ed8;
            outline-offset: 2px;
        }

.btn-reject {
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

    .btn-reject:hover {
        background: #f3f4f6;
    }

.btn-save {
    background: #2563eb;
    color: #ffffff;
}

    .btn-save:hover {
        background: #1d4ed8;
    }

.btn-accept {
    background: #10b981;
    color: #ffffff;
}

    .btn-accept:hover {
        background: #059669;
    }

/* ==================== MODO ALTO CONTRASTE ==================== */
body.high-contrast-mode .cookie-consent-corner {
    background: #000000;
    border-color: #ffffff;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.3);
}

body.high-contrast-mode .cookie-title,
body.high-contrast-mode .cookie-title-expanded,
body.high-contrast-mode .cookie-intro-expanded {
    color: #ffffff;
}

body.high-contrast-mode .cookie-summary {
    color: #e5e7eb;
}

body.high-contrast-mode .cookie-link {
    color: #ffff00;
}

    body.high-contrast-mode .cookie-link:focus,
    body.high-contrast-mode .btn-accept-compact:focus,
    body.high-contrast-mode .btn-save:focus,
    body.high-contrast-mode .btn-accept:focus {
        outline-color: #ffff00;
    }

body.high-contrast-mode .btn-reject-compact,
body.high-contrast-mode .btn-reject {
    background: #000000;
    color: #ffffff;
    border-color: #ffffff;
}

    body.high-contrast-mode .btn-reject-compact:hover,
    body.high-contrast-mode .btn-reject:hover {
        background: #333333;
    }

body.high-contrast-mode .btn-accept-compact,
body.high-contrast-mode .btn-accept {
    background: #00ff00;
    color: #000000;
}

body.high-contrast-mode .btn-save {
    background: #0000ff;
    color: #ffffff;
}

body.high-contrast-mode .cookie-option {
    background: #000000;
    border-color: #ffffff;
}

    body.high-contrast-mode .cookie-option:focus-within {
        border-color: #ffff00;
        outline-color: #ffff00;
    }

body.high-contrast-mode .cookie-header-expanded {
    border-bottom-color: #ffffff;
}

body.high-contrast-mode .btn-close {
    color: #ffffff;
}

    body.high-contrast-mode .btn-close:hover {
        background: #333333;
    }

body.high-contrast-mode .cookie-links-compact {
    border-top-color: #ffffff;
}

    body.high-contrast-mode .cookie-links-compact a {
        color: #ffff00;
    }

body.high-contrast-mode .required-mini {
    background: #ffff00;
    color: #000000;
}
body.high-contrast-mode .cookie-links-compact a,
body.high-contrast-mode .cookie-link,
body.high-contrast-mode .cookie-title,
body.high-contrast-mode .cookie-option,
body.high-contrast-mode .cookie-title-expanded {
    color: var(--colorNeutralForegroundInverted) !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .cookie-consent-corner {
        bottom: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }

    .cookie-compact {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }

    .cookie-icon {
        grid-row: 1 / 2;
    }

    .cookie-text {
        grid-row: 1 / 2;
    }

    .cookie-actions-compact {
        grid-column: 1 / -1;
        flex-direction: row;
        margin-top: 8px;
    }

    .cookie-actions-expanded {
        flex-direction: column;
    }
}

/* Animación de entrada */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-consent-corner {
    animation: slideInFromBottom 0.4s ease-out;
}
