/**
 * CorretajeInmobiliario.cl - Sistema de Consentimiento de Cookies (Ley 21.719 Chile)
 * Estilos para Banner, Modal de Configuración y Botón Flotante
 */

/* ==========================================================================
   1. BOTÓN FLOTANTE PERMANENTE (CONSENTIMIENTO REVERSIBLE)
   ========================================================================== */
.ci-cookie-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9990;
    background: #03251D;
    color: #FBBF24;
    border: 1px solid #10B981;
    border-radius: 9999px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease-in-out;
    outline: none;
}

.ci-cookie-floating-btn:hover {
    background: #064E3B;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.ci-cookie-floating-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.6);
}

/* ==========================================================================
   2. BANNER INICIAL EN PARTE INFERIOR
   ========================================================================== */
.ci-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(3, 37, 29, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(16, 185, 129, 0.35);
    color: #ECFDF5;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ci-cookie-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .ci-cookie-banner-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.ci-cookie-banner-text {
    flex: 1;
    font-size: 0.925rem;
    line-height: 1.5;
    color: #D1FAE5;
}

.ci-cookie-banner-text strong {
    color: #FBBF24;
}

.ci-cookie-banner-text a {
    color: #6EE7B7;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.ci-cookie-banner-text a:hover {
    color: #FFFFFF;
}

.ci-cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
    width: 100%;
}

@media (min-width: 768px) {
    .ci-cookie-banner-actions {
        width: auto;
        flex-shrink: 0;
    }
}

/* Botones del Banner y Modal */
.ci-btn-cookie {
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
    white-space: nowrap;
}

.ci-btn-cookie-accept {
    background: #10B981;
    color: #03251D;
    flex: 1 1 auto;
}

.ci-btn-cookie-accept:hover {
    background: #34D399;
}

.ci-btn-cookie-reject {
    background: rgba(255, 255, 255, 0.1);
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1 1 auto;
}

.ci-btn-cookie-reject:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.ci-btn-cookie-config {
    background: transparent;
    color: #FBBF24;
    border: 1px solid #F59E0B;
    flex: 1 1 auto;
}

.ci-btn-cookie-config:hover {
    background: rgba(245, 158, 11, 0.15);
    color: #FDE68A;
}

/* ==========================================================================
   3. MODAL DE CONFIGURACIÓN DETALLADA (LEY 21.719)
   ========================================================================== */
.ci-cookie-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ci-cookie-modal-backdrop.ci-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ci-cookie-modal {
    background: #03251D;
    color: #F1F5F9;
    border: 1px solid #084838;
    border-radius: 14px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.ci-cookie-modal-backdrop.ci-open .ci-cookie-modal {
    transform: scale(1);
}

.ci-cookie-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #084838;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #042e24;
}

.ci-cookie-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ci-cookie-modal-close {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s;
}

.ci-cookie-modal-close:hover {
    color: #FFFFFF;
}

.ci-cookie-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #CBD5E1;
}

.ci-cookie-modal-intro {
    background: rgba(16, 185, 129, 0.08);
    border-left: 3px solid #10B981;
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #D1FAE5;
}

/* Categorías de Cookies */
.ci-cookie-category {
    background: rgba(2, 44, 34, 0.6);
    border: 1px solid #064E3B;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.875rem;
    transition: border-color 0.2s;
}

.ci-cookie-category:hover {
    border-color: #10B981;
}

.ci-cookie-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.ci-cookie-cat-title {
    font-weight: 700;
    font-size: 0.975rem;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ci-badge-required {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
}

.ci-badge-optional {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
}

.ci-cookie-cat-desc {
    font-size: 0.85rem;
    color: #94A3B8;
    margin: 0 0 0.5rem 0;
}

.ci-cookie-cat-examples {
    font-size: 0.775rem;
    color: #64748B;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Custom Switch Toggle */
.ci-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.ci-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
}

.ci-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}

input:checked + .ci-slider {
    background-color: #10B981;
}

input:checked + .ci-slider:before {
    transform: translateX(20px);
}

input:disabled + .ci-slider {
    background-color: #064E3B;
    cursor: not-allowed;
    opacity: 0.8;
}

input:disabled + .ci-slider:before {
    background-color: #34D399;
}

/* Footer del Modal */
.ci-cookie-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #084838;
    background: #042e24;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .ci-cookie-modal-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.ci-cookie-modal-links a {
    color: #6EE7B7;
    font-size: 0.825rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ci-cookie-modal-links a:hover {
    color: #FFFFFF;
}

.ci-cookie-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
