/* Impact Contact Blocks Styles */

/* Google Fonts should be loaded by theme or globally */

.icb-contact-branches {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
    justify-content: center;
    justify-items: center;
    --icb-accent-color: #FEBCB0;
    --icb-border-color: #FEBCB0;
    --icb-text-color: #141414;
}

.icb-layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.icb-layout-list {
    grid-template-columns: 1fr;
}

.icb-branch-card {
    background: #ffffff;
    border-radius: 12px;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 1200px;
    justify-self: center;
    box-sizing: border-box;
}

.icb-branch-card:hover {
    transform: translateY(-4px);
    /* box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); */
}

.icb-branch-header {
    background: transparent;
    padding: 0 0 1rem 0;
    margin-bottom: 1rem;
}

.icb-branch-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--icb-accent-color, #FEBCB0);
    font-family: var(--wp--preset--font-family--tajawal), "Playfair Display", serif;
}

.icb-branch-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1200px) {
    .icb-branch-content {
        /* grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); */
        grid-template-columns: 420px 1fr;
        gap: 2rem;
        align-items: stretch;
    }
}

.icb-branch-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.icb-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.icb-info-item:last-child {
    margin-bottom: 0;
}

.icb-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: 2px solid var(--icb-border-color, var(--icb-accent-color, #FEBCB0));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icb-accent-color, #FEBCB0);
}

.icb-icon-home::before {
    content: "🏠";
    font-size: 16px;
}

.icb-icon-mail::before {
    content: "✉️";
    font-size: 16px;
}

.icb-icon-phone::before {
    content: "📞";
    font-size: 16px;
}

/* Custom Icon Styles */
.icb-custom-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Google Maps Styles */
.icb-google-map {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

.icb-info-content {
    flex: 1;
    min-width: 0;
}

.icb-label {
    display: block;
    font-weight: 600;
    color: var(--icb-accent-color, #FEBCB0);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--wp--preset--font-family--tajawal), 'Playfair Display', serif;
}

.icb-value {
    display: block;
    color: var(--icb-text-color, #141414);
    font-size: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
    font-family: var(--wp--preset--font-family--tajawal), 'Manrope', sans-serif;
}

.icb-phone-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.icb-phone-number {
    color: var(--icb-text-color, #141414);
    font-size: 1rem;
    font-family: var(--wp--preset--font-family--tajawal), 'Manrope', sans-serif;
    font-weight: 500;
    display: inline-block;
}

.icb-phone-number:not(:last-child)::after {
    content: " - ";
    margin-left: 0.25rem;
    color: #666;
}

.icb-branch-map {
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    position: relative;
    min-height: 250px;
    height: 100%;
    width: 100%;
    max-width: 400px;
    border-radius: 0 12px 12px 0;
    overflow: hidden;
    box-shadow: 0 14px 28px -16px rgba(0, 0, 0, 0.22), 12px 14px 24px -18px rgba(0, 0, 0, 0.16), -12px 14px 24px -18px rgba(0, 0, 0, 0.16);
}

.icb-map-container {
    width: 100%;
    height: 100%;
    position: relative;
    min-height: 250px;
}

.icb-map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

.icb-map-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.icb-map-placeholder img {
    max-width: 100%;
    height: auto;
    opacity: 0.6;
}

.icb-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin: 1rem 0;
    text-align: center;
}

/* Arabic/RTL Support */
[data-language="ar"] .icb-contact-branches {
    direction: rtl;
}

[data-language="ar"] .icb-branch-card {
    direction: rtl;
    text-align: right;
}

[data-language="ar"] .icb-branch-info {
    direction: rtl;
    text-align: right;
}

[data-language="ar"] .icb-info-item {
    flex-direction: row-reverse !important;
    text-align: right;
}

/* Specific targeting for Arabic icons */
[data-language="ar"] .icb-info-item .icb-icon {
    order: 2 !important;
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

[data-language="ar"] .icb-info-item .icb-info-content {
    order: 1 !important;
}

[data-language="ar"] .icb-info-content {
    text-align: right;
}

[data-language="ar"] .icb-branch-content {
    grid-template-columns: 1fr;
}

@media (min-width: 1200px) {
    [data-language="ar"] .icb-branch-content {
        grid-template-columns: 420px 1fr;
    }
}

[data-language="ar"] .icb-phone-numbers {
    justify-content: flex-start !important;
    text-align: right !important;
    direction: rtl !important;
}

[data-language="ar"] .icb-phone-number {
    direction: ltr !important;
}

[data-language="ar"] .icb-branch-header {
    text-align: right;
}

[data-language="ar"] .icb-branch-map {
    border-left: none;
    border-right: 1px solid #e9ecef;
    border-radius: 12px 0 0 12px;
}

/* Additional RTL fixes for icons */
[data-language="ar"] .icb-address,
[data-language="ar"] .icb-email,
[data-language="ar"] .icb-phone {
    flex-direction: row-reverse !important;
    gap: 1rem !important;
}

[data-language="ar"] .icb-address .icb-icon,
[data-language="ar"] .icb-email .icb-icon,
[data-language="ar"] .icb-phone .icb-icon {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

/* Specific RTL class for Arabic layouts */
.icb-rtl {
    flex-direction: row-reverse !important;
    direction: rtl !important;
    text-align: right !important;
}

.icb-rtl .icb-icon {
    margin-left: 1rem !important;
    margin-right: 0 !important;
    order: 2 !important;
}

.icb-rtl .icb-info-content {
    order: 1 !important;
    text-align: right !important;
    direction: rtl !important;
}

/* Fix phone numbers alignment for Arabic */
.icb-rtl .icb-phone-numbers {
    direction: rtl !important;
    justify-content: flex-start !important;
    text-align: right !important;
}

.icb-rtl .icb-phone-number {
    direction: ltr !important;
    display: inline-block !important;
}

/* Responsive Design */
@media (max-width: 767px) {
    .icb-contact-branches {
        gap: 1.5rem;
    }
    
    .icb-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .icb-branch-content {
        grid-template-columns: 1fr !important;
    }
    
    .icb-branch-map {
        border-left: none;
        border-top: 1px solid #e9ecef;
        min-height: 200px;
        border-radius: 0 0 12px 12px;
    }
    
    /* RTL Mobile Support */
    [data-language="ar"] .icb-branch-map {
        border-left: none;
        border-right: none;
        border-top: 1px solid #e9ecef;
        border-radius: 0 0 12px 12px;
    }
    
    .icb-branch-header {
        padding: 1rem;
    }
    
    .icb-branch-title {
        font-size: 1.25rem;
    }
    
    .icb-branch-info {
        padding: 1rem;
    }
    
    .icb-info-item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .icb-icon {
        width: 32px;
        height: 32px;
    }
    
    .icb-icon-home::before,
    .icb-icon-mail::before,
    .icb-icon-phone::before {
        font-size: 14px;
    }
    
    .icb-label {
        font-size: 0.8rem;
    }
    
    .icb-value {
        font-size: 0.9rem;
    }
}

/* Loading State */
.icb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #666;
}

.icb-loading::before {
    content: "";
    width: 24px;
    height: 24px;
    border: 2px solid var(--icb-accent-color, #FEBCB0);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: icb-spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes icb-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}