/* ============================================
   UI-OVERLAYS — Preloader, FAB, Back-to-top, Lightbox, Modal, Nav Overlay
   ============================================ */

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--night);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    text-align: center;
    color: var(--gold);
}

.preloader-flame {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(212, 168, 83, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.preloader-inner p {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    letter-spacing: 2px;
}

/* ============================================
   FLOATING ACTIONS
   ============================================ */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s var(--ease);
}

.fab-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.fab {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all 0.3s var(--ease);
    box-shadow: var(--shadow-heavy);
    gap: 8px;
}

.fab-call {
    width: 50px;
    height: 50px;
    background: #25D366;
    color: var(--white);
    animation: fabPulse 2.5s infinite;
}

.fab-label {
    display: none;
    font-size: 0.8rem;
    font-weight: 600;
}

.fab-call:hover { transform: scale(1.1); }
.fab-call:hover .fab-label { display: block; }

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.4), var(--shadow-heavy); }
    50% { box-shadow: 0 0 0 14px rgba(37,211,102,0), var(--shadow-heavy); }
}

.fab-zalo {
    width: 50px;
    height: 50px;
    background: #0068FF;
    color: var(--white);
}

.fab-zalo:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(0,104,255,0.15), var(--shadow-heavy);
}

.fab-zalo-icon {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.fab-book {
    padding: 14px 26px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--night);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.fab-book:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold), var(--shadow-heavy);
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999;
    width: 44px;
    height: 44px;
    background: var(--white);
    color: var(--night-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease);
    border: 1px solid var(--border);
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-3px); background: var(--gold); color: var(--night); }

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
    animation: lightboxIn 0.3s ease;
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 2.5rem;
    color: var(--white);
    transition: all 0.3s;
    line-height: 1;
    z-index: 1;
}

.lightbox-close:hover { transform: scale(1.2); color: var(--gold); }

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    color: var(--white);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    padding: 14px 18px;
    border-radius: var(--radius);
    transition: all 0.3s;
    z-index: 1;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.15); }

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

/* ============================================
   SUCCESS MODAL
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-heavy);
    animation: modalIn 0.4s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #059669, #10B981);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
}

.modal-content h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--night-soft);
}

.modal-content p {
    color: var(--smoke);
    margin-bottom: 8px;
    line-height: 1.6;
}

.modal-phone {
    margin-bottom: 24px !important;
    font-weight: 600;
    color: var(--night-soft) !important;
}

.modal-phone a { color: var(--sunset-deep); }

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.nav-overlay.active { display: block; }
