/* Branch Widget Styles */
.branch-widget-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.branch-main-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.branch-content {
    display: flex;
    gap: 20px;
    min-height: 600px;
}

/* Sidebar Styles */
.branch-sidebar {
    flex: 0 0 400px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.branch-sidebar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
}

.branch-controls {
    margin-bottom: 25px;
}

.branch-dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.branch-dropdown:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.find-nearest-btn {
    width: 100%;
    padding: 12px 16px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.find-nearest-btn:hover {
    background: #4338ca;
}

/* Branch List Styles */
.branch-list {
    max-height: 500px;
    overflow-y: auto;
}

.branch-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.branch-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.branch-item.active {
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.branch-item .branch-image {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    float: left;
    margin-right: 15px;
}

.branch-item .branch-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.branch-info {
    overflow: hidden;
}

.branch-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.branch-address {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.branch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.phone-btn {
    background: #06b6d4;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.phone-btn:hover {
    background: #0891b2;
    text-decoration: none;
    color: white;
}

.appointment-btn {
    background: #7c3aed;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.appointment-btn:hover {
    background: #6d28d9;
}

/* Gallery Section - Multi-column Layout */
.branch-gallery {
    flex: 1;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
}

.gallery-container {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.gallery-slides {
    display: none;
    height: 100%;
    width: 100%;
}

.gallery-slides.active {
    display: block;
}

.gallery-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
    gap: 10px;
}

/* Multi-column layout based on data-columns attribute */
.gallery-container[data-columns="2"] .gallery-slide {
    flex: 0 0 calc(50% - 5px);
}

.gallery-container[data-columns="3"] .gallery-slide {
    flex: 0 0 calc(33.333% - 7px);
}

.gallery-container[data-columns="4"] .gallery-slide {
    flex: 0 0 calc(25% - 8px);
}

.gallery-slide {
    height: 100%;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-slide:hover img {
    transform: scale(1.05);
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
}

.gallery-prev {
    left: 15px;
}

.gallery-next {
    right: 15px;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Map Section */
.branch-map {
    height: 300px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.map-container {
    height: 100%;
    display: none;
}

.map-container.active {
    display: block;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.map-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .branch-content {
        flex-direction: column;
    }
    
    .branch-sidebar {
        flex: none;
    }
    
    .branch-main-title {
        font-size: 2rem;
    }
    
    .branch-actions {
        flex-direction: column;
    }
    
    .phone-btn,
    .appointment-btn {
        text-align: center;
        justify-content: center;
    }
    
    /* Mobile gallery adjustments */
    .gallery-container[data-columns="3"] .gallery-slide,
    .gallery-container[data-columns="4"] .gallery-slide {
        flex: 0 0 calc(50% - 5px);
    }
}

@media (max-width: 480px) {
    .branch-widget-container {
        padding: 15px;
    }
    
    .branch-main-title {
        font-size: 1.8rem;
    }
    
    .branch-sidebar {
        padding: 15px;
    }
    
    .branch-item {
        padding: 12px;
    }
    
    .branch-item .branch-image {
        width: 60px;
        height: 45px;
        margin-right: 10px;
    }
    
    .branch-name {
        font-size: 1.1rem;
    }
    
    .gallery-container {
        height: 250px;
    }
    
    .branch-map {
        height: 250px;
    }
    
    /* Single column on very small screens */
    .gallery-container[data-columns="2"] .gallery-slide,
    .gallery-container[data-columns="3"] .gallery-slide,
    .gallery-container[data-columns="4"] .gallery-slide {
        flex: 0 0 100%;
    }
    
    .gallery-track {
        gap: 0;
    }
}

/* Loading States */
.branch-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.gallery-slides.loading {
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slides.loading::after {
    content: "Loading...";
    color: #64748b;
    font-size: 1.1rem;
}

/* Animation for smooth transitions */
.branch-item {
    animation: fadeInUp 0.3s ease-out;
}

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

.gallery-slides {
    transition: opacity 0.3s ease-in-out;
}

.map-container {
    transition: opacity 0.3s ease-in-out;
}

