/**
 * Observatório de TO — Consent Banner Styles
 * @since 1.5.0
 */

/* =========================================================
   BANNER
   ========================================================= */
.oto-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    padding: 16px 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1F2328;
}

.oto-consent-banner--visible {
    transform: translateY(0);
}

.oto-consent-banner__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.oto-consent-banner__text {
    flex: 1;
}

.oto-consent-banner__text p {
    margin: 0;
}

.oto-consent-banner__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.oto-consent-btn {
    padding: 8px 16px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    color: #1F2328;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.oto-consent-btn:hover {
    background: #f6f7f7;
    border-color: #8c8f94;
}

.oto-consent-btn:focus-visible {
    outline: 2px solid #164B5B;
    outline-offset: 2px;
}

.oto-consent-btn--accept {
    background: #164B5B;
    border-color: #0F3A47;
    color: #fff;
}

.oto-consent-btn--accept:hover {
    background: #0F3A47;
}

.oto-consent-btn--essential {
    background: transparent;
}

.oto-consent-btn--save {
    background: #164B5B;
    border-color: #0F3A47;
    color: #fff;
}

.oto-consent-btn--save:hover {
    background: #0F3A47;
}

/* =========================================================
   MODAL
   ========================================================= */
.oto-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.oto-consent-modal--open {
    opacity: 1;
    pointer-events: auto;
}

.oto-consent-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.oto-consent-modal__content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.oto-consent-modal__title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1F2328;
}

.oto-consent-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #667078;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.oto-consent-modal__close:hover {
    color: #1F2328;
}

.oto-consent-modal__actions {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* =========================================================
   CATEGORY
   ========================================================= */
.oto-consent-category {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.oto-consent-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.oto-consent-category__name {
    font-weight: 600;
    font-size: 14px;
    color: #1F2328;
}

.oto-consent-category__status {
    font-size: 12px;
    color: #667078;
    font-style: italic;
}

.oto-consent-category__desc {
    margin: 0;
    font-size: 13px;
    color: #667078;
    line-height: 1.4;
}

/* =========================================================
   TOGGLE
   ========================================================= */
.oto-consent-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.oto-consent-toggle__input {
    opacity: 0;
    width: 0;
    height: 0;
}

.oto-consent-toggle__slider {
    position: absolute;
    inset: 0;
    background: #c3c4c7;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.2s;
}

.oto-consent-toggle__slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.oto-consent-toggle__input:checked + .oto-consent-toggle__slider {
    background: #164B5B;
}

.oto-consent-toggle__input:checked + .oto-consent-toggle__slider::before {
    transform: translateX(18px);
}

.oto-consent-toggle__input:focus-visible + .oto-consent-toggle__slider {
    outline: 2px solid #164B5B;
    outline-offset: 2px;
}

/* =========================================================
   SETTINGS LINK
   ========================================================= */
.oto-cookie-settings-link {
    position: fixed;
    bottom: 8px;
    left: 8px;
    font-size: 11px;
    color: #667078;
    text-decoration: none;
    z-index: 99998;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 3px;
}

.oto-cookie-settings-link:hover {
    color: #164B5B;
    text-decoration: underline;
}

/* =========================================================
   FOOTER COOKIE BUTTON
   ========================================================= */
.oto-footer-cookie-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    text-decoration: none;
    transition: color 0.2s;
}

.oto-footer-cookie-btn:hover {
    color: #fff;
    text-decoration: underline;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 640px) {
    .oto-consent-banner {
        padding: 12px 16px;
    }

    .oto-consent-banner__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .oto-consent-banner__text p {
        font-size: 13px;
        line-height: 1.4;
    }

    .oto-consent-banner__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .oto-consent-btn {
        min-height: 44px;
        padding: 10px 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .oto-consent-btn--accept {
        grid-column: 1 / -1;
    }

    .oto-cookie-settings-link {
        display: none !important;
    }

    .oto-consent-modal__content {
        padding: 20px;
        width: 95%;
    }

    .oto-consent-modal__actions {
        flex-direction: column;
    }

    .oto-consent-modal__actions .oto-consent-btn {
        width: 100%;
        text-align: center;
    }
}
