/* ============================================
   1. CSS Variables & Reset
   ============================================ */
:root {
    --primary: #E4002B;
    --primary-dark: #b30022;
    --secondary: #1A1A2E;
    --accent: #FFFFFF;
    --bg-light: #F8F8F8;
    --text-dark: #333333;
    --text-muted: #666666;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

/* ============================================
   2. Typography & Base
   ============================================ */
body { 
    font-family: 'Cairo', sans-serif; 
    background-color: var(--bg-light); 
    color: var(--text-dark); 
    line-height: 1.6; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    direction: rtl; 
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; border-radius: 8px; }

.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 12px 25px; 
    border-radius: 50px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: var(--transition); 
    border: none; 
    gap: 10px; 
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: scale(1.05); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: white; }

section { padding: 120px 0; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { 
    font-size: 2.5rem; 
    color: var(--secondary); 
    margin-bottom: 15px; 
    position: relative; 
    display: inline-block; 
    padding-bottom: 15px; 
}
.section-title h2::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    right: 50%; 
    transform: translateX(50%); 
    width: 100px; 
    height: 4px; 
    background: var(--primary); 
    border-radius: 2px; 
}

.svg-icon { width: 24px; height: 24px; fill: currentColor; vertical-align: middle; }

/* ============================================
   3. Navbar
   ============================================ */
