/* =====================================================================
   JAVID SOFTWARE CENTER — RESPONSIVE STYLES
   ===================================================================== */

/* ---------- Large tablets (max 1024px) ---------- */
@media (max-width: 1024px) {
    .header-actions .btn { display: none; }

    .primary-nav a {
        padding: 8px 10px;
        font-size: 14px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .grid-4 { grid-template-columns: repeat(2, 1fr); }

    .hero h1 { font-size: 2.75rem; }
}

/* ---------- Tablets (max 860px) ---------- */
@media (max-width: 860px) {
    /* Mobile nav */
    .nav-toggle { display: flex; order: 3; }

    .primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .primary-nav.is-open {
        max-height: 520px;
        overflow-y: auto;
    }

    .primary-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
    }

    .primary-nav a {
        display: block;
        padding: 14px 20px;
        border-radius: 0;
        font-size: 15px;
    }

    .header-inner { position: relative; flex-wrap: wrap; }
    .brand { order: 1; }
    .header-actions { display: none; }

    /* Layout */
    .section { padding: 56px 0; }
    .section-lg { padding: 72px 0; }

    .section-head h2 { font-size: 1.85rem; }
    .section-head p  { font-size: 16px; }

    /* Hero */
    .hero { padding: 72px 0 64px; }
    .hero h1 { font-size: 2.25rem; }
    .hero p.lead { font-size: 17px; }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        margin-top: 48px;
        padding-top: 32px;
    }

    .hero-stat .num { font-size: 1.4rem; }
    .hero-stat .lbl { font-size: 11px; }

    /* Grids */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row { grid-template-columns: 1fr; }

    /* CTA */
    .cta-section { padding: 56px 20px; border-radius: var(--radius-lg); }
    .cta-section h2 { font-size: 1.65rem; }

    /* Page header */
    .page-header { padding: 40px 0 32px; }
    .page-header h1 { font-size: 2rem; }
}

/* ---------- Phones (max 560px) ---------- */
@media (max-width: 560px) {
    body { font-size: 15px; }

    .container { padding: 0 16px; }

    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .section { padding: 44px 0; }

    .section-head { margin-bottom: 36px; }
    .section-head h2 { font-size: 1.5rem; }
    .section-head p  { font-size: 15px; }

    /* Brand */
    .brand-logo { width: 38px; height: 38px; font-size: 13px; }
    .brand-name { font-size: 14px; }
    .brand-tag  { font-size: 10px; }

    /* Hero */
    .hero { padding: 56px 0 48px; }
    .hero h1 { font-size: 1.85rem; }
    .hero p.lead { font-size: 16px; }

    .hero-badge { font-size: 12px; padding: 5px 12px; }

    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* All grids single column */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Cards */
    .card-body { padding: 18px; }
    .card-title { font-size: 1.05rem; }
    .card-text { font-size: 14px; }

    .feature-card { padding: 24px 20px; }
    .feature-icon { width: 48px; height: 48px; font-size: 20px; }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal { justify-content: center; }

    /* Buttons */
    .btn { padding: 11px 20px; font-size: 14.5px; }
    .btn-lg { padding: 13px 24px; font-size: 15px; }

    /* Table */
    .table th, .table td { padding: 10px 12px; font-size: 13.5px; }

    /* Page header */
    .page-header { padding: 32px 0 24px; }
    .page-header h1 { font-size: 1.65rem; }
    .page-header p  { font-size: 15px; }

    /* CTA */
    .cta-section { padding: 40px 18px; margin: 48px 0; }
    .cta-section h2 { font-size: 1.4rem; }
    .cta-section p  { font-size: 15px; }
}

/* ---------- Print ---------- */
@media print {
    .site-header, .site-footer, .nav-toggle, .hero-actions, .cta-section {
        display: none;
    }
    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
}

/* ---------- Service Details two-column → single column ---------- */
@media (max-width: 860px) {
    /* The service-details page uses an inline two-column grid.
       Force it to stack on tablets and phones. */
    main > section > .container > div[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    aside .card {
        position: static !important;
    }
}

/* ---------- Software Details two-column → single column ---------- */
@media (max-width: 860px) {
    .software-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    aside .card {
        position: static !important;
    }
}

/* ---------- Product Details two-column → single column ---------- */
@media (max-width: 860px) {
    .product-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    aside .card {
        position: static !important;
    }
}

/* ---------- Contact two-column → single column ---------- */
@media (max-width: 860px) {
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

/* ---------- Contact info items ---------- */
.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.contact-info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: var(--radius);
    font-size: 18px;
}

.contact-info-label {
    font-size: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 2px;
}

.contact-info-value {
    font-size: 14.5px;
    color: var(--color-text);
    font-weight: 600;
    line-height: 1.4;
}



/* =====================================================================
   MOBILE BRAND — SMALLER & CLEANER
   ===================================================================== */

@media (max-width: 860px) {
    /* Brand container */
    .brand {
        gap: 10px;
        flex-shrink: 1;
        min-width: 0;
        max-width: calc(100% - 60px);
    }

    /* Logo - smaller */
    .brand-logo {
        width: 38px;
        height: 38px;
        font-size: 12px;
        border-radius: 9px;
        flex-shrink: 0;
    }

    /* Brand text container */
    .brand-text {
        min-width: 0;
        overflow: hidden;
    }

    /* Brand name - smaller, single line */
    .brand-name {
        font-size: 13.5px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    /* Hide the "Khost, Afghanistan" tag on mobile */
    .brand-tag {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .brand-logo {
        width: 34px;
        height: 34px;
        font-size: 11px;
        border-radius: 8px;
    }

    .brand-name {
        font-size: 12.5px;
        max-width: 140px;
    }

    .brand {
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .brand-name {
        max-width: 110px;
        font-size: 12px;
    }

    .brand-logo {
        width: 32px;
        height: 32px;
        font-size: 10.5px;
    }
}

/* =====================================================================
   MOBILE BRAND FIX — Only ONE logo, aligned left
   ===================================================================== */

@media (max-width: 860px) {

    /* ۱. د برانډ لینک کیڼ اړخ ته تنظیم کړه */
    .header-inner .brand {
        justify-content: flex-start !important;
        margin-left: 0 !important;
        margin-right: auto !important;
        order: 1 !important;
    }

    /* ۲. د برانډ دننه HTML عناصر تنظیم کړه */
    .brand > * {
        flex-shrink: 0;
    }

    /* ۳. که دوه لوګوونه وي، دوهم پټ کړه (ژېړ) */
    .brand > .brand-logo ~ .brand-logo,
    .brand > .brand-logo + .brand-logo {
        display: none !important;
    }

    /* ۴. یا که د لومړي ماشوم (child) باندې ژېړ وي */
    .brand > *:first-child:not(.brand-logo) {
        display: none !important;
    }

    /* ۵. د brand-name او brand-text تنظیم */
    .brand-text {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}


@media (max-width: 860px) {
    .header-inner {
        justify-content: space-between !important;
        align-items: center !important;
    }

    .header-inner .brand {
        order: 1 !important;
        flex: 0 1 auto !important;
        margin: 0 !important;
    }

    .header-inner .nav-toggle {
        order: 3 !important;
        flex: 0 0 auto !important;
        margin-left: auto !important;
    }
}