/**
 * Category Time Availability - Styles
 * Version: 2.0.0
 */

/* =========================================
   SCROLL LOCK - overflow:hidden approach (no scroll jump)
   ========================================= */
html.cta-modal-open,
html.cta-modal-open body {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

/* =========================================
   INFO BANNER
   ========================================= */
.cta-banner {
    background: #fff3cd;
    color: #333;
    border: 1px solid #ffe69c;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 8px 0 14px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}


.cta-banner.cta-closed {
    background: #f8d7da;
    border-color: #f5c2c7;
}

/* Green banner (when open) */
.cta-banner.cta-color-green {
    background: #d1e7dd;
    border-color: #badbcc;
}

.cta-banner-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d97706;
    width: 20px;
    height: 20px;
}

.cta-banner-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Green icon color */
.cta-banner.cta-color-green .cta-banner-icon {
    color: #1e6f43;
}

.cta-banner.cta-closed .cta-banner-icon {
    color: #c62828;
}

.cta-banner-text {
    flex: 1;
}

/* Sticky banner */
.cta-banner.cta-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Fixed banner (full width at top) */
#cta-fixed-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-radius: 0;
    margin: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* Account for admin bar */
.admin-bar #cta-fixed-banner {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar #cta-fixed-banner {
        top: 46px;
    }
}

/* =========================================
   BLOCKED PRODUCT MODAL
   ========================================= */
.cta-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 10000; /* Above everything but reasonable */
    animation: ctaFadeIn 0.2s ease;
}

.cta-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes ctaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cta-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    position: relative;
    animation: ctaSlideUp 0.25s ease;
}

@keyframes ctaSlideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: transparent;
    color: #aaa;
    border: none;
    border-radius: 50%;
    font-size: 32px;
    font-weight: bold;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}

.cta-modal-close:hover {
    color: #333;
    background-color: #f0f0f0;
}

.cta-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.cta-modal-icon svg {
    width: 1em;
    height: 1em;
}

.cta-modal-message {
    font-size: 18px;
    color: #333;
    line-height: 1.5;
    padding: 16px;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 10px;
}

/* =========================================
   LOADING OVERLAY
   ========================================= */
.cta-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 5;
}

.cta-loading.active {
    display: flex;
}

.cta-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--wfs-primary-color, #267dc9);
    border-radius: 50%;
    animation: ctaSpin 0.8s linear infinite;
}

@keyframes ctaSpin {
    to { transform: rotate(360deg); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    .cta-banner {
        padding: 12px 14px;
        font-size: 17px;
        gap: 8px;
    }
    
    .cta-banner-icon {
        width: 22px;
        height: 22px;
    }
    
    .cta-modal-overlay.active {
        padding: 16px;
        box-sizing: border-box;
    }
    
    .cta-modal {
        padding: 24px 20px;
        border-radius: 12px;
        width: 100%;
        max-width: none;
        margin: 0;
    }
    
    .cta-modal-close {
        top: 10px;
        right: 10px;
    }
    
    .cta-modal-message {
        font-size: 18px;
        padding: 14px;
    }
    
    .cta-modal-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }
}

@media (max-width: 400px) {
    .cta-modal-overlay.active {
        padding: 12px;
    }
    
    .cta-modal {
        padding: 20px 16px;
        border-radius: 10px;
    }
    
    .cta-modal-close {
        top: 8px;
        right: 8px;
    }
    
    .cta-modal-message {
        font-size: 18px;
        padding: 12px;
        border-radius: 8px;
    }
    
    .cta-modal-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }
}
