* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
*, *::before, *::after { box-sizing: border-box; }

:root {
    --primary: #ff6000;
    --primary-dark: #e65500;
    --secondary: #1a1a2e;
    --text: #2d3748;
    --text-light: #718096;
    --bg: #ffffff;
    --bg-gray: #f7fafc;
    --border: #e2e8f0;
    --success: #48bb78;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    overscroll-behavior-x: none;
}

html, body {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
}

/* Prefer modern clipping to fully block horizontal scrolling when supported */
@supports (overflow-x: clip) {
    html, body { overflow-x: clip; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
    min-height: 100vh;
}

[dir="rtl"] body {
    /* Modern Arabic stack: Tajawal primary, with Cairo/IBM Plex/Noto as fallbacks */
    font-family: "Tajawal", "Cairo", "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
}

/* Header */
header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    margin-inline: auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--secondary);
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
}

/* Replaced header logo with image */
.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 3rem 1rem;
    text-align: center;
    position: relative; /* allow absolute overlay */
    overflow: hidden;   /* clip animation visuals and prevent external whitespace */
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    margin-inline: auto;
    position: relative;
    z-index: 1; /* above animation overlay */
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    color: var(--secondary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    min-width: 140px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Call/WhatsApp button styling */
.btn-call {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 96, 0, 0.3);
}

.btn-call:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 96, 0, 0.4);
    color: white;
}

.btn-call-icon {
    font-size: 1.2rem;
    line-height: 1;
}

/* Show Call button on mobile, hide on desktop */
.btn-call-mobile {
    display: inline-flex;
}

.btn-call-desktop {
    display: none;
}

/* Show WhatsApp button on desktop (devices with hover capability), hide on mobile */
@media (hover: hover) and (pointer: fine) {
    .btn-call-mobile {
        display: none;
    }
    
    .btn-call-desktop {
        display: inline-flex;
    }
}

/* Track Section */
.track-section {
    padding: 2rem 1rem;
    background: white;
}

.track-container {
    max-width: 600px;
    margin: 0 auto;
    margin-inline: auto;
}

.track-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.input-prefix {
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-weight: 600;
    pointer-events: none;
}

input {
    width: 100%;
    padding: 0.875rem;
    padding-inline-start: 3rem;
    padding-inline-end: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 96, 0, 0.1);
}

.track-help {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
}

.track-error {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    margin-inline: auto;
    padding: 3rem 1rem;
    overflow-wrap: anywhere; /* prevent long words causing horizontal overflow */
}

.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--secondary);
    margin-bottom: 2.5rem;
}

/* Align text according to writing direction universally */
p, li, label, input, textarea, select { text-align: start; }

/* Ensure hero subtitle stays centered in both LTR and RTL */
.hero p { text-align: center; }

/* Services Grid */
.grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Brands Section */
.brands-section {
    background: var(--bg-gray);
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    align-items: start;
}

.brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.brand-logo {
    width: clamp(48px, 7vw, 72px);
    height: clamp(48px, 7vw, 72px);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    filter: grayscale(30%) brightness(0.95);
    transition: inherit;
}

.brand-name {
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    text-align: center;
}

.brand-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Stats */
.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
}

/* Footer */
footer {
    background: var(--secondary);
    color: white;
    padding: 3rem 1rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    margin-inline: auto;
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

/* Footer social links */
.social-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
}

.social-links img {
    width: 24px;
    height: 24px;
    display: block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--secondary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-gray);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text);
}

.modal-close:hover {
    background: var(--border);
}

/* Form */
.form-grid {
    display: grid;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

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

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.feedback {
    color: var(--success);
    font-size: 0.9rem;
}

/* Timeline */
.timeline {
    margin: 2rem 0;
}

.timeline-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 2rem;
}

.timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.step-dot.active {
    background: var(--primary);
    color: white;
}

.step-dot.done {
    background: var(--success);
    color: white;
}

/* New timeline dot states */
.step-dot.waiting {
    background: var(--primary);
    color: white;
}

