/* ====================================================================
   SISTEMA DE GESTIÓN DE COOKIES - LEYCA BUS
   Conforme a normativa AEPD 2024
   ==================================================================== */

/* === CAPA DE OVERLAY === */
.cookie-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-overlay.active {
    display: block;
    opacity: 1;
}

/* === BANNER PRIMERA CAPA === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999999999;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

.cookie-banner__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.cookie-banner__header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.cookie-banner__icon {
    width: 40px;
    height: 40px;
    background-color: #049ee4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cookie-banner__icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.cookie-banner__title {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cookie-banner__text {
    font-size: 1em;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.cookie-banner__text a {
    color: #049ee4;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-banner__text a:hover {
    color: #037bb8;
}

/* === INFORMACIÓN DE COOKIES === */
.cookie-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.95em;
    color: #666;
}

.cookie-info strong {
    color: #333;
}

/* === BOTONES PRINCIPALES === */
.cookie-banner__buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.cookie-btn {
    padding: 14px 28px;
    font-size: 1em;
    font-weight: 600;
    border: 2px solid #049ee4;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.cookie-btn--accept {
    background-color: #049ee4;
    color: #fff;
}

.cookie-btn--accept:hover {
    background-color: #037bb8;
    border-color: #037bb8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(4, 158, 228, 0.3);
}

.cookie-btn--reject {
    background-color: transparent;
    color: #049ee4;
}

.cookie-btn--reject:hover {
    background-color: #049ee4;
    color: #fff;
    transform: translateY(-2px);
}

.cookie-btn--config {
    background-color: transparent;
    color: #666;
    border-color: #ddd;
    flex: 0 1 auto;
}

.cookie-btn--config:hover {
    background-color: #f8f9fa;
    border-color: #999;
    color: #333;
}

/* === SEGUNDA CAPA - CONFIGURACIÓN === */
.cookie-config {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000000000;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-config.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

.cookie-config__header {
    padding: 25px;
    background-color: #049ee4;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-config__title {
    font-size: 1.4em;
    font-weight: 600;
}

.cookie-config__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.cookie-config__close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.cookie-config__body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.cookie-category {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.cookie-category__header {
    padding: 18px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cookie-category__header:hover {
    background-color: #e9ecef;
}

.cookie-category__title {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.cookie-category__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* === SWITCH TOGGLE === */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #049ee4;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: #049ee4;
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-category__body {
    padding: 18px;
    display: none;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

.cookie-category__body.active {
    display: block;
}

.cookie-category__description {
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

.cookie-category__details {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #555;
}

.cookie-category__details strong {
    color: #333;
}

.cookie-config__footer {
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-config__footer .cookie-btn {
    flex: 1;
    min-width: 140px;
}

/* === BOTÓN FLOTANTE === */
.cookie-float-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #049ee4;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(4, 158, 228, 0.4);
    transition: all 0.3s ease;
    z-index: 999999998;
    border: 3px solid #fff;
    padding: 0;
}

.cookie-float-btn.show {
    display: flex !important;
}

.cookie-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(4, 158, 228, 0.6);
}

.cookie-float-btn svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    margin: auto;
    display: block;
}

.cookie-float-btn::before {
    content: 'Configurar cookies';
    position: absolute;
    right: 70px;
    background-color: #333;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cookie-float-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .cookie-banner__content {
        padding: 20px 15px;
    }

    .cookie-banner__title {
        font-size: 1.2em;
    }

    .cookie-banner__text {
        font-size: 0.95em;
    }

    .cookie-banner__buttons {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        min-width: 100%;
    }

    .cookie-config {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-config__header {
        padding: 20px 15px;
    }

    .cookie-config__title {
        font-size: 1.2em;
    }

    .cookie-config__body {
        padding: 15px;
    }

    .cookie-config__footer {
        flex-direction: column;
        padding: 15px;
    }

    .cookie-config__footer .cookie-btn {
        width: 100%;
    }

    .cookie-float-btn {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .cookie-float-btn svg {
        width: 24px;
        height: 24px;
    }

    .cookie-float-btn::before {
        display: none;
    }
}