/* --- SAFA CORE PREMIUM UI (v4.0 - Ultra Modern) --- */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Outfit:wght@400;500;700&display=swap');

:root {
    /* Brand Colors */
    --safa-primary: #8e44ad;
    --safa-primary-dark: #732d91;
    --safa-secondary: #2ecc71;
    --safa-secondary-dark: #27ae60;
    --safa-accent: #f1c40f;

    /* Neutrals */
    --safa-bg: #f8f9fa;
    --safa-surface: #ffffff;
    --safa-text-main: #2c3e50;
    --safa-text-light: #7f8c8d;
    --safa-border: #ecf0f1;

    /* Effects */
    --safa-shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
    --safa-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --safa-shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    --safa-radius-md: 12px;
    --safa-radius-lg: 20px;
    --safa-radius-xl: 30px;

    /* Typography */
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;
    /* Unified for cleaner look */
}

/* Base Reset & Typography */
.safa-modern-wrapper {
    font-family: var(--font-body);
    color: var(--safa-text-main);
    background: var(--safa-bg);
    line-height: 1.6;
    direction: rtl;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll on mobile */
}

.safa-modern-wrapper * {
    box-sizing: border-box;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: #1a1a1a;
    margin-top: 0;
    line-height: 1.3;
}

/* --- 1. HERO SECTION (Gallery) --- */
.safa-mod-header {
    background: var(--safa-surface);
    padding: 30px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--safa-border);
}

