/* ==========================================================================
   1. المتغيرات والتنسيق الأساسي (Mobile-First)
   ========================================================================== */
:root {
    --primary-color: #8a6d3b;
    --primary-hover: #72582e;
    --secondary-color: #2c2c2c;
    --bg-cream: #fcf9f5;
    --accent-gold: #c5a059;
    --text-dark: #222222;
    --text-muted: #666666;
    --card-shadow: 0 8px 24px rgba(0,0,0,0.06);
    --modal-shadow: 0 15px 40px rgba(0,0,0,0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

.section-header-text {
    text-align: center;
    margin-bottom: 28px;
}

.section-header-text h2 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin: 0 0 6px;
    font-weight: 700;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-gold {
    background: var(--accent-gold);
    color: #fff;
}

.hero-badge {
    background-color: rgba(138, 109, 59, 0.1);
    color: var(--primary-color);
    margin-bottom: 10px;
}

.aspect-4-5 {
    aspect-ratio: 4 / 5;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #f3efe6;
}

.aspect-4-5 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.placeholder-text-aspect {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    padding: 10px;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   2. Navbar & Hamburger Menu (قائمة الهامبرجر والمتجاوبة)
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    z-index: 1000;
    padding: 10px 0;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
}

.doctor-brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

.header-logo-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.motion-logo-slot {
    width: 110px;
    height: 38px;
    background-color: var(--bg-cream);
    border: 1px dashed var(--accent-gold);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.motion-logo-slot video,
.motion-logo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* زر الهامبرجر */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* تحويل الهامبرجر إلى علامة X عند الفتح */
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* القناع الخلفي للشاشات الصغيرة */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* القائمة الجانبية المنزلقة للموبايل */
@media (max-width: 767px) {
    .main-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background-color: #ffffff;
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        z-index: 1001;
        padding: 80px 24px 30px;
        transition: right 0.3s ease-in-out;
        display: flex;
        flex-direction: column;
    }

    .main-nav.active {
        right: 0;
    }

    .nav-links {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
        overflow-y: auto;
    }

    .nav-links a {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-dark);
        text-decoration: none;
        display: block;
        padding: 8px 0;
        border-bottom: 1px solid #f3efe6;
        transition: color 0.2s;
    }

    .nav-links a:hover {
        color: var(--primary-color);
    }
}

/* القائمة الأفقية الثابتة للسطح المكتب */
@media (min-width: 768px) {
    .hamburger-btn {
        display: none;
    }

    .mobile-nav-overlay {
        display: none !important;
    }

    .main-nav {
        display: block;
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    .nav-links {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 18px;
        overflow-x: visible;
        white-space: nowrap;
    }

    .nav-links a {
        text-decoration: none;
        color: var(--text-dark);
        font-size: 0.88rem;
        font-weight: 700;
        transition: color 0.2s;
        border-bottom: none;
    }

    .nav-links a:hover {
        color: var(--primary-color);
    }
}

/* ==========================================================================
   3. Hero Section
   ========================================================================== */
.hero-section {
    padding: 30px 0 40px;
    background: linear-gradient(180deg, var(--bg-cream) 0%, #ffffff 100%);
}

.hero-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 25px;
}

.hero-content-right {
    text-align: right;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 6px 0;
    color: var(--secondary-color);
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0 0 10px;
    line-height: 1.5;
}

.hero-desc {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin: 0 0 20px;
}

.hero-media-left {
    display: flex;
    justify-content: center;
}

.hero-motion-fixed-box {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1 / 1;
    height: auto;
    background-color: #f0ebd9;
    border: 2px dashed var(--accent-gold);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: var(--card-shadow);
}

.hero-motion-fixed-box video,
.hero-motion-fixed-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.hero-main-shortcuts {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.btn-shortcut {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s;
}

.btn-primary-shortcut {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary-shortcut:hover {
    background-color: var(--primary-hover);
}

.btn-secondary-shortcut {
    background-color: #fff;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

.hero-category-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-chip {
    background-color: #fff;
    border: 1px solid #e2dbcf;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.cat-chip:hover {
    border-color: var(--accent-gold);
    color: var(--primary-color);
    background-color: var(--bg-cream);
}

/* ==========================================================================
   4. قسم عن الدكتورة
   ========================================================================== */
.about-section {
    padding: 35px 0;
}

.about-card-wrapper {
    background-color: var(--bg-cream);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid #eee7db;
    box-shadow: var(--card-shadow);
}

.about-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-doctor-img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.about-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 8px 0;
}

.highlight-rank-box {
    background: #ffffff;
    border-right: 4px solid var(--accent-gold);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.about-excerpt {
    font-size: 0.92rem;
    color: #444;
    margin-bottom: 16px;
}

.btn-read-more {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   5. قسم العمليات والخدمات (مصفوفة 2x2)
   ========================================================================== */
.categories-section {
    padding: 40px 0;
}

.categories-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.category-card-small {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    border: 1px solid #f0f0f0;
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.category-card-small:active {
    transform: scale(0.98);
}

.card-content {
    padding: 12px 14px;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.card-content h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--secondary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    direction: rtl;
}

.card-content p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    direction: rtl;
}

/* ==========================================================================
   6. قسم قبل وبعد
   ========================================================================== */
.before-after-section {
    padding: 40px 0;
    background-color: var(--bg-cream);
}

.ba-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    scrollbar-width: none;
}

.ba-filter-bar::-webkit-scrollbar {
    display: none;
}

.ba-filter-btn {
    background: #fff;
    border: 1px solid #e0d8cc;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.ba-filter-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.before-after-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ba-card {
    background: #fff;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.ba-card-content {
    padding: 10px 12px;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
    text-align: center;
}

.ba-card-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    direction: rtl;
}

/* ==========================================================================
   7. قسم التثقيف الطبي
   ========================================================================== */
.education-section {
    padding: 40px 0;
}

.latest-article-card {
    background: var(--bg-cream);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid #eae2d5;
    cursor: pointer;
    margin-bottom: 16px;
}

.latest-article-title {
    margin: 8px 0;
    color: var(--primary-color);
    font-size: 1.15rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.latest-article-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.edu-two-squares {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.edu-square-card {
    background: #fff;
    padding: 16px 12px;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    text-align: center;
    cursor: pointer;
    border: 1px solid #efebe4;
    overflow: hidden;
}

.edu-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.edu-square-card h4 {
    margin: 4px 0;
    font-size: 0.92rem;
    color: var(--secondary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.edu-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.doctor-articles-wrapper {
    background-color: #faf8f5;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid #eee;
}

.insta-grid-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.insta-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.insta-article-item {
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid #e8e2d8;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    overflow: hidden;
}

.insta-article-item h5 {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    direction: rtl;
}

/* ==========================================================================
   8. قسم التواصل والفروع
   ========================================================================== */
.contact-section {
    padding: 40px 0;
    background-color: #fdfdfd;
}

.branches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.branch-card {
    background: #fff;
    padding: 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    border-top: 4px solid var(--primary-color);
    text-align: center;
    position: relative;
}

.branch-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.7rem;
    background: var(--bg-cream);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

.branch-card h3 {
    margin: 0 0 6px;
    color: var(--primary-color);
}

.branch-phone {
    font-weight: 700;
    color: var(--secondary-color);
    margin: 10px 0 14px;
    font-size: 1.1rem;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #25D366;
    color: #fff;
    padding: 11px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.social-wrapper {
    text-align: center;
}

.social-title {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-social {
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.btn-tiktok {
    background-color: #000000;
}

.site-footer {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
}

/* ==========================================================================
   9. MODALS & Horizontal Scrolling
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 14px;
    backdrop-filter: blur(4px);
}

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

.modal-content {
    background: #fff;
    padding: 22px 16px;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--modal-shadow);
}

.modal-large {
    max-width: 750px;
}

.modal-carousel-content {
    max-width: 850px;
    padding: 20px 12px;
    overflow-y: hidden;
}

.modal-close {
    position: absolute;
    top: 10px;
    left: 12px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #888;
    z-index: 10;
    line-height: 1;
}

.modal-title-primary {
    color: var(--primary-color);
    margin: 0 0 4px;
    font-size: 1.2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-subtitle-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 16px;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.proc-grid-card {
    background: var(--bg-cream);
    border: 1px solid #e0d8ca;
    border-radius: var(--radius-sm);
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    overflow: hidden;
    box-sizing: border-box;
}

.proc-grid-card h4 {
    margin: 0;
    font-size: 0.82rem;
    color: var(--secondary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

/* Horizontal Scroll System */
.horizontal-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

.horizontal-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.horizontal-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 4px;
}

.horizontal-scroll-track {
    display: flex;
    gap: 14px;
}

.horizontal-card-slide {
    flex: 0 0 82%;
    scroll-snap-align: center;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.horizontal-card-slide .aspect-4-5 {
    cursor: pointer;
}

.scroll-hint-bar {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.modal-meta-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.back-to-procs-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    text-align: right;
    font-family: inherit;
}

.proc-breadcrumb {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--secondary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* سيرة ذاتية - بطاقات السحب الأفقي */
.about-slide-card {
    flex: 0 0 88%;
    scroll-snap-align: center;
    background: var(--bg-cream);
    border: 1px solid #e5dccf;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    box-sizing: border-box;
}

.about-slide-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.about-slide-card h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.about-slide-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #444;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Lightbox Horizontal */
.lightbox-wrapper {
    width: 100%;
    max-width: 450px;
    position: relative;
}

.lightbox-close {
    color: #fff;
    top: -35px;
    left: 0;
}

.lightbox-horizontal-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
}

.lightbox-horizontal-track {
    display: flex;
    gap: 10px;
}

.lightbox-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
}

.lightbox-slide img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: contain;
    background: #000;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   10. التكيف مع الشاشات الأكبر
   ========================================================================== */
@media (min-width: 768px) {
    .nav-links {
        gap: 20px;
    }

    .nav-links a {
        font-size: 0.95rem;
    }

    .hero-grid {
        display: grid;
        grid-template-columns: 1fr 320px;
        align-items: center;
    }

    .about-grid {
        display: grid;
        grid-template-columns: 280px 1fr;
        align-items: center;
    }

    .horizontal-card-slide {
        flex: 0 0 45%;
    }

    .about-slide-card {
        flex: 0 0 60%;
    }

    .branches-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .site-header {
        padding: 14px 0;
    }

    .nav-links {
        gap: 24px;
    }

    .hero-grid {
        grid-template-columns: 1fr 380px;
    }

   .hero-motion-fixed-box {
    max-width: 320px;
    height: auto;
}

    .hero-title {
        font-size: 2.3rem;
    }

    .horizontal-card-slide {
        flex: 0 0 30%;
    }

    .about-slide-card {
        flex: 0 0 42%;
    }
}