.sticky-header { position: sticky; top: 0; width: 100%; z-index: 9999; background: white; box-shadow: var(--shadow); }
.navbar { background: white; padding: 10px 0; border-bottom: 3px solid var(--primary); }
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo { display: flex; align-items: center; padding: 5px 0; }
.nav-logo img { height: 40px !important; width: auto !important; transition: var(--transition); }
.nav-logo:hover img { transform: scale(1.05); }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { font-weight: 700; color: var(--secondary); font-size: 1.1rem; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.mobile-menu-btn { display: none; font-size: 2rem; cursor: pointer; color: var(--secondary); }

/* ============================================
   4. Hero Section
   ============================================ */
.hero-home {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('../img/hero.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 120px 0;
    text-align: center;
}
.hero-home h1 { font-size: 3.5rem; margin-bottom: 20px; font-weight: 900; }
.hero-home p { font-size: 1.4rem; margin-bottom: 35px; max-width: 800px; margin-left: auto; margin-right: auto; }

.service-hero {
    background-size: cover; background-position: center; color: white; padding: 120px 0; text-align: center;
}
.hero-fridges { background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../img/hero-fridges.jpg'); background-size: cover; background-position: center; }
.hero-washers { background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../img/hero-washers.jpg'); background-size: cover; background-position: center; }
.hero-acs { background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../img/hero-acs.jpg'); background-size: cover; background-position: center; }
.hero-ovens { background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../img/hero-ovens.jpg'); background-size: cover; background-position: center; }
.hero-heaters { background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../img/hero-heaters.jpg'); background-size: cover; background-position: center; }
.contact-hero {
    background: linear-gradient(rgba(26, 26, 46, 0.8), rgba(26, 26, 46, 0.8)), url('../img/contact-hero.jpg');
    background-size: cover; background-position: center; color: white; padding: 120px 0; text-align: center;
}

/* ============================================
   5. Services Grid
   ============================================ */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.service-card { background: white; padding: 40px; border-radius: 15px; text-align: center; transition: var(--transition); border: 1px solid #eee; }
.service-card:hover { transform: translateY(-10px); box-shadow: var(--shadow); border-color: var(--primary); }
.service-card .icon { font-size: 3rem; color: var(--primary); margin-bottom: 20px; display: block; }
.service-card p { margin-bottom: 25px; color: var(--text-muted); min-height: 80px; }
.service-card h3 { margin-bottom: 20px; font-size: 1.6rem; color: var(--secondary); font-weight: 800; }
.service-card .btn { width: 100%; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.card-white { background: white; padding: 30px; border-radius: 15px; box-shadow: var(--shadow); transition: var(--transition); border: 1px solid #eee; }
.card-white:hover { border-color: var(--primary); transform: translateY(-5px); }
.icon-box { font-size: 2.5rem; margin-bottom: 20px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }

/* ============================================
   6. Why Choose Us Section
   ============================================ */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 25px; }
.why-card { background: white; padding: 30px; border-radius: 10px; display: flex; align-items: flex-start; gap: 15px; border: 1px solid transparent; transition: var(--transition); }
.why-card .icon-circle { background: var(--bg-light); width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary); }

/* ============================================
   7. How It Works Section
   ============================================ */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.step-item { text-align: center; position: relative; }
.step-num { width: 50px; height: 50px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-weight: 900; font-size: 1.5rem; }

/* Fault Items (Service Pages) */
.fault-item { border-right: 4px solid var(--primary); padding: 15px 20px; background: #fff; margin-bottom: 15px; border-radius: 0 8px 8px 0; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Tip Box (Service Pages) */
.tip-box { background: #eef2ff; border-right: 5px solid var(--secondary); padding: 20px; border-radius: 8px; }

/* Related Services (Service Pages) */
.related-services { background: var(--bg-light); border-top: 1px solid #eee; }

/* ============================================
   8. Stats/Numbers Section
   ============================================ */
.stats { background: var(--secondary); color: white; padding: 60px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; text-align: center; }
.stat-val { font-size: 3rem; font-weight: 900; color: var(--primary); display: block; }

/* ============================================
   9. Service Areas Section
   ============================================ */
.areas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
.area-tag { background: white; padding: 10px; border-radius: 5px; text-align: center; border: 1px solid #ddd; font-weight: 600; }

.area-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.area-badge { background: white; border: 1px solid #ddd; padding: 8px; border-radius: 5px; text-align: center; font-size: 0.9rem; }

/* ============================================
   10. Testimonials Section
   ============================================ */
.testi-viewport { overflow: hidden; position: relative; padding: 40px 10px; margin: 0 -10px; cursor: grab; user-select: none; }
.testi-viewport:active { cursor: grabbing; }
.testi-track { display: flex; transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1); gap: 30px; width: max-content; pointer-events: none; }
.testi-track > * { pointer-events: auto; }
.testi-item { width: 450px; flex-shrink: 0; box-sizing: border-box; }
.testi-card { 
    background: white; padding: 40px; border-radius: 20px; 
    box-shadow: var(--shadow); height: 100%; display: flex; 
    flex-direction: column; justify-content: center; 
    border: 1px solid #eee; text-align: center; transition: transform 0.3s;
}
.testi-card:hover { transform: translateY(-5px); }
.testi-card p { font-size: 1.15rem; line-height: 1.8; margin-bottom: 20px; font-style: italic; color: var(--secondary); }
.testi-card h5 { color: var(--primary); font-weight: 800; font-size: 1.1rem; }

.testi-wrapper { position: relative; }
.testi-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 50px; height: 50px; background: white; border: 1px solid #eee;
    border-radius: 50%; box-shadow: var(--shadow); cursor: pointer;
    z-index: 10; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--primary); transition: 0.3s;
}
.testi-btn:hover { background: var(--primary); color: white; }
.testi-btn.prev { right: -25px; }
.testi-btn.next { left: -25px; }

.testi-dots { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.testi-dot { width: 12px; height: 12px; border-radius: 50%; background: #ddd; cursor: pointer; transition: 0.3s; }
.testi-dot.active { background: var(--primary); width: 30px; border-radius: 10px; }

/* ============================================
   11. FAQ Section
   ============================================ */
#faq details { background: white; margin-bottom: 15px; padding: 20px; border-radius: 10px; cursor: pointer; box-shadow: var(--shadow); }
#faq summary { font-weight: 800; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
#faq details p, #faq details div { padding-top: 15px; color: var(--text-muted); }

/* ============================================
   12. Contact Page Components
   ============================================ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.contact-card { background: white; padding: 40px; border-radius: 15px; box-shadow: var(--shadow); text-align: center; border-bottom: 5px solid var(--primary); }
.contact-card .icon { font-size: 3rem; margin-bottom: 20px; display: block; }

.contact-form { background: white; padding: 50px; border-radius: 20px; box-shadow: var(--shadow); }
.form-group { margin-bottom: 25px; text-align: right; }
.form-group label { display: block; margin-bottom: 10px; font-weight: 700; color: var(--secondary); }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 10px; font-family: 'Cairo', sans-serif; }

.info-box { background: var(--secondary); color: white; padding: 40px; border-radius: 20px; height: 100%; }

.contact-cta { background: var(--primary); color: white; text-align: center; }
.contact-cta h2 { font-size: 2.8rem; margin-bottom: 20px; color: white; }

/* ============================================
   13. Footer
   ============================================ */
footer { background: var(--secondary); color: white; padding-top: 60px; margin-top: auto; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; padding-bottom: 40px; }
.footer-col h4 { font-size: 1.3rem; margin-bottom: 25px; border-right: 4px solid var(--primary); padding-right: 15px; color: var(--accent); }
.footer-col p { color: #ccc; margin-bottom: 15px; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #eee; }
.footer-links a:hover { color: var(--primary); padding-right: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 30px 0; text-align: center; color: #888; font-size: 0.9rem; }

/* ============================================
   14. Mobile Sticky CTA Button
   ============================================ */
.sticky-ctas { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.sticky-ctas .btn { border-radius: 50%; width: 60px; height: 60px; padding: 0; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.sticky-ctas .svg-icon { width: 30px; height: 30px; }

/* ============================================
   15. 404 Page
   ============================================ */
.error-page { text-align: center; padding: 100px 20px; }
.error-page h1 { font-size: 3rem; color: var(--secondary); margin: 20px 0; }

/* ============================================
   16. Privacy Policy Page
   ============================================ */
.policy-container { background: white; padding: 40px; border-radius: 15px; box-shadow: var(--shadow); }

/* ============================================
   17. Responsive / Media Queries
   ============================================ */
@media (max-width: 1200px) {
    .testi-btn { display: none; }
}

@media (max-width: 992px) {
    .nav-links { display: none; position: absolute; top: 100%; right: 0; width: 100%; background: white; flex-direction: column; padding: 20px; box-shadow: var(--shadow); }
    .nav-links.show { display: flex; }
    .mobile-menu-btn { display: block; }
    .nav-cta { display: none; }
    .testi-item { width: 400px; }
}

@media (max-width: 768px) {
    section { padding: 60px 0; }
    .section-title h2 { font-size: 2rem; }
    .hero-home h1, .service-hero h1, .contact-hero h1 { font-size: 2.2rem; }
    .hero-home p, .service-hero p { font-size: 1.1rem; }
    .testi-item { width: 85vw; }
    .testi-viewport { padding: 20px 0; }
    .contact-form { padding: 30px; }
}

/* ============================================
   18. Scroll Reveal Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
/* ============================================
   17. Preloader
   ============================================ */
#preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    transition: opacity 0.5s ease, visibility 0.5s;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(228, 0, 43, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(228, 0, 43, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.spinner-logo {
    width: 40px;
    height: auto;
    animation: unspin 1s linear infinite; /* Counter-rotation to keep logo upright */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes unspin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}
