/* ==========================================================================
   HAFA Single Service Template Styles
   Brand colors: #303E8C primary, #151D26 dark, #A3BAD9 light, #F2F2F2 bg
   Sidebar is LEFT in LTR (English) and automatically RIGHT in RTL (Arabic)
   via CSS logical properties (float/margin start/end), no JS needed.
   ========================================================================== */

:root {
    --hafa-primary: #303E8C;
    --hafa-dark: #151D26;
    --hafa-light: #A3BAD9;
    --hafa-bg: #F2F2F2;
}

/* ---------------------------- HERO BANNER ---------------------------- */
.hafa-service-hero {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    background-color: var(--hafa-dark);
    overflow: hidden;
}

.hafa-service-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.hafa-service-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(21, 29, 38, 0.92) 0%, rgba(48, 62, 140, 0.78) 100%);
}

.hafa-service-hero__content {
    position: relative;
    z-index: 2;
    padding: 60px 0;
    color: #fff;
}

.hafa-breadcrumb {
    font-size: 13px;
    margin-bottom: 16px;
    opacity: 0.85;
}

.hafa-breadcrumb a {
    color: #A3BAD9;
    text-decoration: none;
}

.hafa-breadcrumb a:hover {
    color: #fff;
}

.hafa-breadcrumb__sep {
    margin: 0 8px;
}

.hafa-service-hero__title {
    font-size: 38px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.hafa-service-hero__tagline {
    font-size: 17px;
    max-width: 640px;
    color: #F2F2F2;
    opacity: 0.92;
}

/* ---------------------------- MAIN LAYOUT ---------------------------- */
.hafa-service-layout {
    padding: 50px 0;
}

/* Sidebar: logical "start" side. In LTR this is left; WPML/RTL flips it
   automatically because we use flex with row-reverse triggered by the
   .rtl body class WordPress already adds for RTL languages. */
.hafa-service-layout .row {
    display: flex;
    flex-wrap: wrap;
}

body.rtl .hafa-service-layout .row {
    flex-direction: row-reverse;
}

.hafa-service-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---------------------------- SIDEBAR WIDGETS ---------------------------- */
.hafa-sidebar-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 22px;
}

.hafa-sidebar-widget__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--hafa-dark);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--hafa-primary);
}

.hafa-service-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hafa-service-menu-list__item {
    border-bottom: 1px solid #f0f0f0;
}

.hafa-service-menu-list__item:last-child {
    border-bottom: none;
}

.hafa-service-menu-list__item a {
    display: block;
    padding: 10px 4px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s ease, padding-inline-start 0.15s ease;
}

.hafa-service-menu-list__item a:hover {
    color: var(--hafa-primary);
    padding-inline-start: 8px;
}

.hafa-service-menu-list__item.is-active a {
    color: var(--hafa-primary);
    font-weight: 700;
    border-inline-start: 3px solid var(--hafa-primary);
    padding-inline-start: 10px;
}

.hafa-sidebar-widget__back-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px;
    color: var(--hafa-primary);
    text-decoration: underline;
}

/* Support banner */
.hafa-sidebar-support-banner {
    background: var(--hafa-primary);
    color: #fff;
    text-align: center;
}

.hafa-support-banner__icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--hafa-light);
    margin-bottom: 10px;
}

.hafa-support-banner__title {
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
}

.hafa-support-banner__text {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.hafa-support-banner__cta {
    background: #fff;
    color: var(--hafa-primary) !important;
    border: none;
    padding: 10px 22px;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.hafa-support-banner__cta:hover {
    background: var(--hafa-light);
}

/* ---------------------------- MAIN CONTENT ---------------------------- */
.hafa-service-content {
    padding-inline-start: 30px;
}

body.rtl .hafa-service-content {
    padding-inline-start: 0;
    padding-inline-end: 30px;
}

.hafa-service-body {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.hafa-service-cta {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.hafa-btn-primary {
    background: var(--hafa-primary);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hafa-btn-primary:hover {
    background: var(--hafa-dark);
    color: #fff;
}

.hafa-btn-outline {
    background: transparent;
    border: 1.5px solid currentColor;
}

/* ---------------------------- RELATED SERVICES ---------------------------- */
.hafa-related-services {
    background: var(--hafa-bg);
    padding: 60px 0;
}

.hafa-related-services__title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--hafa-dark);
    margin-bottom: 36px;
}

.hafa-related-service-card {
    display: block;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 24px;
}

.hafa-related-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.hafa-related-service-card__image {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--hafa-light);
}

.hafa-related-service-card__title {
    color: var(--hafa-dark);
    font-size: 17px;
    font-weight: 700;
    padding: 16px 18px 6px;
}

.hafa-related-service-card__excerpt {
    color: #666;
    font-size: 13px;
    padding: 0 18px 18px;
    line-height: 1.6;
}

/* ---------------------------- RFQ POPUP ---------------------------- */
.hafa-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.hafa-popup.is-open {
    display: block;
}

.hafa-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(21, 29, 38, 0.6);
}

.hafa-popup__panel {
    position: relative;
    z-index: 1;
    background: #fff;
    max-width: 480px;
    margin: 6vh auto;
    padding: 36px;
    border-radius: 10px;
    max-height: 88vh;
    overflow-y: auto;
}

.hafa-popup__close {
    position: absolute;
    top: 14px;
    inset-inline-end: 18px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}

.hafa-popup__close:hover {
    color: var(--hafa-dark);
}

.hafa-popup__title {
    color: var(--hafa-dark);
    font-size: 22px;
    margin-bottom: 4px;
}

.hafa-popup__subtitle {
    color: var(--hafa-primary);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 20px;
}

.hafa-rfq-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--hafa-dark);
    margin-bottom: 4px;
}

.hafa-rfq-form input,
.hafa-rfq-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.hafa-rfq-form__submit {
    width: 100%;
    margin-top: 10px;
}

.hafa-rfq-success h3 {
    color: var(--hafa-primary);
}

body.hafa-popup-open {
    overflow: hidden;
}

/* ---------------------------- RESPONSIVE ---------------------------- */
@media (max-width: 991px) {
    .hafa-service-content {
        padding-inline-start: 0;
        margin-top: 30px;
    }

    body.rtl .hafa-service-content {
        padding-inline-end: 0;
    }

    .hafa-service-hero__title {
        font-size: 28px;
    }
}
