/* =============================================
   ShipMint — Cookie Consent
   Non-blocking bottom banner, preferences panel,
   and persistent revisit widget
   ============================================= */

/* ─── Bottom Banner ─── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.cookie-banner.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cookie-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.cookie-banner-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--green));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cookie-banner-icon .material-symbols-outlined {
    font-size: 24px;
    color: var(--white);
}

.cookie-banner-text h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.cookie-banner-text p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.cookie-banner-text a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner-text a:hover {
    color: var(--blue-hover);
}

/* ─── Banner Actions ─── */
.cookie-banner-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 11px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    white-space: nowrap;
    text-align: center;
    font-family: var(--font-family);
}

.cookie-btn-primary {
    background: var(--blue);
    color: var(--white);
    box-shadow: 0 2px 12px var(--blue-glow);
}

.cookie-btn-primary:hover {
    background: var(--blue-hover);
    box-shadow: 0 4px 20px rgba(30, 144, 255, 0.35);
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--navy-border);
}

.cookie-btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--white);
}

.cookie-btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: var(--transition-fast);
    font-family: var(--font-family);
    text-align: center;
}

.cookie-btn-link:hover {
    color: var(--blue);
}


/* ─── Preferences Panel Overlay ─── */
.cookie-prefs-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cookie-prefs-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.cookie-prefs-panel {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-prefs-overlay.visible .cookie-prefs-panel {
    transform: translateY(0);
}

.cookie-prefs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cookie-prefs-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.cookie-prefs-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-prefs-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.cookie-prefs-intro {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 24px;
}


/* ─── Cookie Categories ─── */
.cookie-category {
    padding: 16px 0;
    border-top: 1px solid var(--navy-border);
}

.cookie-category:last-of-type {
    border-bottom: 1px solid var(--navy-border);
    margin-bottom: 24px;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.cookie-category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.cookie-category-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    background: rgba(50, 205, 50, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: 8px;
}

.cookie-category-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}


/* ─── Toggle Switch ─── */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

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

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--text-muted);
    border-radius: 12px;
    transition: background 0.25s ease;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: var(--blue);
}

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

/* Disabled (Strictly Necessary — always on) */
.cookie-toggle-disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-toggle-disabled .cookie-toggle-slider {
    background: var(--green);
}


/* ─── Preferences Footer ─── */
.cookie-prefs-footer {
    display: flex;
    justify-content: flex-end;
}

.cookie-prefs-footer .cookie-btn-primary {
    width: 100%;
}


/* ─── Revisit Widget ─── */
.cookie-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9997;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    /* display controlled by JS */
}

.cookie-widget .material-symbols-outlined {
    font-size: 22px;
    color: var(--blue);
}

.cookie-widget:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--blue-glow);
}


/* ─── Responsive ─── */
@media (max-width: 768px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding: 20px 20px;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .cookie-banner-content {
        gap: 12px;
    }

    .cookie-banner-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .cookie-banner-icon .material-symbols-outlined {
        font-size: 20px;
    }

    .cookie-banner-text h3 {
        font-size: 15px;
    }

    .cookie-banner-text p {
        font-size: 12px;
    }

    .cookie-banner-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .cookie-btn {
        flex: 1;
        min-width: 120px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .cookie-btn-link {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-banner-actions {
        flex-direction: column;
    }

    .cookie-btn {
        min-width: 0;
    }

    .cookie-prefs-panel {
        padding: 24px 20px;
        width: 96%;
    }
}
