/* ============================================
   Branches Page Styles - صفحة الفروع
   رحى المكان - تصميم عصري واحترافي
   ============================================ */

/* Header Section */
.branches-header {
    position: relative;
    width: 100%;
    min-height: 40vh;
    background: linear-gradient(135deg, #5D4037 0%, #3E2723 50%, #4E342E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.branches-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 193, 7, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(216, 67, 21, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
    pointer-events: none;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(5px);
}

.header-text {
    margin-top: 1rem;
}

.brand-icon {
  width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    background: url(https://i.ibb.co/MD6z7WkK/image.png) #fff;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #3E2723;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(255, 193, 7, 0.5);
    }
}

.page-title {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

/* Main Branches Section */
.branches-main {
    padding: 3rem 1.5rem 4rem;
    background: linear-gradient(180deg, #f5f5f5 0%, #fafafa 100%);
    min-height: 60vh;
}

.branches-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Branch Card */
.branch-card {
    background: #fff;
    border-radius: 24px;
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: translateY(30px);
}

.branch-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.branch-card:nth-child(1) {
    transition-delay: 0.1s;
}

.branch-card:nth-child(2) {
    transition-delay: 0.2s;
}

.branch-card:nth-child(3) {
    transition-delay: 0.3s;
}

.branch-card:nth-child(4) {
    transition-delay: 0.4s;
}

.branch-card:nth-child(5) {
    transition-delay: 0.5s;
}

.branch-card:nth-child(6) {
    transition-delay: 0.6s;
}

.branch-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(93, 64, 55, 0.15);
}

/* Branch Map */
.branch-map {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

.branch-map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 70%, rgba(255, 255, 255, 0.3) 100%);
    pointer-events: none;
    z-index: 1;
}

.branch-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: saturate(0.9);
    transition: filter 0.3s ease;
}

.branch-card:hover .branch-map iframe {
    filter: saturate(1.1);
}

/* Branch Header - with icon and content */
.branch-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0;
}

.branch-header .branch-icon {
    flex-shrink: 0;
}

.branch-header .branch-content {
    flex: 1;
}

/* Branch Icon */
.branch-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f5f0eb 0%, #ebe4dc 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #5D4037;
    transition: all 0.3s ease;
}

.branch-card:hover .branch-icon {
    background: linear-gradient(135deg, #5D4037 0%, #8D6E63 100%);
    color: #fff;
    transform: rotate(-5deg) scale(1.1);
}

/* Branch Content */
.branch-content {
    flex: 1;
}

.branch-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3E2723;
    margin-bottom: 0.5rem;
}

.branch-description {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #795548;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.branch-description i {
    color: #D84315;
}

/* Branch Features */
.branch-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #f8f5f2 0%, #f0ebe6 100%);
    border-radius: 20px;
    font-size: 0.8rem;
    color: #5D4037;
    font-weight: 500;
    transition: all 0.3s ease;
}

.feature-tag i {
    font-size: 0.75rem;
    color: #8D6E63;
}

.branch-card:hover .feature-tag {
    background: linear-gradient(135deg, #5D4037 0%, #6D4C41 100%);
    color: #fff;
}

.branch-card:hover .feature-tag i {
    color: rgba(255, 255, 255, 0.8);
}

/* Branch Button */
.branch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    margin: 1rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, #5D4037 0%, #4E342E 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.branch-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.branch-btn:hover::before {
    left: 100%;
}

.branch-btn:hover {
    background: linear-gradient(135deg, #D84315 0%, #BF360C 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(216, 67, 21, 0.3);
}

.branch-btn i {
    transition: transform 0.3s ease;
}

.branch-btn:hover i {
    transform: translateX(-5px);
}

/* Contact CTA Section - قسم التواصل */
.contact-cta-section {
    margin-top: 4rem;
    text-align: center;
}

.contact-cta-content {
    max-width: 500px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
    border-radius: 28px;
    position: relative;
    overflow: hidden;
}

.contact-cta-content::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.contact-cta-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.contact-cta-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.contact-cta-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-contact {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.instagram-contact {
    background: linear-gradient(135deg, #E1306C 0%, #C13584 50%, #833AB4 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.instagram-contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(225, 48, 108, 0.5);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .branches-header {
        min-height: 35vh;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .brand-icon {
        width: 250px;
        height: 250px;
        font-size: 1.8rem;
    }

    .branches-main {
        padding: 1.5rem 0.75rem 3rem;
    }

    .branches-container {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .branch-card {
        border-radius: 20px;
    }

    .branch-map {
        height: 180px;
        border-radius: 20px 20px 0 0;
    }

    .branch-header {
        padding: 1.2rem 1.2rem 0;
        gap: 0.8rem;
    }

    .branch-name {
        font-size: 1.2rem;
    }

    .branch-description {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .branch-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        border-radius: 12px;
    }

    .branch-btn {
        margin: 0.8rem 1.2rem 1.2rem;
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    .map-cta-content {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        margin: 0 -0.5rem;
    }

    .map-cta-title {
        font-size: 1.4rem;
    }

    .map-cta-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-divider {
        height: 30px;
    }
}

@media (max-width: 480px) {
    .branches-header {
        min-height: 28vh;
    }

    .header-content {
        padding: 1.5rem 1rem;
    }

    .back-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.9rem;
        margin-bottom: 1.5rem;
    }

    .brand-icon {
        width: 180px;
        height: 180px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .branches-main {
        padding: 1rem 0.5rem 2rem;
    }

    .branches-container {
        gap: 1rem;
    }

    .branch-card {
        border-radius: 16px;
    }

    .branch-map {
        height: 160px;
        border-radius: 16px 16px 0 0;
    }

    .branch-header {
        padding: 1rem 1rem 0;
        gap: 0.7rem;
    }

    .branch-name {
        font-size: 1.1rem;
    }

    .branch-description {
        font-size: 0.85rem;
        gap: 0.4rem;
    }

    .branch-description i {
        font-size: 0.85rem;
    }

    .branch-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .branch-btn {
        margin: 0.7rem 1rem 1rem;
        padding: 0.8rem 0.9rem;
        font-size: 0.9rem;
        gap: 0.5rem;
        border-radius: 10px;
    }

    .branch-btn i {
        font-size: 0.9rem;
    }

    .branch-features {
        gap: 0.4rem;
    }

    .feature-tag {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .branches-header {
        min-height: 25vh;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .branch-map {
        height: 140px;
    }

    .branch-header {
        padding: 0.8rem 0.8rem 0;
    }

    .branch-name {
        font-size: 1rem;
    }

    .branch-btn {
        margin: 0.6rem 0.8rem 0.8rem;
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Smooth Transitions for All Interactive Elements */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Focus States for Accessibility */
.branch-btn:focus,
.back-link:focus {
    outline: 2px solid #FFC107;
    outline-offset: 3px;
}

/* Print Styles */
@media print {
    .branches-header {
        min-height: auto;
        padding: 2rem;
        background: #5D4037 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .branch-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .branch-btn {
        background: #5D4037 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}