/* =============================================
   El-Reda Steel - Responsive Stylesheet
   ============================================= */

/* ========== Extra Large Devices (1400px and up) ========== */
@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-title > span:first-child {
        font-size: 3.5rem;
    }
}

/* ========== Large Devices (1200px and up) ========== */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .prices-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* ========== Medium Devices (992px and up) ========== */
@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }

    /* Mobile top bar: hide desktop, show slogan */
    .top-bar-desktop {
        display: none !important;
    }

    .top-bar-mobile-slogan {
        display: block !important;
    }

    /* Show mobile menu extras */
    .mobile-menu-extras {
        display: block;
    }
    
    /* Navigation */
    .mobile-toggle {
        display: flex;
    }

    .nav-overlay {
        display: none !important;
    }
    
    #navMenu.nav-menu {
        position: fixed;
        top: 0 !important;
        right: -110% !important;
        left: auto !important;
        width: min(88vw, 360px) !important;
        height: 100vh;
        background: linear-gradient(180deg, #070707 0%, #111111 100%) !important;
        flex-direction: column;
        align-items: stretch;
        padding: 76px 16px 24px !important;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.9) !important;
        transition: right 0.28s ease !important;
        z-index: 20001 !important;
        overflow-y: auto;
        border-left: 1px solid rgba(212, 175, 55, 0.45) !important;
    }
    
    [dir="ltr"] .nav-menu {
        right: auto;
        left: -110% !important;
    }
    
    #navMenu.nav-menu.active {
        right: 0 !important;
    }
    
    [dir="ltr"] .nav-menu.active {
        right: auto !important;
        left: 0 !important;
    }
    
    #navMenu .nav-link {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(212, 175, 55, 0.18);
        color: #f3f4f6;
        font-weight: 700;
        letter-spacing: 0.2px;
        border-radius: 10px;
    }

    #navMenu .nav-link:hover {
        color: #f8dc82;
        background: rgba(212, 175, 55, 0.14);
    }

    #navMenu .nav-link.active {
        color: #f8dc82;
        background: rgba(212, 175, 55, 0.18);
    }
    
    #navMenu .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        padding-right: 16px;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition);
        background: rgba(212, 175, 55, 0.06);
        border-radius: 10px;
        margin-top: 6px;
    }
    
    [dir="ltr"] .dropdown-menu {
        padding-right: 0;
        padding-left: 20px;
    }
    
    #navMenu .dropdown.active .dropdown-menu {
        max-height: 500px;
    }

    #navMenu .dropdown-menu a {
        color: #e5e7eb;
        border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    }

    #navMenu .dropdown-menu a:hover {
        color: #f8dc82;
        background: rgba(212, 175, 55, 0.1);
    }

    #navMenu .submenu-toggle {
        width: 100%;
        background: rgba(212, 175, 55, 0.12);
        border: 1px solid rgba(212, 175, 55, 0.22);
        color: #f9df8d;
        margin-top: 6px;
        margin-bottom: 6px;
    }

    #navMenu .submenu-menu {
        background: rgba(255, 255, 255, 0.02);
        border-radius: 10px;
    }

    #navMenu .submenu-menu a {
        padding-right: 28px;
        font-size: 0.92rem;
    }

    #navMenu .dropdown-category {
        color: #9ca3af;
        border-bottom: 0;
        font-size: 0.88rem;
        padding: 12px 14px 8px;
    }
    
    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.28) !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: var(--transition);
        z-index: 20000;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    #navMenu.nav-menu {
        opacity: 1 !important;
        filter: none !important;
        isolation: isolate;
    }

    #navMenu.nav-menu::before,
    #navMenu.nav-menu::after {
        content: none !important;
    }
    
    /* Hero */
    .hero {
        min-height: 80vh;
    }
    
    .hero-title > span:first-child {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    /* Section */
    section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    /* CTA */
    .cta-content h2 {
        font-size: 2rem;
    }
}

