/* ===== MOBILE RESPONSIVE STYLES ===== */
/* مدارات كوم - Mobile Optimizations */

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: none;
    background: var(--f);
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.mobile-toggle span {
    width: 18px;
    height: 2px;
    background: var(--p);
    border-radius: 2px;
    transition: all 0.3s;
}

.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(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    right: -300px;
    width: 280px;
    height: calc(100vh - 70px);
    background: var(--w);
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding-top: 10px;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-item {
    border-bottom: 1px solid var(--g1);
}

.mobile-menu-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    color: var(--g8);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
}

.mobile-menu-link:hover {
    background: var(--f);
    color: var(--p);
}

.mobile-menu-link svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: transform 0.3s;
}

.mobile-menu-link i {
    font-size: 12px;
    transition: transform 0.3s;
}

.mobile-menu-item.open .mobile-menu-link svg,
.mobile-menu-item.open .mobile-menu-link i {
    transform: rotate(180deg);
}

.mobile-submenu {
    display: none;
    background: var(--f);
}

.mobile-menu-item.open .mobile-submenu {
    display: block;
}

.mobile-submenu a {
    display: block;
    padding: 12px 20px 12px 35px;
    color: var(--g6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--g1);
    transition: all 0.3s;
}

.mobile-submenu a:hover {
    color: var(--p);
    background: var(--w);
}

.mobile-submenu a:last-child {
    border-bottom: none;
}

/* Tablet Screens */
@media (max-width: 992px) {
    .n-links {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .nav {
        padding: 0 20px;
    }

    .topbar {
        padding: 8px 20px;
    }

    .sec {
        padding: 60px 20px;
    }

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

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

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

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

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

/* Mobile Screens */
@media (max-width: 768px) {
    .topbar {
        display: none;
    }

    .nav {
        height: 60px;
        padding: 0 16px;
    }

    .mobile-menu {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .mobile-menu-overlay {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .n-logo-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
        border-radius: 8px;
    }

    .n-logo-img {
        width: 38px;
        height: 38px;
        object-fit: contain;
    }

    .n-logo-text strong {
        font-size: 14px;
    }

    .n-logo-text small {
        display: none;
    }

    .hero {
        height: 60vh;
        min-height: 400px;
    }

    .hero-text h1 {
        font-size: 26px;
    }

    .hero-text p {
        font-size: 14px;
    }

    .hero-btns {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    .sec {
        padding: 50px 16px;
    }

    .sec-title {
        font-size: 24px;
    }

    .sec-desc {
        font-size: 13px;
    }

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

    .stat {
        padding: 20px 10px;
    }

    .stat-num {
        font-size: 28px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* الخدمات - 2 جنب بعض على الموبايل */
    .svc-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .svc-card-img {
        height: 140px;
    }

    .svc-card-body {
        padding: 16px;
    }

    .svc-card-body h3 {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .svc-card-body p {
        font-size: 11px;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .svc-card-footer {
        margin-top: 10px;
        padding-top: 10px;
    }

    .svc-card-link {
        font-size: 11px;
    }

    .svc-code {
        font-size: 9px;
        padding: 2px 6px;
    }

    .svc-badge {
        font-size: 9px;
        padding: 3px 8px;
    }

    /* قسم الشركة - الصورة والنص جنب بعض */
    [style*="grid-template-columns:1fr 1fr;gap:40px"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* الأرقام الصغيرة (500+ موظف، 10+ منفذ، 4.8M) */
    [style*="grid-template-columns:repeat(3,1fr);gap:10px"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .ft-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .ft-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .footer {
        padding: 40px 16px 20px;
    }

    /* Page Hero */
    .pg-hero {
        padding: 100px 16px 40px;
        min-height: 200px;
    }

    .pg-hero h1 {
        font-size: 26px;
    }

    .crumb {
        font-size: 12px;
    }

    /* Service Detail */
    .svc-detail {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .sidebar {
        position: static;
    }

    .svc-detail-content h2 {
        font-size: 22px;
    }

    .svc-detail-content img {
        height: 220px;
    }

    /* Contact Bar */
    .contact-bar {
        padding: 24px 16px;
    }

    .contact-bar-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cb-item {
        padding: 16px;
    }

    /* Info Bar */
    .info-bar {
        padding: 30px 16px;
    }

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

    .info-card {
        padding: 16px;
    }

    .info-card-val {
        font-size: 14px;
    }

    /* Values Grid - 2 في الصف */
    [style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    [style*="grid-template-columns:repeat(3,1fr)"]:not(.svc-grid) {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* الأنشطة المسجلة - 2 في الصف */
    [style*="grid-template-columns:repeat(3,1fr);gap:16px"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .nav {
        height: 55px;
    }

    .mobile-menu {
        top: 55px;
        height: calc(100vh - 55px);
        width: 100%;
        right: -100%;
    }

    .mobile-menu-overlay {
        top: 55px;
        height: calc(100vh - 55px);
    }

    .n-logo-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .n-logo-img {
        width: 32px;
        height: 32px;
    }

    .n-logo-text strong {
        font-size: 11px;
    }

    .n-logo-text small {
        display: none;
    }

    .hero {
        height: 55vh;
        min-height: 350px;
    }

    .hero-text h1 {
        font-size: 22px;
    }

    .hero-text p {
        font-size: 13px;
    }

    .stat-num {
        font-size: 24px;
    }

    .sec-title {
        font-size: 20px;
    }

    .pg-hero h1 {
        font-size: 22px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .mobile-menu-link,
    .mobile-submenu a {
        min-height: 44px;
    }
}

/* About Stats - always 3 columns */
.about-stats {
    grid-template-columns: repeat(3, 1fr) !important;
}
