/**
 * CC TopBar Module - Styles
 * 
 * @author Carlos Casado
 */

#cc-topbar {
    width: 100%;
    font-size: 13px;
    line-height: 1.4;
    z-index: 1000;
}

.cc-topbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Schedule section */
.cc-topbar-schedule {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.cc-topbar-schedule-link {
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.cc-topbar-schedule-link:hover {
    opacity: 0.85;
    text-decoration: none;
}

.cc-topbar-schedule-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cc-topbar-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.cc-topbar-status-dot.open {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.cc-topbar-status-dot.closing-soon {
    background-color: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
}

.cc-topbar-status-dot.closed {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.cc-topbar-status-text {
    font-weight: 500;
}

.cc-topbar-status-text .status-main {
    font-weight: 600;
}

.cc-topbar-status-text .status-secondary {
    opacity: 0.85;
    font-weight: 400;
}

/* Right side */
.cc-topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Contact links */
.cc-topbar-contact {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.cc-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.cc-topbar-link:hover {
    opacity: 1;
    text-decoration: none;
}

.cc-topbar-link svg {
    flex-shrink: 0;
}

.cc-topbar-whatsapp {
    background-color: rgba(37, 211, 102, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
}

.cc-topbar-whatsapp:hover {
    background-color: rgba(37, 211, 102, 0.25);
}

/* Social links */
.cc-topbar-social {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.cc-topbar-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
}

.cc-topbar-social-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    text-decoration: none;
}

.cc-topbar-social-link svg {
    width: 14px;
    height: 14px;
}

/* Loading state */
.cc-topbar-loading {
    opacity: 0.7;
    font-style: italic;
}

/* Responsive */
@media (max-width: 991px) {
    .cc-topbar-container {
        justify-content: center;
        text-align: center;
    }

    .cc-topbar-schedule {
        width: 100%;
        justify-content: center;
    }

    .cc-topbar-right {
        width: 100%;
        justify-content: center;
    }

    .cc-topbar-contact {
        justify-content: center;
    }

    .cc-topbar-social {
        border-left: none;
        padding-left: 0;
    }
}

@media (max-width: 575px) {
    #cc-topbar {
        font-size: 12px;
    }

    .cc-topbar-container {
        padding: 6px 15px;
    }

    .cc-topbar-link span {
        display: none;
    }

    .cc-topbar-whatsapp span {
        display: inline;
    }

    .cc-topbar-contact {
        gap: 10px;
    }

    .cc-topbar-social {
        gap: 8px;
    }

    .cc-topbar-social-link {
        width: 26px;
        height: 26px;
    }
}

/* Language selector relocated into topbar */
.cc-topbar-lang {
    display: flex;
    align-items: center;
}

.cc-topbar-lang-widget {
    position: relative;
}

/* Trigger button */
.cc-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    padding: 3px 8px 3px 6px;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
    outline: none;
    white-space: nowrap;
}

.cc-lang-btn:hover,
.cc-lang-btn[aria-expanded="true"] {
    border-color: rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.06);
}

.cc-lang-flag-emoji {
    font-size: 14px;
    line-height: 1;
    display: block;
}

.cc-lang-code {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cc-lang-chevron {
    width: 10px;
    height: 10px;
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.18s ease;
    flex-shrink: 0;
}

.cc-lang-btn[aria-expanded="true"] .cc-lang-chevron {
    transform: rotate(180deg);
    opacity: 0.8;
}

/* Dropdown */
.cc-lang-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 1001;
    min-width: 148px;
    list-style: none;
    background: #1e1e38;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
    padding: 4px;
    margin: 0;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
    pointer-events: none;
}

.cc-lang-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
    pointer-events: auto;
}

.cc-lang-dropdown li {
    padding: 0;
    list-style: none;
}

.cc-lang-dropdown li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
    border-radius: 4px;
    transition: background 0.12s ease, color 0.12s ease;
    letter-spacing: 0.01em;
}

.cc-lang-dropdown li a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
}

.cc-lang-dropdown li.current a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.cc-lang-dropdown li.current a .cc-lang-name {
    font-weight: 600;
}

.cc-lang-dropdown li.current a::after {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22c55e;
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
}

.cc-lang-name {
    flex: 1;
    font-size: 12px;
}

/* Hide on mobile — theme handles mobile separately */
@media (max-width: 991px) {
    .cc-topbar-lang {
        display: none;
    }
}