/* ============================================
   COOKIES.CSS - VERSIÓ ACTUALITZADA
   Data: Novembre 2025
   ============================================ */

/* Banner de cookies principal */
.cookies {
    width: 100%;
    height: auto;
    margin: 0 auto;
    padding: 25px 5% 20px;
    font-size: 1em;
    clear: both;
    font-weight: normal;
    color: #333;
    bottom: 0px;
    position: fixed;
    left: 0px;
    background-color: #FFF;
    opacity: 0.98;
    filter: alpha(opacity=98);
    transition: bottom 0.5s;
    -webkit-transition: bottom 0.5s;
    -webkit-box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    z-index: 999999999;
}

.cookies.hidden {
    bottom: -500px;
}

.cookies__container {
    max-width: 1200px;
    margin: 0 auto;
}

.cookies__titulo {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.cookies__texto {
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0 0 15px 0;
    color: #555;
}

.cookies__texto a {
    color: #a12032;
    text-decoration: underline;
    font-weight: 500;
}

.cookies__texto a:hover {
    color: #8a1b2a;
}

.cookies__botones {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 15px;
}

.cookies__boton,
.cookies__boton-2,
.cookies__boton-config {
    padding: 10px 25px;
    font-size: 0.95em;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
    text-decoration: none;
    display: inline-block;
}

.cookies__boton {
    background-color: #a12032;
    color: #fff;
    border-color: #a12032;
}

.cookies__boton:hover {
    background-color: #8a1b2a;
    border-color: #8a1b2a;
}

.cookies__boton-2 {
    background-color: transparent;
    color: #666;
    border-color: #999;
}

.cookies__boton-2:hover {
    background-color: #666;
    color: #fff;
    border-color: #666;
}

.cookies__boton-config {
    background-color: transparent;
    color: #a12032;
    border-color: #a12032;
}

.cookies__boton-config:hover {
    background-color: #a12032;
    color: #fff;
}

/* Panel de configuración */
.cookies-config-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1000000000;
    -webkit-overflow-scrolling: touch;
}

.cookies-config-panel.active {
    display: block;
}

.cookies-config-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999999999;
}

.cookies-config-overlay.active {
    display: block;
}

.config-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
    padding: 5px 10px;
}

.config-close:hover {
    color: #000;
}

.config-section {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.config-section h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #a12032;
    font-size: 1.1em;
}

.config-section p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.config-option {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    min-height: 50px;
}

.config-option > div {
    flex: 1;
    padding-right: 10px;
}

.config-option label {
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 5px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    cursor: pointer;
}

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

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

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

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

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

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

.config-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.config-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

/* Botón flotante */
.cookies-float-button {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #a12032;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 999999998;
    border: none;
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
}

.cookies-float-button.show {
    display: flex;
}

.cookies-float-button:hover {
    background-color: #8a1b2a;
    transform: scale(1.1);
}

.cookies-float-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Responsive */
@media (max-width: 768px) {
    .cookies {
        padding: 20px 4%;
        font-size: 0.9em;
    }
    
    .cookies__titulo {
        font-size: 1.1em;
    }
    
    .cookies__texto {
        font-size: 0.9em;
    }
    
    .cookies__botones {
        flex-direction: column;
        width: 100%;
    }
    
    .cookies__boton,
    .cookies__boton-2,
    .cookies__boton-config {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }

    .cookies-config-panel {
        padding: 20px 15px;
        width: 95%;
        max-height: 80vh;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .cookies-config-panel h2 {
        font-size: 1.3em;
        margin-top: 0;
        padding-right: 30px;
    }

    .cookies-config-panel p {
        font-size: 0.9em;
    }

    .config-section {
        margin: 15px 0;
        padding: 12px;
    }

    .config-section h3 {
        font-size: 1em;
        margin-bottom: 5px;
    }

    .config-section p {
        font-size: 0.85em;
    }

    .config-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .toggle-switch {
        align-self: flex-end;
    }

    .config-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .config-buttons button {
        width: 100%;
        padding: 14px;
    }

    .cookies-float-button {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }

    .cookies-float-button svg {
        width: 20px;
        height: 20px;
    }

    .config-close {
        font-size: 28px;
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}