.step-dot.rejected {
    background: #dc2626; /* red */
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.timeline-line {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.device-info {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.info-item strong {
    display: block;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 640px) {
    /* Mobile-specific tweaks (global constraints already applied above) */

    .track-form {
        flex-direction: column;
    }

    .cta-group {
        flex-direction: column;
        align-items: center; /* center CTAs on mobile */
    }

    .btn {
        width: 100%;
    }

    /* Hero-specific: prevent overly wide CTAs on mobile */
    .hero .cta-group .btn {
        width: auto;
        max-width: 320px;
        padding: 0.75rem 1rem; /* slightly tighter padding on mobile */
    }

    .grid {
        grid-template-columns: 1fr;
    }

}

/* RTL modal adjustments for visual consistency */
[dir="rtl"] .modal-content { text-align: right; }
[dir="rtl"] .modal-header { flex-direction: row-reverse; }

/* Low-end device optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Hidden utility */
.hidden {
    display: none;
}

/* SEO-only content: Visually hidden but accessible to crawlers */
/* Keeps content in DOM for SEO crawlers while invisible to users */
.seo-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    /* Content remains in DOM for search engine crawlers */
}

/* Honeypot field: hidden without affecting layout or scroll bounds */
.hp-field {
    position: absolute !important;
    inset-inline-start: 0 !important; /* avoid huge negative left in RTL */
    inline-size: 1px !important;
    block-size: 1px !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    clip-path: inset(100%) !important; /* robustly clip */
}

/* Toast notification */
#toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    background: #111827;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

#toast.visible {
    opacity: 0.95;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #16a34a;
}

.toast.info {
    background: #2563eb;
}

.toast.error {
    background: #dc2626;
}
/* Hero animation overlay */
.hero-anim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    color: #ff6000; /* brand color for icons */
}

.hero-icon {
    position: absolute;
    opacity: 0.45; /* requested opacity */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    width: 40px;  /* smaller default size */
    height: 40px;
}

/* Positions for icons (responsive-friendly) */
.icon-phone { left: 8%; top: 18%; animation: floatY 7s ease-in-out infinite; }
.icon-wrench { right: 10%; top: 35%; animation: floatY 9s ease-in-out infinite; }
.icon-battery { left: 50%; bottom: 6%; transform: translateX(-50%); animation: floatY 8s ease-in-out infinite; }
.icon-chip { left: 22%; top: 58%; animation: floatY 10s ease-in-out infinite; }
.icon-screwdriver { right: 22%; top: 12%; animation: floatY 8.5s ease-in-out infinite; }
.icon-shield { left: 75%; top: 70%; animation: floatY 7.5s ease-in-out infinite; }

/* Alternate icons to double density */
.icon-phone-2 { right: 6%; bottom: 14%; animation: floatY 6.7s ease-in-out infinite; }
.icon-wrench-2 { left: 6%; bottom: 22%; animation: floatY 9.6s ease-in-out infinite; }
.icon-battery-2 { right: 8%; top: 10%; animation: floatY 8.3s ease-in-out infinite; }
.icon-chip-2 { right: 12%; bottom: 26%; animation: floatY 10.2s ease-in-out infinite; }
.icon-screwdriver-2 { left: 64%; top: 42%; animation: floatY 8.9s ease-in-out infinite; }
.icon-shield-2 { left: 12%; top: 6%; animation: floatY 7.7s ease-in-out infinite; }

@keyframes floatY {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

/* Respect reduced motion settings */
@media (prefers-reduced-motion: reduce) {
    .hero-icon { animation: none !important; }
}

/* Mobile tweaks */
@media (max-width: 640px) {
    .hero-icon { opacity: 0.45; width: 32px; height: 32px; }
}

/* Device info with type icon */
.device-info {
    margin: 1rem 0;
}
.device-info-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}
[dir="rtl"] .device-info-row { flex-direction: row-reverse; }
.device-type-icon {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    opacity: 0.95;
}
.device-info-list {
    flex: 1;
    display: block;
}
.device-info-list .info-item { margin-bottom: 0.5rem; }
[dir="rtl"] .device-info-list .info-item { text-align: right; }
html[dir="rtl"], body[dir="rtl"] { direction: rtl; }
html[dir="ltr"], body[dir="ltr"] { direction: ltr; }
.hero, .track-section, .brands-section, footer, header {
    max-width: 100%;
    overflow-x: hidden;
}
/* Layout debug overlay removed */