/* 
 * IMPORTANTE: Todos los estilos están completamente aislados con el prefijo #wccgcm-banner o #wccgcm-modal
 * para evitar cualquier conflicto con los estilos del tema de WordPress
 */

/* Reset local para nuestros elementos - SOLO dentro de nuestros contenedores */
#wccgcm-banner *,
#wccgcm-modal * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    line-height: normal;
    text-decoration: none;
    background: transparent;
}

/* Banner principal - Completamente aislado */
#wccgcm-banner {
    all: initial;
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 99999;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    box-sizing: border-box;
}

#wccgcm-banner.wccgcm-bottom {
    bottom: 0;
    top: auto;
}

#wccgcm-banner.wccgcm-top {
    top: 0;
    bottom: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#wccgcm-banner.wccgcm-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 600px;
    width: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Contenedor - Solo afecta elementos dentro del banner */
#wccgcm-banner .wccgcm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    box-sizing: border-box;
}

/* Contenido - Solo dentro del banner */
#wccgcm-banner .wccgcm-content {
    flex: 1 1 auto;
    min-width: 0;
}

#wccgcm-banner .wccgcm-text {
    display: block;
    margin: 0 0 10px 0;
    padding: 0;
    color: #333333;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    text-align: left;
}

#wccgcm-banner .wccgcm-privacy-link {
    display: inline;
    color: #2271b1;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}

#wccgcm-banner .wccgcm-privacy-link:hover {
    text-decoration: underline;
    color: #135e96;
}

/* Botones - Solo dentro del banner */
#wccgcm-banner .wccgcm-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

#wccgcm-banner .wccgcm-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    box-sizing: border-box;
}

#wccgcm-banner .wccgcm-btn-accept {
    background-color: #2271b1;
    color: #ffffff;
    border: 1px solid #2271b1;
}

#wccgcm-banner .wccgcm-btn-accept:hover {
    background-color: #135e96;
    border-color: #135e96;
    color: #ffffff;
}

#wccgcm-banner .wccgcm-btn-reject {
    background-color: #f0f0f1;
    color: #333333;
    border: 1px solid #f0f0f1;
}

#wccgcm-banner .wccgcm-btn-reject:hover {
    background-color: #e0e0e0;
    border-color: #e0e0e0;
    color: #333333;
}

#wccgcm-banner .wccgcm-btn-settings {
    background-color: transparent;
    color: #2271b1;
    border: 1px solid #2271b1;
}

#wccgcm-banner .wccgcm-btn-settings:hover {
    background-color: #2271b1;
    color: #ffffff;
}

/* Modal - Completamente aislado */
#wccgcm-modal {
    all: initial;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#wccgcm-modal[style*="display: block"],
#wccgcm-modal[style*="display:block"] {
    display: flex !important;
}

#wccgcm-modal .wccgcm-modal-content {
    background-color: #ffffff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

#wccgcm-modal .wccgcm-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    box-sizing: border-box;
}

#wccgcm-modal .wccgcm-modal-title {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    line-height: 1.3;
}

#wccgcm-modal .wccgcm-modal-close {
    all: initial;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666666;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: color 0.2s ease;
    font-family: sans-serif;
}

#wccgcm-modal .wccgcm-modal-close:hover {
    color: #333333;
}

#wccgcm-modal .wccgcm-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    background-color: #ffffff;
    box-sizing: border-box;
}

#wccgcm-modal .wccgcm-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
    background-color: #ffffff;
    box-sizing: border-box;
}

/* Categorías - Solo dentro del modal */
#wccgcm-modal .wccgcm-category {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

#wccgcm-modal .wccgcm-category:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

#wccgcm-modal .wccgcm-category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

#wccgcm-modal .wccgcm-category-title {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;
    flex: 1;
}

#wccgcm-modal .wccgcm-category p {
    margin: 0;
    padding: 0;
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    text-align: left;
}

/* Switch toggle - Solo dentro del modal */
#wccgcm-modal .wccgcm-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

#wccgcm-modal .wccgcm-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

#wccgcm-modal .wccgcm-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cccccc;
    transition: background-color 0.4s;
    border-radius: 24px;
}

#wccgcm-modal .wccgcm-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: transform 0.4s;
    border-radius: 50%;
}

#wccgcm-modal .wccgcm-switch input:checked + .wccgcm-slider {
    background-color: #2271b1;
}

#wccgcm-modal .wccgcm-switch input:disabled + .wccgcm-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* Botones del modal */
#wccgcm-modal .wccgcm-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    box-sizing: border-box;
}

#wccgcm-modal .wccgcm-btn-accept {
    background-color: #2271b1;
    color: #ffffff;
    border: 1px solid #2271b1;
}

#wccgcm-modal .wccgcm-btn-accept:hover {
    background-color: #135e96;
    border-color: #135e96;
    color: #ffffff;
}

/* Placeholder para iframes bloqueados */
.wccgcm-iframe-placeholder {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #f5f5f5 !important;
    color: #333333 !important;
    text-align: center !important;
    border: 1px solid #e0e0e0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    box-sizing: border-box !important;
}

.wccgcm-iframe-placeholder div {
    padding: 20px !important;
}

.wccgcm-iframe-placeholder p {
    margin: 0 0 10px 0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333333 !important;
}

.wccgcm-iframe-placeholder .wccgcm-btn {
    display: inline-block !important;
    padding: 8px 16px !important;
    background-color: #2271b1 !important;
    color: #ffffff !important;
    border: 1px solid #2271b1 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    outline: none !important;
}

.wccgcm-iframe-placeholder .wccgcm-btn:hover {
    background-color: #135e96 !important;
    border-color: #135e96 !important;
}

/* Estilos responsivos - Solo afectan nuestros elementos */
@media (max-width: 768px) {
    #wccgcm-banner .wccgcm-container {
        flex-direction: column;
        text-align: center;
    }
    
    #wccgcm-banner .wccgcm-text {
        text-align: center;
    }
    
    #wccgcm-banner .wccgcm-buttons {
        width: 100%;
        justify-content: center;
    }
    
    #wccgcm-banner .wccgcm-btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
    
    #wccgcm-modal {
        padding: 10px;
    }
    
    #wccgcm-modal .wccgcm-modal-content {
        max-height: 90vh;
    }
}

/* Estilos para diferentes variantes del banner */
#wccgcm-banner.wccgcm-style-box {
    max-width: 400px;
    width: auto;
    left: 20px;
    right: auto;
    border-radius: 8px;
    margin: 20px;
}

#wccgcm-banner.wccgcm-style-box.wccgcm-bottom {
    bottom: 20px;
}

#wccgcm-banner.wccgcm-style-box.wccgcm-top {
    top: 20px;
}

#wccgcm-banner.wccgcm-style-minimal {
    padding: 15px 0;
}

#wccgcm-banner.wccgcm-style-minimal .wccgcm-text {
    font-size: 13px;
    margin-bottom: 5px;
}

#wccgcm-banner.wccgcm-style-minimal .wccgcm-btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Asegurar que nuestros elementos no hereden estilos del tema */
#wccgcm-banner,
#wccgcm-banner *,
#wccgcm-modal,
#wccgcm-modal *,
.wccgcm-iframe-placeholder,
.wccgcm-iframe-placeholder * {
    /* Evitar que hereden transformaciones del tema */
    transform-style: flat !important;
    /* Evitar que hereden animaciones del tema */
    animation: none !important;
    /* Asegurar que el texto sea legible */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix para temas que usan flexbox o grid en el body */
#wccgcm-banner,
#wccgcm-modal {
    contain: layout style;
}