/* ============================================================
   CONTACT PAGE - SIMPLE & SAFE
   No animations, no clamp, no inset - guaranteed to work
   ============================================================ */

/* ----- Body ----- */
body {
    font-family: 'Tajawal', sans-serif;
}

/* ----- هيكل الصفحة: <main> بعرض كامل الشاشة (اتصل بنا فقط عبر #page-contact) ----- */
#page-contact main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    display: block;
    box-sizing: border-box;
}

#page-contact .contact-section {
    max-width: none;
    width: 100%;
}

/* =========================
   1. HERO
   ========================= */
.hero-section {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a3a5a 0%, #2c5282 50%, #1a3a5a 100%);
}

.hero-video {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(26, 58, 90, 0.6);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    padding: 0 20px;
    box-sizing: border-box;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 16px 0;
    text-shadow: 2px 2px 12px rgba(0, 0, 0, 0.6);
}

.hero-content p {
    font-size: 1.25rem;
    margin: 0;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.5);
    max-width: 700px;
    line-height: 1.6;
}

/* =========================
   2. CONTACT SECTION
   ========================= */
.contact-section {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 24px;
    box-sizing: border-box;
}

.contact-section > h2 {
    text-align: center;
    font-size: 2.2rem;
    color: #1a3a5a;
    margin: 0 0 16px 0;
    font-weight: 800;
}

.contact-header {
    margin-bottom: 40px;
}

.contact-header p {
    text-align: center;
    color: #555;
    font-size: 1.05rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* =========================
   3. CONTACT CONTENT (info + form)
   ========================= */
.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.info-panel,
.contact-form-container {
    flex: 1 1 360px;
    width: 100%;
    min-width: 0;
    padding: 32px 26px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.info-panel h3,
.contact-form-container h3 {
    color: #1a3a5a;
    margin: 0 0 24px 0;
    font-size: 1.4rem;
    font-weight: 800;
    padding-bottom: 12px;
    border-bottom: 3px solid #6fbc32;
    display: inline-block;
}

/* ----- Info items ----- */
.info-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item i {
    color: #6fbc32;
    font-size: 1.3rem;
    width: 28px;
    flex-shrink: 0;
    text-align: center;
    margin-top: 4px;
}

.info-item > div {
    flex: 1;
    min-width: 0;
}

.info-item h4 {
    margin: 0 0 6px 0;
    color: #1a3a5a;
    font-size: 1rem;
    font-weight: 700;
}

.info-item p {
    margin: 3px 0;
    color: #555;
    line-height: 1.6;
    word-wrap: break-word;
}

.info-item p a {
    color: #2c5282;
    text-decoration: none;
}

.info-item p a:hover {
    color: #6fbc32;
}

.info-item .info-meta,
.info-item .info-meta-strong {
    font-size: 0.85rem;
    color: #888;
}

/* =========================
   4. CONTACT FORM
   ========================= */
.contact-form-container form {
    position: relative;
}

/* Honeypot: لا تستخدم left:-9999px — يوسّع عرض الصفحة آلاف البكسل ويكسر RTL */
.fs-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #1a3a5a;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    background: #ffffff;
    color: #1a3a5a;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6fbc32;
    box-shadow: 0 0 0 3px rgba(111, 188, 50, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.send-btn {
    width: 100%;
    padding: 14px 24px;
    background: #6fbc32;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Tajawal', sans-serif;
}

.send-btn:hover {
    background: #5da028;
}

/* =========================
   5. BRANCHES
   ========================= */
.branches-wrapper {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px dashed rgba(111, 188, 50, 0.3);
}

.branches-header {
    text-align: center;
    margin-bottom: 30px;
}

.branches-header h2 {
    font-size: 1.7rem;
    color: #1a3a5a;
    font-weight: 800;
    margin: 0 0 10px 0;
}

.branches-header p {
    color: #777;
    font-size: 0.95rem;
    margin: 0;
}

.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.branch-card {
    background: #ffffff;
    border: 1px solid rgba(111, 188, 50, 0.15);
    border-radius: 12px;
    padding: 22px 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.branch-card:hover {
    box-shadow: 0 8px 24px rgba(111, 188, 50, 0.15);
    border-color: rgba(111, 188, 50, 0.4);
}

.branch-badge {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    background: #6fbc32;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
}

.branch-name {
    font-size: 1rem;
    color: #1a3a5a;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.branch-person {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #777;
    font-size: 0.88rem;
    margin-bottom: 10px;
}

.branch-person i {
    color: #d4af37;
    font-size: 0.78rem;
}

.branch-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: #f5f9f0;
    color: #1a3a5a;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
}

.branch-phone:hover {
    background: #e8f3dc;
    color: #6fbc32;
}

.branch-phone i {
    color: #6fbc32;
    font-size: 0.78rem;
}

.branch-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    background: #25d366;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
}

.branch-whatsapp:hover {
    background: #1ebe5a;
}

/* =========================
   6. MAP
   ========================= */
.map-container {
    width: 100%;
    height: 420px;
    margin-top: 50px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* =========================
   7. SUCCESS TOAST (only when ?success=1)
   ========================= */
.success-toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: calc(100% - 24px);
    max-width: 480px;
}

.toast-inner {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.toast-inner::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 4px;
    background: #6fbc32;
}

.toast-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: #6fbc32;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon i {
    color: #ffffff;
    font-size: 1.05rem;
}

.toast-text {
    flex: 1;
    text-align: right;
}

.toast-text strong {
    display: block;
    color: #2c5282;
    font-size: 1rem;
    margin-bottom: 3px;
}

.toast-text span {
    color: #5a6c7d;
    font-size: 0.85rem;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #eef5e8;
}

.toast-bar {
    height: 100%;
    background: #6fbc32;
}

.toast-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
}

