/* ═══════════════════════════════════════════════════════════
   IJS Website - Popup & Cookie Consent
   ═══════════════════════════════════════════════════════════ */

/* ── Site Popup ── */
.site-popup {
    position: fixed;
    z-index: var(--z-popup);
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    max-width: 90vw;
}

.site-popup-content {
    position: relative;
}

.site-popup-content img {
    display: block;
    width: 100%;
    height: auto;
}

.site-popup-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--text-lg);
    transition: background var(--transition-fast);
}

.site-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.site-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--ijs-bg-gray);
    font-size: var(--text-sm);
}

.site-popup-today {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    color: var(--ijs-text-light);
}

.site-popup-today input {
    accent-color: var(--ijs-primary);
}

/* ── Cookie Consent ── */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-popup);
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
}

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

.cookie-consent-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-5) var(--space-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-title {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--ijs-dark);
    margin-bottom: var(--space-1);
}

.cookie-consent-message {
    font-size: var(--text-sm);
    color: var(--ijs-text-light);
    line-height: var(--leading-relaxed);
}

.cookie-consent-actions {
    display: flex;
    gap: var(--space-3);
    flex-shrink: 0;
}

.cookie-consent-settings {
    display: none;
    padding: var(--space-4) var(--space-8);
    border-top: 1px solid var(--ijs-border-light);
    max-width: var(--container-max);
    margin: 0 auto;
}

.cookie-consent-settings.active {
    display: block;
}

.cookie-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ijs-border-light);
}

.cookie-setting-item:last-child {
    border-bottom: none;
}

.cookie-setting-label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.cookie-setting-desc {
    font-size: var(--text-xs);
    color: var(--ijs-text-muted);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ijs-border);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--ijs-primary);
}

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

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Cookie consent responsive ── */
@media (max-width: 768px) {
    .cookie-consent-inner {
        flex-direction: column;
        padding: var(--space-4);
        gap: var(--space-4);
    }

    .cookie-consent-actions {
        width: 100%;
    }

    .cookie-consent-actions .btn {
        flex: 1;
    }
}
