/* ========================================
   🎯 BRANCH PAGES ONLY - branch-styles.css
   ========================================
   This file contains styles ONLY for branch pages
   (waziriyah.html, sanabel.html, hamdaniyah.html)
   ======================================== */

/* ========= LOADING SPINNER ========= */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #eae3da;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ========= IMAGE MODAL ========= */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.image-modal.active {
    display: flex;
}

.modal-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }

.modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: #0f172a;
}

/* ========= MENU ITEMS ========= */
.menu-item { 
    cursor: pointer; 
}

.category {
    border-bottom: 0px solid rgba(25, 41, 61, 0.3);
    padding-bottom: 30px;
    margin-bottom: 30px;
}

.category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.multi-image-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
}

/* ========= BRANCH GALLERY ========= */
.branch-gallery {
    padding: 30px 20px 40px;
    background: var(--secondary);
    direction: ltr;
}

[data-theme="dark"] .branch-gallery {
    background: var(--primary);
}

.gallery-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    direction: rtl;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.gallery-grid img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .gallery-grid img {
        height: 180px;
    }
    
    .gallery-title {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .branch-gallery {
        padding: 40px 40px 50px;
    }
    
    .gallery-grid {
        max-width: 900px;
        gap: 20px;
    }
    
    .gallery-grid img {
        height: 200px;
    }
}

/* ========= STICKY POSITIONING - ZERO GAPS ========= */
/* ========= OVERRIDE - Blue Header Height ========= */
body[data-branch] .header.header-sticky {
    padding: 30px 20px !important;
}

.header-sticky {
    position: sticky !important;
    top: 50px !important;
    z-index: 99 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    margin: 0 !important;
}

/* 🎯 BOTH Menu Header AND Category Tabs are sticky */
body[data-branch] .menu-header {
    position: sticky !important;
    top: 163px !important; /* 50px nav + 113px header = 163px */
    z-index: 97 !important;
    background: var(--primary) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    padding: 8px 20px !important;
    margin: 0 !important;
}

.menu-header h2 {
    font-size: 0.95rem !important;
    margin: 0 !important;
    font-weight: 600 !important;
}

/* Category tabs stick below menu header */
.category-tabs-sticky,
.category-tabs {
    position: sticky !important;
    top: 209px !important; /* 50px nav + 113px header + 46px menu = 209px */
    z-index: 98 !important;
    background: var(--primary) !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    margin: 0 !important;
    gap: 6px !important;
}

.category-tab {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
}

[data-theme="light"] .category-tabs-sticky,
[data-theme="light"] .category-tabs {
    background: var(--secondary) !important;
}

[data-theme="light"] .menu-header {
    background: var(--primary) !important;
}

/* ========= TABLET RESPONSIVE ========= */
@media (min-width: 768px) {
    .header-sticky {
        top: 56px !important;
    }
    
    body[data-branch] .menu-header {
        top: 169px !important; /* 56px nav + 113px header = 169px */
    }
    
    .menu-header h2 {
        font-size: 1.1rem !important;
    }
    
    .category-tabs-sticky,
    .category-tabs {
        top: 215px !important; /* 56px nav + 113px header + 46px menu = 215px */
    }
    
    .category-tab {
        font-size: 0.85rem !important;
        padding: 8px 14px !important;
    }
}