/* =========================================================
   PANARE MOBILE ONLY CSS
   ไฟล์นี้ใช้เฉพาะมือถือ: assets/css/mobile.css
   Desktop ไม่โดนกระทบ ถ้าเรียกด้วย:
   media="screen and (max-width: 820px)"
========================================================= */

/* ซ่อน element มือถือไว้ก่อน กันกรณี CSS โหลดผิด */
.mobile-header-only,
.mobile-drawer,
.mobile-drawer-backdrop {
    display: none;
}

@media (max-width: 820px) {

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
        background: #f5f7fb;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    img {
        max-width: 100%;
    }

    .wrap {
        width: calc(100% - 22px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* ซ่อน header เดิมบนมือถือ เพราะใช้ mobile header แยก */
    .site-header {
        display: none !important;
    }

    /* ซ่อนโซนบริการวงกลมทดลอง ถ้ายังมีอยู่ใน index.php */
    .home-mobile-style-zone {
        display: none !important;
    }

    /* =====================================================
       MOBILE HEADER + DRAWER MENU
    ===================================================== */

    .mobile-header-only {
        display: block;
        position: sticky;
        top: 0;
        z-index: 99990;
        background: #ffffff;
        box-shadow: 0 4px 16px rgba(11, 45, 99, .08);
    }

    .mobile-header-topline {
        height: 5px;
        background: linear-gradient(90deg, #0b2d63 0%, #d9bd77 100%);
    }

    .mobile-header-bar {
        min-height: 66px;
        display: grid;
        grid-template-columns: 46px 1fr 46px;
        align-items: center;
        gap: 10px;
        background: #fff;
    }

    .mobile-drawer-open,
    .mobile-header-toggle {
        width: 40px;
        height: 40px;
        border: 0;
        background: transparent;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        padding: 0;
        cursor: pointer;
    }

    .mobile-drawer-open span,
    .mobile-header-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: #0b2d63;
        border-radius: 999px;
        margin: 0 auto;
    }

    .mobile-header-logo {
        display: flex;
        justify-content: center;
        align-items: center;
        min-width: 0;
    }

    .mobile-header-logo img {
        height: 46px;
        width: auto;
        max-width: 150px;
        object-fit: contain;
    }

    .mobile-header-call,
    .mobile-header-action {
        width: 40px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: #0b2d63;
        color: #fff;
        font-size: 15px;
        font-weight: 700;
        line-height: 1;
        border-radius: 999px;
        text-decoration: none;
    }

    .mobile-header-action img,
    .mobile-header-call img {
        width: 22px;
        height: 22px;
        object-fit: contain;
    }

    .mobile-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(5, 15, 30, .48);
        z-index: 99991;
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: min(82vw, 330px);
        height: 100vh;
        background: linear-gradient(180deg, #0b2d63 0%, #071b3d 100%);
        z-index: 99992;
        transform: translate3d(-105%, 0, 0);
        transition: transform .32s ease;
        box-shadow: 18px 0 34px rgba(0, 0, 0, .22);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-menu-open .mobile-drawer {
        transform: translate3d(0, 0, 0);
    }

    body.mobile-menu-open .mobile-drawer-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .mobile-drawer-head {
        position: relative;
        padding: 24px 20px 18px;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, .14);
    }

    .mobile-drawer-head::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 5px;
        background: linear-gradient(90deg, #d9bd77, #ffffff, #d9bd77);
    }

    .mobile-drawer-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 34px;
        height: 34px;
        border: 1px solid rgba(255, 255, 255, .22);
        background: rgba(255, 255, 255, .08);
        color: #fff;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
    }

    .mobile-drawer-logo {
        width: 72px;
        height: 72px;
        margin: 10px auto 12px;
        background: #fff;
        border-radius: 50%;
        display: grid;
        place-items: center;
        padding: 6px;
    }

    .mobile-drawer-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .mobile-drawer-head strong {
        display: block;
        color: #ffffff;
        font-size: 21px;
        line-height: 1.05;
        font-weight: 700;
    }

    .mobile-drawer-head span {
        display: block;
        margin-top: 6px;
        color: rgba(255, 255, 255, .74);
        font-size: 14px;
        line-height: 1.3;
    }

    .mobile-drawer-nav {
        display: grid;
        padding: 14px 18px;
    }

    .mobile-drawer-nav a {
        display: flex;
        align-items: center;
        min-height: 46px;
        color: #ffffff;
        font-size: 18px;
        font-weight: 700;
        border-bottom: 1px solid rgba(255, 255, 255, .14);
        text-decoration: none;
    }

    .mobile-drawer-nav a::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #d9bd77;
        margin-right: 10px;
        flex: 0 0 auto;
    }

    .mobile-drawer-contact {
        margin-top: auto;
        padding: 18px;
        display: grid;
        gap: 9px;
        border-top: 1px solid rgba(255, 255, 255, .14);
    }

    .mobile-drawer-contact a {
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        background: rgba(255, 255, 255, .08);
        border: 1px solid rgba(255, 255, 255, .15);
        color: #ffffff;
        font-size: 15px;
        font-weight: 700;
        padding: 8px 10px;
        text-decoration: none;
    }

    .mobile-drawer-contact a:first-child {
        background: #d9bd77;
        color: #0b2d63;
        border-color: #d9bd77;
    }

    /* รองรับเมนูแบบ dropdown เดิม ถ้ายังมีอยู่ */
    .mobile-header-nav {
        display: none;
        background: #ffffff;
        border-top: 1px solid #eceff4;
        box-shadow: 0 10px 20px rgba(11, 45, 99, 0.08);
    }

    .mobile-header-nav.show {
        display: block;
    }

    .mobile-header-nav a {
        display: block;
        padding: 14px 16px;
        border-bottom: 1px solid #edf1f5;
        color: #0b2d63;
        font-size: 17px;
        font-weight: 600;
        text-decoration: none;
        background: #fff;
    }

    /* =====================================================
       HAJJ HOME MOBILE
    ===================================================== */

    .hajj-home-zone {
        padding: 24px 0 30px !important;
        background: #0b2d63 !important;
        min-height: auto !important;
        display: block !important;
    }

    .hajj-zone-head {
        display: block !important;
        margin-bottom: 16px !important;
        text-align: left !important;
    }

    .hajj-zone-head p {
        font-size: 14px !important;
        margin-bottom: 4px !important;
        color: #d9bd77 !important;
    }

    .hajj-zone-head h1 {
        font-size: 30px !important;
        line-height: 1.05 !important;
        color: #fff !important;
    }

    .hajj-zone-head span {
        font-size: 14px !important;
        line-height: 1.35 !important;
        color: rgba(255, 255, 255, .85) !important;
    }

    .hajj-head-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        margin-top: 13px !important;
        height: 42px !important;
        min-height: 42px !important;
        min-width: 150px !important;
        padding: 0 18px !important;
        background: #d9bd77 !important;
        color: #0b2d63 !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
    }

    .hajj-package-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .hajj-main-card,
    .hajj-small-card {
        border-radius: 14px !important;
        overflow: hidden !important;
        box-shadow: 0 10px 26px rgba(0, 0, 0, .16) !important;
        background: #fff !important;
    }

    .hajj-main-card {
        display: grid !important;
        grid-template-rows: auto auto !important;
    }

    .hajj-main-image {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1200 / 550 !important;
        background: #eaf1ff !important;
    }

    .hajj-main-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        display: block !important;
    }

    .hajj-main-content {
        height: auto !important;
        min-height: 0 !important;
        padding: 14px 16px 16px !important;
        overflow: visible !important;
    }

    .hajj-main-content span,
    .hajj-small-content > span {
        font-size: 13px !important;
        padding: 4px 9px !important;
        margin-bottom: 8px !important;
    }

    .hajj-main-content h2 {
        font-size: 27px !important;
        margin-bottom: 5px !important;
    }

    .hajj-main-content p {
        font-size: 15px !important;
        margin-bottom: 6px !important;
    }

    .hajj-main-content small {
        display: block !important;
        overflow: visible !important;
        font-size: 14px !important;
        line-height: 1.35 !important;
        margin-bottom: 8px !important;
    }

    .hajj-main-content strong {
        font-size: 18px !important;
    }

    .hajj-small-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .hajj-small-card {
        display: grid !important;
        grid-template-columns: 42% 58% !important;
        grid-template-rows: auto !important;
        min-height: 190px !important;
    }

    .hajj-small-image {
        width: 100% !important;
        height: 100% !important;
        min-height: 190px !important;
        aspect-ratio: auto !important;
        background: #eaf1ff !important;
    }

    .hajj-small-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    .hajj-small-content {
        height: auto !important;
        min-height: 190px !important;
        padding: 12px 13px !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
    }

    .hajj-small-content h3 {
        font-size: 22px !important;
        line-height: 1.05 !important;
        margin-bottom: 4px !important;
    }

    .hajj-small-content .hotel-name {
        font-size: 13.5px !important;
        line-height: 1.2 !important;
        margin-bottom: 3px !important;
    }

    .hotel-stars {
        margin: 2px 0 5px !important;
    }

    .hajj-small-content .hotel-stars span {
        font-size: 13px !important;
        color: #f5b301 !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 2px 0 0 !important;
    }

    .hotel-detail,
    .hajj-small-content p {
        display: block !important;
        font-size: 12.5px !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
        overflow: visible !important;
    }

    .hajj-small-content strong {
        margin-top: auto !important;
        font-size: 16px !important;
        color: #b89555 !important;
    }

    /* =====================================================
       SMOOTH SLIDER: โรงแรมมักกะห์ / มาดีนะห์ / สิ่งที่ได้รับ
       ต้องใช้ JS เพิ่ม class .hajj-mobile-slider-wrap ให้ครอบ .hajj-small-grid
    ===================================================== */

    .hajj-mobile-slider-wrap {
        width: 100%;
        overflow: hidden;
        border-radius: 14px;
        position: relative;
    }

    .hajj-mobile-slider-wrap .hajj-small-grid {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        width: 100% !important;
        overflow: visible !important;
        transition: transform .55s ease !important;
        will-change: transform;
    }

    .hajj-mobile-slider-wrap .hajj-small-card {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
        transform: none !important;
    }

    .hajj-mobile-slider-wrap .hajj-small-card:hover {
        transform: none !important;
    }

    .hajj-mobile-slider-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 7px;
        margin: 12px 0 2px;
    }

    .hajj-mobile-slider-dot {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .45);
        border: 0;
        padding: 0;
        transition: width .25s ease, background .25s ease;
    }

    .hajj-mobile-slider-dot.active {
        width: 22px;
        background: #d9bd77;
    }

    /* =====================================================
       UMRAH MOBILE
    ===================================================== */

    .home-umrah-zone,
    .umrah-recommend-zone {
        padding: 34px 0 42px !important;
        background: #f5f7fb !important;
    }

    .home-umrah-head,
    .recommend-head {
        display: block !important;
        margin-bottom: 18px !important;
        text-align: left !important;
    }

    .home-umrah-head p,
    .recommend-head p {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }

    .home-umrah-head h2,
    .recommend-head h2 {
        font-size: 30px !important;
        line-height: 1.05 !important;
    }

    .home-umrah-head span {
        font-size: 15px !important;
        line-height: 1.35 !important;
    }

    .umrah-head-btn,
    .right-btn,
    .side-btn,
    .mobile-style-main-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        margin-top: 13px !important;
        min-height: 42px !important;
        padding: 0 18px !important;
        font-size: 15px !important;
        line-height: 1 !important;
    }

    .home-umrah-grid,
    .umrah-card-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .home-umrah-card,
    .umrah-card {
        border-radius: 14px !important;
        overflow: hidden !important;
        box-shadow: 0 10px 24px rgba(11, 45, 99, .08) !important;
    }

    .home-umrah-image,
    .umrah-image-wrap {
        height: auto !important;
        aspect-ratio: 4 / 3 !important;
    }

    .home-umrah-image img,
    .umrah-image-wrap img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .home-umrah-body,
    .umrah-card-body {
        padding: 15px !important;
    }

    .home-umrah-body h3,
    .umrah-card-body h3 {
        font-size: 25px !important;
    }

    .umrah-date {
        font-size: 15px !important;
    }

    .umrah-info-list {
        grid-template-columns: 1fr !important;
    }

    .umrah-detail-text,
    .umrah-detail {
        font-size: 14px !important;
    }

    .umrah-card-bottom,
    .umrah-bottom {
        display: grid !important;
        gap: 10px !important;
    }

    .umrah-card-bottom a,
    .umrah-bottom a {
        text-align: center !important;
    }

    /* =====================================================
       OTHER SECTIONS MOBILE
    ===================================================== */

    .learning-grid,
    .contact-box {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .learning-section,
    .services-section,
    .gallery-section,
    .contact-section {
        padding: 42px 0 !important;
    }

    .section-head h2,
    .learning-section h2,
    .contact-section h2 {
        font-size: 32px !important;
    }

    .lesson-item {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
        padding: 16px !important;
    }

    .services-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .services-row span {
        text-align: center !important;
        font-size: 16px !important;
        padding: 10px !important;
    }

    .gallery-row {
        grid-template-columns: 1fr !important;
    }

    .contact-info {
        padding: 16px !important;
    }

    .footer-inner {
        display: block !important;
        text-align: center !important;
    }

    /* =====================================================
       HAJJ DETAIL MOBILE
    ===================================================== */

    .hajj-product-card,
    .detail-product-card {
        width: calc(100% - 18px) !important;
        padding: 16px !important;
    }

    .hajj-product-layout,
    .detail-product-card {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .hajj-product-title-row h1,
    .detail-left h1 {
        font-size: 28px !important;
    }

    .product-contact-strip,
    .detail-contact-row,
    .product-right,
    .detail-right {
        grid-template-columns: 1fr !important;
    }

    .share-row {
        flex-direction: column !important;
    }

    .share-btn {
        width: 100% !important;
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .wrap {
        width: calc(100% - 18px) !important;
    }

    .mobile-header-bar {
        min-height: 62px;
    }

    .mobile-header-logo img {
        height: 42px;
        max-width: 132px;
    }

    .mobile-drawer {
        width: 84vw;
    }

    .mobile-drawer-head strong {
        font-size: 19px;
    }

    .hajj-zone-head h1,
    .home-umrah-head h2,
    .recommend-head h2 {
        font-size: 27px !important;
    }

    .hajj-small-card {
        grid-template-columns: 40% 60% !important;
    }

    .hajj-small-content h3 {
        font-size: 20px !important;
    }
}