.safa-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.safa-mod-title {
    font-size: 2.8rem !important;
    font-weight: 800 !important;
    margin-bottom: 15px;
    background: linear-gradient(45deg, var(--safa-primary-dark), var(--safa-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Meta Row */
.safa-mod-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.safa-mod-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(142, 68, 173, 0.08);
    /* Transparent Purple */
    padding: 8px 16px;
    border-radius: 50px;
    color: var(--safa-primary-dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.safa-mod-meta:hover {
    transform: translateY(-2px);
    background: rgba(142, 68, 173, 0.15);
}

.safa-mod-meta i {
    color: var(--safa-primary);
}

/* Gallery Grid (Bento Style) */
.safa-mod-gallery-grid {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 15px;
    height: 550px !important;
    margin: 20px auto 40px;
    max-width: 1280px;
    padding: 0 20px;
}

.safa-gal-item {
    position: relative;
    border-radius: var(--safa-radius-lg) !important;
    overflow: hidden;
    height: 100% !important;
    box-shadow: var(--safa-shadow-sm);
}

.safa-gal-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.safa-gal-item:hover img {
    transform: scale(1.08);
}

.safa-gal-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.safa-gal-side .safa-gal-item {
    flex: 1;
    /* Equal height */
}

/* --- 2. MAIN LAYOUT (Content + Sidebar) --- */
.safa-mod-body {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    /* 66% / 33% */
    gap: 40px !important;
    max-width: 1280px;
    margin: 0 auto 60px;
    padding: 0 20px;
    align-items: start;
}

/* Content Area */
.safa-mod-content {
    background: var(--safa-surface);
    padding: 40px;
    border-radius: var(--safa-radius-lg);
    box-shadow: var(--safa-shadow-sm);
    border: 1px solid var(--safa-border);
}

/* Tabs Navigation */
.safa-mod-tabs-nav {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--safa-border);
    margin-bottom: 40px;
    padding-bottom: 0;
    position: sticky;
    top: 80px;
    /* Adjust based on theme header */
    background: var(--safa-surface);
    z-index: 10;
    padding-top: 10px;
}

.safa-mod-tabs-nav a {
    text-decoration: none;
    padding: 15px 25px;
    font-weight: 700;
    color: var(--safa-text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    /* Overlap border */
}

.safa-mod-tabs-nav a.active,
.safa-mod-tabs-nav a:hover {
    color: var(--safa-primary);
    border-bottom-color: var(--safa-primary);
    background: linear-gradient(to top, rgba(142, 68, 173, 0.05), transparent);
}

/* Section Styling */
.safa-mod-section {
    margin-bottom: 50px;
    scroll-margin-top: 150px;
    /* Anchor offset */
}

.safa-mod-section h3 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    position: relative;
    padding-right: 15px;
}

.safa-mod-section h3::before {
    content: '';
    position: absolute;
    right: 0;
    top: 5px;
    bottom: 5px;
    width: 4px;
    background: var(--safa-primary);
    border-radius: 4px;
}

.safa-text-block p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.9;
}

/* Timeline */
.safa-timeline-v2 {
    position: relative;
    padding-right: 20px;
    border-right: 2px dashed #e0e0e0;
}

.safa-tl-item {
    position: relative;
    margin-bottom: 40px;
    padding-right: 30px;
}

.safa-tl-item:last-child {
    margin-bottom: 0;
}

.safa-tl-marker {
    position: absolute;
    right: -37px;
    top: 0;
    width: 34px;
    height: 34px;
    background: var(--safa-primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 34px;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 0 0 4px white, 0 0 0 6px var(--safa-primary-dark);
}

.safa-tl-content {
    background: #f9f9f9;
    padding: 20px;
    border-radius: var(--safa-radius-md);
    transition: transform 0.3s ease;
}

.safa-tl-content:hover {
    transform: translateX(-5px);
    background: #fff;
    box-shadow: var(--safa-shadow-md);
}

.safa-tl-content h4 {
    margin: 0 0 10px 0;
    color: var(--safa-primary-dark);
}

/* Inclusions Grid */
.safa-inc-v2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.inc-col {
    padding: 25px;
    border-radius: var(--safa-radius-md);
    border: 1px solid transparent;
}

.inc-col.yes {
    background: rgba(46, 204, 113, 0.08);
    border-color: rgba(46, 204, 113, 0.2);
}

.inc-col.no {
    background: rgba(231, 76, 60, 0.08);
    border-color: rgba(231, 76, 60, 0.2);
}

.inc-col h5 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.inc-col.yes h5 {
    color: #27ae60;
}

.inc-col.no h5 {
    color: #c0392b;
}

.inc-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.inc-col li {
    margin-bottom: 12px;
    padding-right: 20px;
    position: relative;
    font-weight: 500;
}

.inc-col li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: inherit;
    font-weight: bold;
}

/* --- 3. SIDEBAR (Booking Card) --- */
.safa-booking-card {
    background: var(--safa-surface);
    padding: 35px;
    border-radius: 25px;
    box-shadow: var(--safa-shadow-lg);
    position: sticky;
    top: 100px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.price-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--safa-border);
}

.price-header .label {
    display: block;
    color: var(--safa-text-light);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.price-val {
    font-size: 2.5rem !important;
    font-weight: 900 !important;
    color: var(--safa-secondary-dark);
    font-family: var(--font-heading);
}

.price-val .unit {
    font-size: 1.2rem;
    color: var(--safa-text-light);
    font-weight: 400;
}

/* Form Styles */
.safa-rd-input {
    width: 100%;
    padding: 14px 16px !important;
    border: 2px solid #f0f0f0 !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-family: var(--font-body) !important;
    margin-bottom: 15px !important;
    transition: all 0.3s ease;
    background: #fdfdfd !important;
}

.safa-rd-input:focus {
    border-color: var(--safa-primary) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(142, 68, 173, 0.1) !important;
    outline: none;
}

.safa-rd-submit-btn {
    width: 100%;
    padding: 16px !important;
    background: linear-gradient(135deg, var(--safa-primary), var(--safa-primary-dark)) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(142, 68, 173, 0.3);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.safa-rd-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(142, 68, 173, 0.4);
}

.safa-btn-whatsapp {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    background: rgba(46, 204, 113, 0.1) !important;
    color: #27ae60 !important;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.safa-btn-whatsapp:hover {
    background: #27ae60 !important;
    color: white !important;
}

/* --- 4. MOBILE OPTIMIZATIONS --- */
.safa-mobile-bar-v2 {
    display: none;
    /* Desktop hidden */
}

@media (max-width: 900px) {
    .safa-modern-wrapper {
        background: white;
        /* Cleaner mobile bg */
    }

    .safa-mod-body {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 0 !important;
        margin-bottom: 100px;
    }

    .safa-mod-sidebar,
    .safa-mod-gallery-grid,
    .safa-mod-tabs-nav {
        display: none !important;
    }

    /* Mobile Headers */
    .safa-mod-header {
        border-bottom: none;
        padding: 20px;
    }

    .safa-mod-title {
        font-size: 2rem !important;
    }

    /* Mobile Hero Image (Replaces Grid) */
    .safa-mod-hero-mobile {
        display: block !important;
        width: 100vw;
        height: 350px;
        object-fit: cover;
        margin-bottom: 20px;
        border-radius: 0 0 30px 30px;
        /* Modern curve at bottom */
        box-shadow: var(--safa-shadow-md);
    }

    /* Used for the first image in gallery */
    .safa-gal-item.main img {
        border-radius: 0 0 30px 30px !important;
        height: 350px !important;
    }

    .safa-gal-item.main {
        border-radius: 0 !important;
        height: 350px !important;
        margin: -20px -20px 20px -20px;
        /* Bleed out */
        box-shadow: none;
    }

    /* Force show the main image container on mobile but style differently */
    .safa-mod-gallery-grid {
        display: block !important;
        /* Show ONLY first child via CSS logic or JS */
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .safa-gal-side {
        display: none !important;
    }

    /* Content */
    .safa-mod-content {
        box-shadow: none;
        border: none;
        padding: 20px;
    }

    .safa-inc-v2 {
        grid-template-columns: 1fr;
    }

    /* Sticky Mobile Bar */
    .safa-mobile-bar-v2 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 15px 25px;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
        z-index: 9999;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }

    .safa-mobile-bar-v2 .price-info strong {
        font-size: 1.6rem;
        color: var(--safa-secondary-dark);
        font-family: var(--font-heading);
    }

    .safa-book-trigger-v2 {
        background: var(--safa-primary);
        color: white;
        border: none;
        padding: 12px 30px;
        border-radius: 50px;
        font-weight: bold;
        font-size: 1.1rem;
        box-shadow: 0 5px 15px rgba(142, 68, 173, 0.3);
    }

    /* Modal */
    .safa-rd-modal-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
        z-index: 10000;
        align-items: flex-end;
        /* Sheet style */
    }

    .safa-rd-modal-box {
        background: white;
        width: 100%;
        border-radius: 25px 25px 0 0;
        padding: 30px;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}