/* ========== Small Devices (768px and up) ========== */
@media (max-width: 768px) {
    .container {
        max-width: 540px;
    }
    
    /* Top Bar */
    .top-bar-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* Hero */
    .hero {
        min-height: 70vh;
        padding-top: 40px;
    }
    
    .hero-title > span:first-child {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-desc {
        font-size: 1rem;
    }
    
    .hero-btns {
        flex-direction: column;
    }
    
    .hero-btns .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Prices */
    .prices-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    
    .price-card {
        max-width: none;
        margin: 0;
    }
    
    .price-value .amount {
        font-size: 2rem;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* CTA */
    .cta-content h2 {
        font-size: 1.75rem;
    }
    
    .cta-btns {
        flex-direction: column;
    }
    
    .cta-btns .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-col h4::after {
        right: 50%;
        transform: translateX(50%);
    }
    
    [dir="ltr"] .footer-col h4::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .footer-links a {
        justify-content: center;
    }
    
    .footer-contact li {
        justify-content: center;
    }
    
    /* Section */
    section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    /* Page Header */
    .page-header {
        padding: 100px 0 40px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }

    /* Factories Grid */
    .factories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .factory-chip {
        min-width: 0;
        padding: 11px 14px;
        font-size: 0.9rem;
    }

    .factory-chip img {
        width: 30px;
        height: 30px;
    }

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

    .branch-card {
        padding: 24px 20px;
    }
}

/* ========== Extra Small Devices (576px and down) ========== */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    /* Top Bar */
    .top-bar {
        padding: 8px 0;
    }
    
    .social-lang {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Header */
    .navbar {
        padding: 10px 0;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .logo-ar {
        font-size: 1rem;
    }
    
    .logo-en {
        font-size: 0.65rem;
    }
    
    /* Hero */
    .hero {
        min-height: auto;
        padding: 60px 0;
    }
    
    .hero-badge {
        padding: 8px 15px;
        font-size: 0.8rem;
        margin-bottom: 20px;
    }
    
    .hero-title > span:first-child {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-top: 8px;
    }
    
    .hero-desc {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }
    
    .hero-scroll {
        display: none;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 22px;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    /* Prices */
    .prices-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .price-card-header {
        padding: 16px;
    }
    
    .price-card-body {
        padding: 16px;
    }
    
    .price-value .amount {
        font-size: 1.55rem;
    }

    .price-card-header h3 {
        font-size: 1.2rem;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
    }
    
    .last-update {
        flex-direction: column;
        gap: 5px;
    }
    
    /* Features */
    .feature-card {
        padding: 30px 20px;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    .feature-card h3 {
        font-size: 1.1rem;
    }
    
    /* Products */
    .product-image {
        height: 180px;
    }
    
    .product-content {
        padding: 20px;
    }
    
    .product-content h3 {
        font-size: 1.1rem;
    }
    
    .product-specs {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Stats */
    .stats-section {
        padding: 60px 0;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* CTA */
    .cta-section {
        padding: 60px 0;
    }
    
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    /* Footer */
    .footer-top {
        padding: 50px 0 30px;
    }
    
    .footer-col h4 {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    /* Section */
    section {
        padding: 50px 0;
    }
    
    .section-badge {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-desc {
        font-size: 1rem;
    }
    
    /* Page Header */
    .page-header {
        padding: 80px 0 30px;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .breadcrumb {
        font-size: 0.9rem;
    }
    
    /* Floating Buttons */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 20px;
        left: 20px;
    }
    
    [dir="ltr"] .whatsapp-float {
        left: auto;
        right: 20px;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 1rem;
        bottom: 80px;
        left: 20px;
    }
    
    [dir="ltr"] .back-to-top {
        left: auto;
        right: 20px;
    }
    
    /* Nav Menu Mobile */
    .nav-menu {
        width: 100%;
    }

    /* Company Intro */
    .company-intro {
        padding: 50px 0;
    }

    .intro-text {
        font-size: 0.95rem;
        line-height: 1.9;
    }

    /* Factories */
    .factories-section {
        padding: 50px 0;
    }

    .factories-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .factory-chip {
        min-width: 0;
        padding: 10px 12px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .factory-chip img {
        width: 26px;
        height: 26px;
        border-radius: 7px;
    }

    /* Branches */
    .branches-section {
        padding: 50px 0;
    }

    .branches-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .branch-card {
        padding: 20px 16px;
    }

    .branch-card h3 {
        font-size: 0.95rem;
    }

    .branch-card p {
        font-size: 0.85rem;
    }

    .branch-icon {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    /* Stat suffix */
    .stat-suffix {
        font-size: 1.2rem;
    }
    
    /* Prices Note */
    .prices-note {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
}

/* ========== Mobile Nav Refinements ========== */
@media (max-width: 992px) {
    .mobile-nav-close {
        display: none !important;
        position: absolute;
        top: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(212, 175, 55, 0.15);
        color: var(--primary-color);
        border-radius: 50%;
        border: 1px solid rgba(212, 175, 55, 0.5);
        z-index: 2;
        transition: var(--transition);
    }

    .mobile-nav-close:hover {
        background: var(--primary-color);
        color: var(--secondary-color);
    }

    [dir="ltr"] .mobile-nav-close {
        left: auto;
        right: 16px;
    }

    /* Better touch targets for mobile */
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Mobile footer improvements */
    .footer-contact li {
        flex-direction: row;
        justify-content: center;
        text-align: right;
        gap: 10px;
    }
    
    .footer-contact i {
        margin: 0;
    }
}

/* ========== Print Styles ========== */
@media print {
    .header,
    .top-bar,
    .hero,
    .whatsapp-float,
    .back-to-top,
    .footer {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    section {
        padding: 20px 0;
    }
    
    .price-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ========== Dark Mode Support (Future) ========== */
@media (prefers-color-scheme: dark) {
    /* Reserved for future dark mode implementation */
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .whatsapp-float {
        animation: none;
    }
    
    .hero-scroll a {
        animation: none;
    }
}

/* ========== High Contrast Mode ========== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #FF5500;
        --secondary-color: #000000;
        --gray-500: #333333;
    }
    
    .btn-primary {
        border: 2px solid var(--white);
    }
    
    .btn-outline {
        border-width: 3px;
    }
}

