/* wpTruss Consent Manager - Frontend Styles */

/* ============================================================
   CSS VARIABLES (defaults — overridden by inline style on banner)
   ============================================================ */
#wpcm-banner {
    --wpcm-bg:           #ffffff;
    --wpcm-text:         #333333;
    --wpcm-accept-bg:    #2271b1;
    --wpcm-accept-text:  #ffffff;
    --wpcm-decline-bg:   #f0f0f0;
    --wpcm-decline-text: #555555;
    --wpcm-radius:       8px;
    --wpcm-shadow:       0 4px 24px rgba(0, 0, 0, 0.12);
    --wpcm-transition:   0.3s ease;
}

/* ============================================================
   BASE BANNER
   ============================================================ */
#wpcm-banner {
    position: fixed;
    z-index: 999999;
    background: var(--wpcm-bg);
    color: var(--wpcm-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    transition: opacity var(--wpcm-transition), transform var(--wpcm-transition);
}

#wpcm-banner.wpcm-hidden {
    opacity: 0;
    pointer-events: none;
}

#wpcm-banner.wpcm-visible {
    opacity: 1;
    pointer-events: auto;
}

#wpcm-banner * {
    box-sizing: border-box;
}

/* ============================================================
   LAYOUT 1 — BAR (full width, bottom)
   ============================================================ */
#wpcm-banner.wpcm-layout-bar {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
}

#wpcm-banner.wpcm-layout-bar .wpcm-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

#wpcm-banner.wpcm-layout-bar .wpcm-heading {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
}

#wpcm-banner.wpcm-layout-bar .wpcm-body {
    margin: 0;
    flex: 1;
    min-width: 200px;
}

#wpcm-banner.wpcm-layout-bar .wpcm-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

#wpcm-banner.wpcm-layout-bar .wpcm-toggles {
    width: 100%;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 12px;
    margin-top: 4px;
}

/* ============================================================
   LAYOUT 2 — CARD (bottom corner)
   ============================================================ */
#wpcm-banner.wpcm-layout-card {
    width: 360px;
    max-width: calc(100vw - 32px);
    border-radius: var(--wpcm-radius);
    box-shadow: var(--wpcm-shadow);
    padding: 24px;
    bottom: 24px;
}

#wpcm-banner.wpcm-layout-card.wpcm-pos-bottom-right {
    right: 24px;
    transform: translateY(16px);
}

#wpcm-banner.wpcm-layout-card.wpcm-pos-bottom-right.wpcm-visible {
    transform: translateY(0);
}

#wpcm-banner.wpcm-layout-card.wpcm-pos-bottom-left {
    left: 24px;
    transform: translateY(16px);
}

#wpcm-banner.wpcm-layout-card.wpcm-pos-bottom-left.wpcm-visible {
    transform: translateY(0);
}

#wpcm-banner.wpcm-layout-card .wpcm-heading {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

#wpcm-banner.wpcm-layout-card .wpcm-body {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--wpcm-text);
    opacity: 0.85;
}

#wpcm-banner.wpcm-layout-card .wpcm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

#wpcm-banner.wpcm-layout-card .wpcm-btn {
    width: 100%;
    justify-content: center;
}

#wpcm-banner.wpcm-layout-card .wpcm-privacy-link {
    text-align: center;
}

/* ============================================================
   LAYOUT 3 — FLOATING (bottom center)
   ============================================================ */
#wpcm-banner.wpcm-layout-floating {
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 580px;
    max-width: calc(100vw - 32px);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    padding: 28px 32px;
}

#wpcm-banner.wpcm-layout-floating.wpcm-hidden {
    transform: translateX(-50%) translateY(20px);
}

#wpcm-banner.wpcm-layout-floating.wpcm-visible {
    transform: translateX(-50%) translateY(0);
}

#wpcm-banner.wpcm-layout-floating .wpcm-heading {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
}

#wpcm-banner.wpcm-layout-floating .wpcm-body {
    margin: 0 0 20px;
    font-size: 14px;
    opacity: 0.85;
}

#wpcm-banner.wpcm-layout-floating .wpcm-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.wpcm-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.wpcm-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

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

.wpcm-btn--accept {
    background: var(--wpcm-accept-bg);
    color: var(--wpcm-accept-text);
}

.wpcm-btn--decline {
    background: var(--wpcm-decline-bg);
    color: var(--wpcm-decline-text);
}

.wpcm-btn--selected {
    background: transparent;
    color: var(--wpcm-accept-bg);
    border: 2px solid var(--wpcm-accept-bg);
    padding: 8px 18px;
}

.wpcm-privacy-link {
    font-size: 12px;
    color: var(--wpcm-text);
    opacity: 0.6;
    text-decoration: underline;
    display: inline-block;
    margin-left: 4px;
}

.wpcm-privacy-link:hover {
    opacity: 1;
}

/* ============================================================
   GRANULAR TOGGLES
   ============================================================ */
.wpcm-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.wpcm-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.wpcm-toggle-row:last-child {
    border-bottom: none;
}

.wpcm-toggle-info {
    flex: 1;
}

.wpcm-toggle-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.wpcm-toggle-info span {
    font-size: 12px;
    opacity: 0.65;
}

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

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

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

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

.wpcm-switch input:checked + .wpcm-slider {
    background: var(--wpcm-accept-bg);
}

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

.wpcm-switch--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpcm-switch--disabled .wpcm-slider {
    cursor: not-allowed;
}

/* ============================================================
   OVERLAY (floating layout optional)
   ============================================================ */
.wpcm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wpcm-overlay.wpcm-visible {
    opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {

    #wpcm-banner.wpcm-layout-bar .wpcm-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    #wpcm-banner.wpcm-layout-bar .wpcm-actions {
        width: 100%;
    }

    #wpcm-banner.wpcm-layout-card {
        width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    #wpcm-banner.wpcm-layout-card.wpcm-pos-bottom-right,
    #wpcm-banner.wpcm-layout-card.wpcm-pos-bottom-left {
        left: 12px;
        right: 12px;
    }

    #wpcm-banner.wpcm-layout-floating {
        bottom: 12px;
        padding: 20px;
    }

    .wpcm-btn {
        width: 100%;
        justify-content: center;
    }
}
