/* ==========================================================================
   CPW Consentimento - Estilos do Banner de Consentimento
   ========================================================================== */

/* Banner base */
#cpw-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    border-top: 3px solid #0073aa;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    display: none;
    animation: cpwSlideUp 0.4s ease-out;
}

/* Posições */
#cpw-consent-banner.cpw-position-top {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 3px solid #0073aa;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: cpwSlideDown 0.4s ease-out;
}

#cpw-consent-banner.cpw-position-bottom-left {
    left: 20px;
    right: auto;
    bottom: 20px;
    max-width: 420px;
    border-radius: 8px;
    border-top: 3px solid #0073aa;
}

#cpw-consent-banner.cpw-position-bottom-right {
    left: auto;
    right: 20px;
    bottom: 20px;
    max-width: 420px;
    border-radius: 8px;
    border-top: 3px solid #0073aa;
}

#cpw-consent-banner.cpw-position-center {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    max-width: 560px;
    width: 90%;
    border-radius: 8px;
    border-top: 3px solid #0073aa;
    animation: cpwFadeIn 0.3s ease-out;
}

/* Overlay para modal */
#cpw-consent-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999998;
}

/* Conteúdo do banner */
.cpw-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
}

.cpw-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.cpw-banner-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: inherit;
}

.cpw-banner-text {
    margin: 0 0 16px 0;
    color: inherit;
    opacity: 0.85;
}

.cpw-banner-text a {
    color: #0073aa;
    text-decoration: underline;
}

/* Ações do banner */
.cpw-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Botões */
.cpw-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.cpw-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cpw-btn:active {
    transform: translateY(0);
}

.cpw-btn-accept {
    background-color: #0073aa;
    color: #fff;
}

.cpw-btn-decline {
    background-color: #666;
    color: #fff;
}

.cpw-btn-customize {
    background-color: transparent;
    color: inherit;
    border: 1px solid currentColor;
}

/* Modal de personalização */
#cpw-customize-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    z-index: 1000000;
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    animation: cpwFadeIn 0.3s ease-out;
}

.cpw-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cpw-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.cpw-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.cpw-modal-body {
    padding: 20px 24px;
}

.cpw-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Categorias de cookies */
.cpw-cookie-category {
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.cpw-cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f9f9f9;
    cursor: pointer;
}

.cpw-cookie-category-title {
    font-weight: 600;
    font-size: 14px;
}

.cpw-cookie-category-body {
    padding: 12px 16px;
    font-size: 13px;
    color: #555;
    border-top: 1px solid #eee;
    display: none;
}

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

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

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

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

.cpw-toggle input:checked + .cpw-toggle-slider {
    background-color: #0073aa;
}

.cpw-toggle input:disabled + .cpw-toggle-slider {
    background-color: #46b450;
    cursor: not-allowed;
}

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

/* Animações */
@keyframes cpwSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes cpwSlideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

@keyframes cpwFadeIn {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* Responsividade */
@media (max-width: 600px) {
    .cpw-banner-inner {
        padding: 16px;
    }

    .cpw-banner-actions {
        flex-direction: column;
    }

    .cpw-btn {
        width: 100%;
        text-align: center;
    }

    #cpw-consent-banner.cpw-position-bottom-left,
    #cpw-consent-banner.cpw-position-bottom-right {
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 100%;
        border-radius: 0;
    }
}
