/* =============================
   Responsive
   1440 / 1200 / 1024 / 900 / 768 / 640 / 480 / 375
============================= */

/* ---- Large laptop ---- */
@media (max-width: 1200px) {
    :root {
        --gutter: 22px;
    }

}

/* ---- Tablet landscape / small laptop ---- */
@media (max-width: 1024px) {
    :root {
        --header-height: 70px;
    }

    /* Desktop nav -> hamburger */
    .nav,
    .header-cta {
        display: none;
    }

    .nav-toggle {
        display: grid;
    }

    .header-inner {
        justify-content: space-between;
    }

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

    .services-grid .service-card--featured {
        grid-column: span 2;
    }

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

    .steps::before {
        display: none;
    }

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

    /* ยุบเหลือคอลัมน์เดียว และยกเลิกการสลับซ้าย-ขวา
       ลำดับต้องเป็น หัวข้อ -> รูป+ปุ่ม -> รายละเอียด เสมอ */
    .service-detail,
    .service-detail:nth-of-type(even) {
        grid-template-columns: 1fr;
        grid-template-areas:
            "head"
            "intro"
            "body";
    }

    .tab-panel {
        grid-template-columns: 1fr;
    }

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

}

/* ---- Tablet portrait ---- */
@media (max-width: 900px) {
    .hero {
        min-height: 0;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .hero-title {
        max-width: 20ch;
    }

    .hero-visual {
        max-width: 520px;
        margin-inline: auto;
        width: 100%;
    }

    .why-grid,
    .about-grid,
    .qualify-grid {
        grid-template-columns: 1fr;
    }

    /* ให้ภาพอยู่ใต้เนื้อหาเสมอบนจอเล็ก อ่านง่ายกว่า */
    .why-visual,
    .about-visual {
        order: 2;
        max-width: 560px;
        margin-inline: auto;
        width: 100%;
    }

    .why-content,
    .about-content {
        order: 1;
    }
}

/* ---- Small tablet / large mobile ---- */
@media (max-width: 768px) {
    :root {
        --gutter: 18px;
    }

    .trust-bar {
        margin-top: -28px;
    }

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

    .services-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .cta-band-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cta-band h2,
    .cta-band p {
        max-width: 100%;
        margin-inline: auto;
    }

    .cta-band-actions {
        justify-content: center;
        width: 100%;
    }

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

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    .services-grid,
    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .services-grid .service-card--featured {
        grid-column: span 1;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 26px;
        text-align: left;
    }

    .step {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 4px 16px;
        text-align: left;
        align-items: center;
    }

    .step-num {
        grid-row: span 2;
        margin: 0;
        width: 46px;
        height: 46px;
        box-shadow: 0 8px 18px rgba(255, 106, 0, 0.26);
    }

    .step h3 {
        margin-bottom: 0;
        align-self: end;
    }

    .step p {
        margin-inline: 0;
        max-width: none;
        align-self: start;
    }

    .about-highlight {
        flex-basis: 100%;
    }

    .tablist {
        border-radius: var(--radius-lg);
    }

    .tab-btn {
        flex: 1 1 100%;
    }

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

    /* บนมือถือ chip ไม่ต้องยืดเต็มแถบ ปล่อยให้เลื่อนแนวนอนตามความกว้างจริง */
    .svc-chip {
        flex: 0 0 auto;
        padding: 8px 15px;
    }

    /* จอเล็กปุ่มตกมาคนละบรรทัดกับหัวข้ออยู่แล้ว ยืดเต็มความกว้างจะกดง่ายกว่าลอยชิดขวา */
    .service-detail-head .btn {
        width: 100%;
        margin-left: 0;
    }

    .contact-prepare {
        flex-direction: column;
        gap: 14px;
    }

    .slider-controls {
        gap: 14px;
    }
}

/* ---- Small mobile ---- */
@media (max-width: 480px) {
    :root {
        --gutter: 16px;
        --radius-xl: 26px;
        --radius-lg: 20px;
    }

    .hero-actions .btn,
    .cta-band-actions .btn {
        flex: 1 1 100%;
    }

    .hero-chip {
        padding: 10px 13px;
        gap: 9px;
    }

    .hero-chip .icon-box--sm {
        width: 36px;
        height: 36px;
    }

    /* Trust bar คงเป็น Grid 2x2 บนมือถือตามที่กำหนดไว้ */
    .trust-item {
        gap: 9px;
        padding: 13px 11px;
    }

    .trust-item svg {
        width: 20px;
        height: 20px;
    }

    .trust-item span span {
        font-size: 0.74rem;
    }

    .filter-bar {
        gap: 8px;
    }

    .filter-btn {
        flex: 1 1 calc(50% - 4px);
        padding: 10px 12px;
        text-align: center;
    }

    .contact-panel,
    .contact-prepare {
        padding: 22px 20px;
    }

    .review-foot {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---- Very small mobile ---- */
@media (max-width: 375px) {
    .brand {
        font-size: 1.05rem;
    }

    /* จอแคบมาก ชิปสองอันวางคู่กันจะบีบจนข้อความตัด ให้เรียงลงมาทีละอัน */
    .hero-visual {
        grid-template-columns: 1fr;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }
}

/* ---- Wide desktop ---- */
@media (min-width: 1600px) {
    :root {
        --container: 1240px;
    }
}

/* ---- Print ---- */
@media print {
    .site-header,
    .mobile-nav,
    .nav-backdrop,
    .orb-layer,
    .cta-band,
    .slider-controls {
        display: none !important;
    }

    body {
        background: #fff;
    }
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .form-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .legal-toc ol {
        grid-template-columns: 1fr;
    }
}
