/* =========================================================
   Responsive rules — desktop-first, cascading down.
   Breakpoints: 1200 laptop / 992 tablet-land / 768 tablet /
   576 mobile / 380 small-mobile
   ========================================================= */

@media (max-width:1200px){
  .container{ padding-inline:1.5rem; }
  .grid-4{ grid-template-columns:repeat(3,1fr); }
  .stats-grid{ grid-template-columns:repeat(3,1fr); row-gap:2rem; }
  .footer-grid{ grid-template-columns:1.3fr 1fr 1fr; }
  .footer-grid .footer-col:last-child{ grid-column:1 / -1; }
}

@media (max-width: 992px) {

    /* =========================
       HEADER
       ========================= */

    .header-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-inline-start: auto;
    }

    .hamburger {
        display: flex;
    }


    /* =========================
       MOBILE NAV
       ========================= */

    .main-nav {
        position: fixed;

        top: 0;
        bottom: 0;
        right: 0;

        width: min(320px, 84vw);
        height: 100vh;

        background: var(--surface, #fff);

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 0;

        padding: 80px 1.5rem 2rem;

        box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,.2));

        z-index: 1000;

        transform: translateX(110%);
        visibility: hidden;

        transition:
            transform 0.3s ease,
            visibility 0.3s ease;

        overflow-y: auto;
        overflow-x: hidden;
    }

    /* RTL */
  

    /* OPEN */
    .main-nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .main-nav a {
        display: flex;
        align-items: center;

        width: 100%;

        min-height: 52px;

        padding: 0.9rem 0;

        border-bottom: 1px solid var(--border, #ddd);

        text-decoration: none;
    }


    /* =========================
       MOBILE ACTION BUTTONS
       ========================= */

    .header-actions .btn {
        display: none;
    }

    .header-actions .theme-toggle {
        display: flex;
    }

    .lang-switch span.lang-full {
        display: none;
    }
}

@media (max-width: 768px) {

    .hero-slider {
        height: 70vh;
        min-height: 500px;
        max-height: 650px;
    }

    .hero-content {
        width: calc(100% - 2rem);
        max-width: 100%;

        margin-inline: 1rem;

        text-align: center;

        padding: 1rem;
    }

    .hero-content h1 {
        font-size: clamp(1.7rem, 7vw, 2.4rem);
        line-height: 1.3;

        margin-bottom: 0.75rem;
    }

    .hero-content p {
        font-size: 0.95rem;
        line-height: 1.6;

        max-width: 100%;
    }

    .hero-cta {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 0.65rem;

        width: 100%;
        max-width: 320px;

        margin-inline: auto;
    }

    .hero-cta .btn {
        width: 100%;
        min-height: 46px;
    }

    .hero-nav {
        width: 40px;
        height: 40px;
    }

    .hero-prev {
        inset-inline-start: 0.75rem;
    }

    .hero-next {
        inset-inline-end: 0.75rem;
    }
}
@media (max-width: 576px) {

    .section {
        padding-block: 2rem;
    }

    .section-head {
        width: 100%;
        text-align: center;
    }

    .section-head h2 {
        font-size: 1.35rem;
        line-height: 1.4;
    }

    .section-head p {
        font-size: 0.85rem;
        line-height: 1.7;
    }

    /* One card per row */
    .grid,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* Two stats per row */
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .search-box {
        width: 100%;
        box-sizing: border-box;

        padding: 0.9rem;
    }

    .search-grid {
        grid-template-columns: 1fr !important;
    }

    .search-actions {
        display: flex;
        flex-direction: column;

        gap: 0.6rem;
    }

    .search-actions .btn {
        width: 100%;
    }
}

@media (max-width:380px){
  .container{ padding-inline:1rem; }
  .brand{ font-size:1.05rem; }
  .hero-content h1{ font-size:1.7rem; }
  .search-box{ padding:1rem; }
}

@media (max-width:576px) and (orientation:landscape){
  .hero-slider{ height:100vh; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

/* =========================================================
   MOBILE HOME PAGE - FINAL LAYOUT FIX
   ========================================================= */

@media (max-width: 768px) {

    .hero-slider {
        height: 62dvh;
        min-height: 430px;
        max-height: 600px;
    }

    .hero-content {
        position: absolute;

        inset-inline: 1rem;
        bottom: 3.5rem;

        width: auto;
        max-width: none;

        margin: 0;

        padding: 0.75rem;

        text-align: center;
    }

    .hero-content h1 {
        font-size: clamp(1.5rem, 7vw, 2.2rem);

        line-height: 1.3;

        margin: 0.5rem 0;
    }

    .hero-content p {
        font-size: 0.85rem;

        line-height: 1.5;

        margin-bottom: 0.75rem;
    }

    .hero-cta {
        width: 100%;
        max-width: 300px;

        margin-inline: auto;

        display: flex;
        flex-direction: column;

        gap: 0.5rem;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .hero-nav {
        width: 38px;
        height: 38px;

        top: 50%;
    }
} 

