/* ================================================================
   CCD Cookie Consent v2.0.0 — Frontend CSS
   Los colores dinámicos se inyectan via wp_add_inline_style()
   desde PHP según los ajustes del usuario.
================================================================ */

/* --- Base --- */
.ccd-cc-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: ccdFadeIn .25s ease;
}
@keyframes ccdFadeIn { from{opacity:0} to{opacity:1} }

/* --- Modal --- */
.ccd-cc-modal {
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: ccdSlideUp .28s ease;
}
@keyframes ccdSlideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* --- Cabecera --- */
.ccd-cc-modal-header {
    padding: 18px 22px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ccd-cc-modal-header h2,
.ccd-cc-title-text {
    margin: 0; padding: 0;
    font-size: 19px;
    border: none;
}
.ccd-cc-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.ccd-cc-logo { flex-shrink: 0; }
.ccd-cc-logo-center { width: 100%; text-align: center; margin-bottom: 6px; }
.ccd-cc-header-text { display: flex; align-items: center; gap: 8px; }

/* --- Cuerpo --- */
.ccd-cc-modal-body { padding: 18px 22px 10px; }
.ccd-cc-desc { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }

/* --- Panel de configuración --- */
.ccd-cc-settings {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0;
    animation: ccdFadeIn .2s ease;
}
.ccd-cc-category { border-bottom: 1px solid #E5E7EB; }
.ccd-cc-category:last-child { border-bottom: none; }

.ccd-cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
}
.ccd-cc-category-info { flex: 1; min-width: 0; }
.ccd-cc-category-info strong { display: block; font-size: 14px; margin-bottom: 2px; }
.ccd-cc-category-info p { margin: 0; font-size: 12px; color: #6B7280; line-height: 1.4; }

/* Badge contador */
.ccd-cc-badge {
    display: inline-block;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
}

/* Toggle siempre activo */
.ccd-cc-toggle-required {
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Toggle switch */
.ccd-cc-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.ccd-cc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ccd-cc-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 24px;
    transition: background .22s;
}
.ccd-cc-slider:before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .22s;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.ccd-cc-toggle input:checked + .ccd-cc-slider:before { transform: translateX(22px); }
.ccd-cc-toggle input:focus + .ccd-cc-slider { outline: 2px solid #3B82F6; outline-offset: 2px; }

/* --- Detalle de cookies dentro del panel --- */
.ccd-cc-cat-detail {
    padding: 0 15px 10px;
    border-top: 1px dashed #E5E7EB;
    background: #FAFBFF;
}
.ccd-cc-detail-toggle {
    background: none; border: none;
    font-size: 12px; font-weight: 600;
    cursor: pointer; padding: 7px 0 4px;
    text-align: left; width: 100%; display: block;
}
.ccd-cc-cookie-list { margin-top: 4px; }
.ccd-cc-cookie-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ccd-cc-cookie-table th { text-align: left; padding: 4px 8px; font-weight: 600; border-bottom: 1px solid #E5E7EB; }
.ccd-cc-cookie-table td { padding: 4px 8px; border-bottom: 1px solid #F3F4F6; color: #374151; }
.ccd-cc-cookie-table tr:last-child td { border-bottom: none; }
.ccd-cc-cookie-table code {
    padding: 1px 5px; border-radius: 3px;
    font-size: 11px; font-family: monospace;
    background: #EBF2FF; color: #0D2D6B;
}
.ccd-cc-no-cookies { display: block; font-size: 12px; color: #9CA3AF; font-style: italic; padding: 6px 0 2px; }
.ccd-cc-scanner-notice {
    border: 1px solid; border-radius: 6px;
    padding: 8px 12px; font-size: 12px;
    margin: 6px 0 2px;
    display: flex; gap: 6px; align-items: flex-start;
}

/* --- Links legales --- */
.ccd-cc-links { font-size: 12px; color: #9CA3AF; margin: 8px 0 0; }
.ccd-cc-links a { text-decoration: none; }
.ccd-cc-links a:hover { text-decoration: underline; }

/* --- Footer / Botones --- */
.ccd-cc-modal-footer {
    padding: 14px 22px 18px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    border-top: 1px solid #E5E7EB;
}
.ccd-cc-btn {
    padding: 9px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity .16s, border-color .16s, background .16s;
    white-space: nowrap;
    line-height: 1.2;
}
.ccd-cc-btn-accept { margin-left: auto; }
.ccd-cc-btn-accept:focus,
.ccd-cc-btn-reject:focus,
.ccd-cc-btn-outline:focus { outline: 2px solid #3B82F6; outline-offset: 2px; }

/* --- Botón flotante --- */
.ccd-cc-reopen {
    position: fixed;
    bottom: 20px;
    width: 42px; height: 42px;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    border: none;
    cursor: pointer;
    z-index: 999997;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: transform .2s, background .2s;
    line-height: 1;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
}
.ccd-cc-reopen:hover { transform: scale(1.1); }

/* --- Responsive --- */
@media (max-width: 540px) {
    .ccd-cc-modal-footer { flex-direction: column; }
    .ccd-cc-btn { width: 100%; text-align: center; }
    .ccd-cc-btn-accept { margin-left: 0; }
    .ccd-cc-modal-header h2 { font-size: 16px; }
}