.toast-close:hover {
    color: #d64545;
}

/* =========================
   8. RESPONSIVE
   ========================= */
@media (max-width: 900px) {
    .contact-content {
        flex-direction: column;
    }
    .info-panel,
    .contact-form-container {
        flex: 1 1 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: 280px;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .contact-section {
        padding: 45px 16px;
    }
    .contact-section > h2 {
        font-size: 1.7rem;
    }
    .info-panel,
    .contact-form-container {
        padding: 24px 18px;
    }
    .info-panel h3,
    .contact-form-container h3 {
        font-size: 1.2rem;
    }
    .branches-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .branch-card {
        padding: 18px 12px;
    }
    .branch-name {
        font-size: 0.9rem;
    }
    .branch-person,
    .branch-phone,
    .branch-whatsapp {
        font-size: 0.8rem;
    }
    .map-container {
        height: 320px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 240px;
    }
    .hero-content h1 {
        font-size: 1.6rem;
    }
    .hero-content p {
        font-size: 0.9rem;
    }
    .contact-section {
        padding: 35px 14px;
    }
    .contact-section > h2 {
        font-size: 1.4rem;
    }
    .info-panel,
    .contact-form-container {
        padding: 20px 16px;
    }
    .branches-grid {
        grid-template-columns: 1fr;
    }
    .map-container {
        height: 260px;
    }
}

/* =========================
   9. DARK MODE
   ========================= */
html[data-theme="dark"] .contact-section > h2,
html[data-theme="dark"] .info-panel h3,
html[data-theme="dark"] .contact-form-container h3,
html[data-theme="dark"] .info-item h4,
html[data-theme="dark"] .branches-header h2,
html[data-theme="dark"] .branch-name {
    color: #e2e8f0;
}

html[data-theme="dark"] .contact-header p,
html[data-theme="dark"] .branches-header p,
html[data-theme="dark"] .branch-person {
    color: #94a3b8;
}

html[data-theme="dark"] .info-item p {
    color: #cbd5e1;
}

html[data-theme="dark"] .info-item .info-meta,
html[data-theme="dark"] .info-item .info-meta-strong {
    color: #94a3b8;
}

html[data-theme="dark"] .info-item strong {
    color: #f1f5f9;
}

html[data-theme="dark"] .info-panel,
html[data-theme="dark"] .contact-form-container {
    background: #1f2538;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .info-panel h3,
html[data-theme="dark"] .contact-form-container h3 {
    border-bottom-color: #d4af37;
}

html[data-theme="dark"] .info-item {
    border-bottom-color: rgba(212, 175, 55, 0.15);
}

html[data-theme="dark"] .info-item i,
html[data-theme="dark"] .info-item p a {
    color: #d4af37;
}

html[data-theme="dark"] .info-item p a:hover {
    color: #e6c25a;
}

html[data-theme="dark"] .form-group label {
    color: #e2e8f0;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea {
    background: #232838;
    border-color: rgba(212, 175, 55, 0.35);
    color: #f1f5f9;
}

html[data-theme="dark"] .form-group input::placeholder,
html[data-theme="dark"] .form-group textarea::placeholder {
    color: rgba(241, 245, 249, 0.4);
}

html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group textarea:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

html[data-theme="dark"] .send-btn {
    background: #d4af37;
    color: #1a1f2e;
}

html[data-theme="dark"] .send-btn:hover {
    background: #b8961e;
}

html[data-theme="dark"] .branches-wrapper {
    border-top-color: rgba(212, 175, 55, 0.25);
}

html[data-theme="dark"] .branch-card {
    background: #1f2538;
    border-color: rgba(212, 175, 55, 0.25);
}

html[data-theme="dark"] .branch-card:hover {
    border-color: rgba(212, 175, 55, 0.5);
}

html[data-theme="dark"] .branch-phone {
    background: rgba(30, 35, 50, 0.6);
    color: #e2e8f0;
}

html[data-theme="dark"] .branch-phone:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
}

html[data-theme="dark"] .branch-phone i {
    color: #d4af37;
}

html[data-theme="dark"] .toast-inner {
    background: #1a1f2e;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .toast-inner::before {
    background: #d4af37;
}

html[data-theme="dark"] .toast-icon {
    background: #d4af37;
}

html[data-theme="dark"] .toast-text strong {
    color: #e2e8f0;
}

html[data-theme="dark"] .toast-text span {
    color: #94a3b8;
}

html[data-theme="dark"] .toast-progress {
    background: rgba(212, 175, 55, 0.1);
}

html[data-theme="dark"] .toast-bar {
    background: #d4af37;
}

html[data-theme="dark"] .toast-close {
    color: #64748b;
}
