/* =============================================
   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;
        min-height: 104px;
        flex-direction: column;
        gap: 8px;
        padding: 12px 8px;
        font-size: 0.86rem;
        text-align: center;
    }

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

    .factory-chip span {
        text-align: center;
    }


    /* 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: 96px;
        height: 48px;
        padding: 2px 3px;
        border-radius: 6px !important;
    }

    .brand-logo img {
        width: 124%;
        height: 124%;
    }
    
    .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: 190px;
        padding: 42px 12px 20px;
    }
    
    .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-header .section-badge {
        margin-bottom: 12px;
    }

    .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: 34px 0 50px;
    }

    .company-intro .section-badge {
        margin-bottom: 12px;
    }

    .company-intro .section-title {
        margin-bottom: 18px;
    }

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

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

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

    .factory-chip {
        min-width: 0;
        min-height: 100px;
        flex-direction: column;
        gap: 8px;
        padding: 11px 7px;
        font-size: 0.8rem;
        text-align: center;
        border-radius: 12px;
    }

    .factory-chip img {
        width: 78px;
        height: 38px;
        border-radius: 8px;
    }

    .factory-chip span {
        text-align: center;
    }


    /* 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;
    }
}

/* =================================================================
   ===============  PREMIUM REFRESH - RESPONSIVE  ==================
   Re-tunes the new larger spacing/typography for smaller screens.
   ================================================================= */

@media (max-width: 1200px) {
    section { padding: 100px 0; }
}

@media (max-width: 992px) {
    section { padding: 84px 0; }
    .hero { min-height: 88vh; }
    .page-header { padding: 130px 0 56px; }
    .product-header { padding: 130px 0 70px !important; }
}

@media (max-width: 768px) {
    section { padding: 68px 0; }
    .hero { min-height: auto; padding: 90px 0 60px; }
    .section-title::after { margin-top: 14px; }
    .product-header { padding: 110px 0 56px !important; }
    /* keep card top-sheen tidy on small cards */
    .price-card::before, .product-card::before,
    .feature-card::before, .branch-card::before { left: 12px; right: 12px; }
}

@media (max-width: 576px) {
    section { padding: 56px 0; }
    .hero { padding: 70px 0 50px; }
    .section-desc { font-size: 0.98rem; }
    .page-header { padding: 110px 0 40px; }
    /* tame heavy hover transforms on touch */
    .price-card:hover, .product-card:hover,
    .feature-card:hover, .branch-card:hover { transform: translateY(-4px); }
}

/* Touch devices: disable hover-lift jitter, keep tap feedback */
@media (hover: none) {
    .price-card:hover, .product-card:hover,
    .feature-card:hover, .branch-card:hover,
    .factory-chip:hover, .related-item:hover { transform: none; }
}

/* Keep the hero headline readable on narrow mobile screens. */
@media (max-width: 576px) {
    .hero-title {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 18px;
    }

    .hero-title > span:first-child {
        font-size: clamp(2.2rem, 10vw, 2.8rem);
        line-height: 1.35;
        letter-spacing: 0;
        padding-bottom: 4px;
    }

    .hero-subtitle {
        margin-top: 0;
        font-size: 1.02rem;
        line-height: 1.85;
        padding-top: 2px;
    }
}

@media (max-width: 380px) {
    .hero-title > span:first-child {
        font-size: 2.05rem;
    }

    .hero-subtitle {
        font-size: 0.96rem;
    }
}

@media (max-width: 576px) {
    .factories-section .factories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .factories-section .factory-chip {
        min-width: 0;
        width: 100%;
    }

    .contact-widget {
        left: 10px;
        right: 10px;
        bottom: 10px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        align-items: stretch;
    }

    .contact-widget-btn,
    .contact-widget-btn:hover {
        width: 100%;
        min-height: 54px;
        border-radius: 14px;
        flex-direction: column;
        gap: 3px;
        transform: none;
    }

    .contact-widget-btn i {
        font-size: 1.12rem;
    }

    .contact-widget-btn span,
    .contact-widget-btn:hover span {
        max-width: none;
        opacity: 1;
        font-size: 0.72rem;
    }

    .contact-widget-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 78px;
        width: auto;
        max-height: calc(100vh - 110px);
        overflow: auto;
    }

    .product-badge {
        top: 8px;
        right: 8px;
        padding: 5px 9px;
        font-size: 0.68rem;
    }

    .product-image .home-product-logo {
        width: min(92%, 220px);
        max-height: 112px;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .tools-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .weights-guide-layout,
    .cement-specs-grid,
    .products-faq-grid,
    .seo-layout,
    .seo-link-grid {
        grid-template-columns: 1fr;
    }

    .weights-guide-section,
    .cement-specs-section,
    .products-faq-section,
    .specs-guide-section {
        padding: 56px 0;
    }
}

@media (max-width: 480px) {
    .tools-panels {
        padding: 14px;
    }

    .tool-tab {
        min-height: 50px;
        font-size: 0.82rem;
    }

    .tool-grid,
    .tool-result {
        grid-template-columns: 1fr;
    }

    .spec-guide-card {
        padding: 16px;
    }

    .weights-table-card,
    .factory-sizes-card {
        padding: 14px;
    }

    .steel-weight-table {
        min-width: 560px;
        font-size: 0.82rem;
    }

    .steel-weight-table th,
    .steel-weight-table td {
        padding: 10px 8px;
    }

    .seo-page-section {
        padding: 56px 0;
    }

    .seo-card,
    .seo-side-card {
        padding: 16px;
    }

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