/* AG Consent Mode Styles */

/* Variables CSS - Se definen por defecto, pero se sobrescriben inline desde PHP */
:root {
    --ag-banner-bg: #ffffff;
    --ag-text-color: #333333;
    --ag-btn-accept: #0073aa;
    --ag-btn-reject: #dd3333;
    --ag-btn-customize: #555555;
    --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Banner Fijo Inferior */
.ag-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--ag-banner-bg);
    color: var(--ag-text-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    z-index: 999999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-family: var(--ag-font-family);
    box-sizing: border-box;
    border-top: 1px solid rgba(0,0,0,0.05); /* Sutil separación */
}

.ag-banner-content {
    flex: 1 1 60%;
    margin-right: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.ag-banner-content p {
    margin: 0;
}

.ag-banner-content a {
    color: var(--ag-btn-accept);
    text-decoration: underline;
}

.ag-banner-actions {
    flex: 1 1 30%;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ag-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.ag-btn:hover {
    opacity: 0.9;
}

.ag-btn:active {
    transform: scale(0.98);
}

.ag-btn-accept {
    background-color: var(--ag-btn-accept);
    color: #fff;
}

.ag-btn-reject {
    background-color: var(--ag-btn-reject);
    color: #fff;
}

.ag-btn-customize {
    background-color: transparent;
    border: 1px solid #ccc;
    color: var(--ag-text-color);
}

/* Modal de Personalización */
.ag-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Efecto Glassmorphism */
}

.ag-modal-content {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    font-family: var(--ag-font-family);
}

.ag-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ag-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.ag-modal-close {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.ag-modal-body {
    padding: 20px;
}

.ag-cookie-category {
    margin-bottom: 20px;
    border-bottom: 1px solid #f9f9f9;
    padding-bottom: 15px;
}

.ag-cookie-category:last-child {
    border-bottom: none;
}

.ag-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.ag-cat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ag-cookie-category p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* Switches */
.ag-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.ag-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ag-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.ag-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .ag-slider {
    background-color: var(--ag-btn-accept);
}

input:focus + .ag-slider {
    box-shadow: 0 0 1px var(--ag-btn-accept);
}

input:checked + .ag-slider:before {
    transform: translateX(20px);
}

.ag-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Botón flotante para reabrir */
.ag-reopen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 999998;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555;
    transition: transform 0.2s;
}

.ag-reopen-btn:hover {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .ag-consent-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }

    .ag-banner-content {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }

    .ag-banner-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .ag-btn {
        width: 100%;
        padding: 12px;
        text-align: center;
    }

    .ag-modal-content {
        width: 95%;
        max-height: 85vh;
    }
}
