/* ============================================
   Al-Hulul Al-Sahiha - The Right Solutions
   Responsive Stylesheet
   ============================================ */

/* ============================================
   Large Desktops (1400px and below)
   ============================================ */
@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }

    .hero-content {
        max-width: 700px;
    }

    .footer-grid {
        grid-template-columns: 1.2fr 1fr 1fr 1fr;
        gap: 40px;
    }
}

/* ============================================
   Desktops (1200px and below)
   ============================================ */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
    }

    .nav-menu {
        gap: 25px;
    }

    .hero-stats {
        gap: 30px;
    }

    .stat-number {
        font-size: 2rem;
    }

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

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

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .header-cta {
        display: none;
    }
}

/* ============================================
   Tablets (992px and below)
   ============================================ */
@media (max-width: 992px) {
    :root {
        --section-padding: 80px 0;
    }

    .container {
        max-width: 720px;
    }

    /* Header */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 30px 30px;
        box-shadow: var(--shadow-xl);
        transition: var(--transition-normal);
        z-index: 1000;
    }

    .rtl .nav {
        right: auto;
        left: -100%;
    }

    .nav.active {
        right: 0;
    }

    .rtl .nav.active {
        right: auto;
        left: 0;
    }

    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 15px 0;
        color: var(--text-dark);
        font-size: 1.1rem;
        border-bottom: 1px solid var(--medium-gray);
    }

    .nav-actions {
        margin-top: 30px;
        width: 100%;
    }

    .lang-switcher {
        width: 100%;
        justify-content: center;
        background: var(--light-gray);
        color: var(--primary-color);
        border-color: var(--medium-gray);
    }

    .menu-toggle {
        display: flex;
    }

    /* Hero */
    .hero {
        min-height: 600px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-text {
        font-size: 1.1rem;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 20px;
    }

    .stat-item {
        flex: 1;
        min-width: 100px;
    }

    .slider-nav {
        bottom: 20px;
        right: 20px;
    }

    .rtl .slider-nav {
        right: auto;
        left: 20px;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .about-image {
        max-width: 500px;
        margin: 0 auto;
    }

    .about-image-badge {
        width: 120px;
        height: 120px;
        bottom: -20px;
        right: -20px;
    }

    .rtl .about-image-badge {
        right: auto;
        left: -20px;
    }

    .about-image-badge .years {
        font-size: 2.5rem;
    }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-info {
        order: 2;
    }

    .contact-form-wrapper {
        order: 1;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-about {
        grid-column: span 2;
    }
}

/* ============================================
   Large Mobile (768px and below)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
    }

    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.35rem;
    }

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

    /* Buttons */
    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .btn-lg {
        padding: 14px 30px;
        font-size: 1rem;
    }

    /* Header */
    .header-container {
        padding: 12px 15px;
    }

    .logo img {
        height: 40px;
    }

    .logo-text .company-name {
        font-size: 0.95rem;
    }

    .logo-text .company-tagline {
        font-size: 0.7rem;
    }

    /* Hero */
    .hero {
        min-height: 550px;
    }

    .hero-badge {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-text {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        padding-top: 30px;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .slider-dots {
        bottom: 80px;
    }

    /* About */
    .about-features {
        grid-template-columns: 1fr;
    }

    .about-image-main img {
        height: 350px;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 30px 25px;
    }

    /* Advantages */
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .advantage-card {
        padding: 30px 20px;
    }

    /* Branches */
    .branches-grid {
        grid-template-columns: 1fr;
    }

    .branch-image {
        height: 180px;
    }

    /* CTA */
    .cta {
        padding: 60px 0;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }

    .cta-phone {
        flex-direction: column;
        text-align: center;
    }

    .cta-phone-text {
        text-align: center;
    }

    /* Contact */
    .contact-info {
        padding: 40px 30px;
    }

    .contact-form-wrapper {
        padding: 30px 25px;
    }

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

    /* Footer */
    .footer {
        padding-top: 60px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-about {
        grid-column: span 1;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }

    /* Page Header */
    .page-header {
        padding: 150px 0 80px;
    }

    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }

    .rtl .back-to-top {
        right: auto;
        left: 20px;
    }
}

/* ============================================
   Small Mobile (480px and below)
   ============================================ */
@media (max-width: 480px) {
    :root {
        --section-padding: 50px 0;
    }

    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* Header */
    .logo-text {
        display: none;
    }

    .logo img {
        height: 35px;
    }

    /* Hero */
    .hero {
        min-height: 500px;
    }

    .hero-content {
        padding: 0 5px;
    }

    .hero h1 {
        font-size: 1.65rem;
    }

    .hero-text {
        font-size: 0.95rem;
    }

    .hero-stats {
        gap: 15px;
    }

    .stat-item {
        min-width: 80px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .slider-nav {
        display: none;
    }

    /* About */
    .about-image-badge {
        width: 100px;
        height: 100px;
        bottom: -15px;
        right: -10px;
    }

    .rtl .about-image-badge {
        right: auto;
        left: -10px;
    }

    .about-image-badge .years {
        font-size: 2rem;
    }

    .about-image-badge .text {
        font-size: 0.75rem;
    }

    .about-feature {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Services */
    .service-card {
        padding: 25px 20px;
    }

    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.6rem;
    }

    /* Advantages */
    .advantage-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Branches */
    .branch-content {
        padding: 20px;
    }

    .branch-actions {
        flex-direction: column;
    }

    /* Contact */
    .contact-info {
        padding: 30px 20px;
    }

    .contact-info-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-form-wrapper {
        padding: 25px 20px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px 15px;
    }

    /* Footer */
    .footer-bottom-links {
        flex-direction: column;
        gap: 10px;
    }

    /* Page Header */
    .page-header {
        padding: 130px 0 60px;
    }

    .breadcrumb {
        font-size: 0.85rem;
    }
}

/* ============================================
   Extra Small Mobile (360px and below)
   ============================================ */
@media (max-width: 360px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero-stats {
        justify-content: space-around;
    }

    .stat-item {
        min-width: 70px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* ============================================
   Landscape Mobile
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 100px 0 50px;
    }

    .hero h1 {
        font-size: 1.75rem;
        margin-bottom: 15px;
    }

    .hero-text {
        margin-bottom: 20px;
    }

    .hero-stats {
        padding-top: 20px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .header,
    .hero-slider,
    .slider-nav,
    .slider-dots,
    .back-to-top,
    .loading-screen {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: 50px 0;
    }

    .section {
        padding: 30px 0;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
    }

    .btn {
        border: 1px solid #000;
    }
}

/* ============================================
   High DPI / Retina Displays
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-slide img,
    .about-image-main img,
    .branch-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================
   Reduced Motion Preference
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable automatic dark mode
    :root {
        --white: #1a1a1a;
        --light-gray: #2a2a2a;
        --medium-gray: #3a3a3a;
        --text-dark: #f0f0f0;
        --text-light: #c0c0c0;
    }
    */
}
