/* ═══════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — شاشات متجاوبة
   Loaded after site_ar / site_en — works for both RTL & LTR
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tour skeleton thumbs (flex + wrap on mobile) ────────────────────── */
.tour-skel-thumbs {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

/* ── Base: prevent horizontal scroll ─────────────────────────────────── */
html, body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ── Container padding on small screens ───────────────────────────────── */
@media (max-width: 575.98px) {
    .container, .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 374.98px) {
    .container, .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* ── Checkout: Steps — shrink on mobile ───────────────────────────────── */
@media (max-width: 575.98px) {
    .checkout-steps {
        gap: 2px;
        margin-bottom: 20px;
    }

    .step {
        font-size: .75rem;
    }

    .step-circle {
        width: 24px;
        height: 24px;
        font-size: .7rem;
    }

    .step-line {
        min-width: 12px;
    }

    .co-tab-btn {
        font-size: .78rem;
        padding: 10px 6px;
    }

    .tab-num {
        width: 18px;
        height: 18px;
        font-size: .65rem;
    }
}

/* ── Checkout: Pending order panel (retry payment) ─────────────────────── */
@media (max-width: 575.98px) {
    .pending-order-panel {
        max-width: 100%;
        margin: 20px 12px;
        padding: 24px 16px;
    }

    #retryFwSection .fw-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    #retryFwSection .fw-btn {
        font-size: .75rem;
        padding: 10px 8px;
    }
}

@media (max-width: 399.98px) {
    #retryFwSection .fw-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Checkout: Fawaterk grid 4-col → 2-col → 1-col ─────────────────────── */
@media (max-width: 575.98px) {
    .fw-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }
}

@media (max-width: 399.98px) {
    .fw-grid {
        grid-template-columns: 1fr !important;
    }

    .pay-method-card {
        min-width: 0 !important;
    }
}

/* ── Cart: Item card stack better on mobile ────────────────────────────── */
@media (max-width: 575.98px) {
    .cart-item-card {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-item-img {
        width: 100%;
        max-width: 120px;
        height: auto;
        aspect-ratio: 1;
        margin: 0 auto;
    }

    .cart-item-body {
        min-width: 0;
    }

    .cart-item-name {
        white-space: normal;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .qty-control {
        justify-content: flex-start;
    }

    .cart-summary {
        position: static;
        margin-top: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   PRODUCT DETAILS & TOUR DETAILS — شاشة تفاصيل المنتج والرحلة
   Both use pd-page, pd-grid, pd-gallery, pd-sidebar
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 767.98px) {
    .pd-page {
        padding: 1rem 0 2.5rem;
    }

    .pd-grid {
        gap: 1.25rem;
    }

    .pd-main-img-wrap {
        min-height: 0;
    }

    .pd-thumbs {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .pd-tabs-wrap {
        margin-top: 1.5rem;
    }

    .pd-tabs {
        -webkit-overflow-scrolling: touch;
    }

    .pd-tab {
        font-size: .85rem;
        padding: 10px 12px;
        white-space: nowrap;
    }

    .pd-add-btn {
        min-width: 0;
        width: 100%;
    }

    .pd-cta-row {
        flex-direction: column;
    }

    .pd-cta-row .pd-add-btn {
        width: 100%;
    }

    .pd-breadcrumb {
        flex-wrap: wrap;
        font-size: .8rem;
    }

    .pd-title {
        font-size: 1.25rem;
        word-wrap: break-word;
    }

    .pd-share-row {
        flex-wrap: wrap;
    }

    /* Tour details: video full width */
    .tour-video-wrap {
        max-width: 100% !important;
    }

    .tour-video-wrap video,
    .tour-video-wrap iframe {
        max-width: 100%;
        height: auto;
        min-height: 200px;
    }
}

@media (max-width: 575.98px) {
    .pd-attrs-table,
    table.pd-attrs {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pd-attrs-table table,
    .pd-attrs {
        min-width: 280px;
    }

    .pd-sidebar {
        position: static;
    }

    .pd-grid {
        gap: 1rem;
    }

    .pd-page {
        padding: .75rem 0 2rem;
    }

    .pd-sidebar-card {
        padding: 1rem;
    }

    .pd-tab {
        font-size: .8rem;
        padding: 8px 10px;
    }

    .pd-lightbox .pd-lb-img {
        max-width: 95vw;
        max-height: 85vh;
    }

    .pd-lb-close,
    .pd-lb-prev,
    .pd-lb-next {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 399.98px) {
    .pd-thumb {
        width: 56px;
        height: 56px;
    }

    .pd-title {
        font-size: 1.1rem;
    }

    #tourContent .pd-sidebar-card #tourSidebarPrice {
        font-size: 1.4rem;
    }

    .pd-qty-row {
        flex-wrap: wrap;
    }

    .pd-variant-pills {
        gap: 6px;
    }

    .pd-variant-pill {
        padding: 5px 12px;
        font-size: .8rem;
    }

    .pd-error {
        padding: 2.5rem 1rem;
    }

    .pd-error i {
        font-size: 3rem;
    }

    .pd-error h2 {
        font-size: 1.1rem;
    }
}

/* ── Tables: responsive wrapper ───────────────────────────────────────── */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 575.98px) {
    .table-responsive table {
        min-width: 320px;
    }

    .table th, .table td {
        padding: 8px 6px;
        font-size: .85rem;
    }
}

/* ── Tourist cities: Sort select (desktop: min-width) ──────────────────── */
.tc-sort-select {
    min-width: 180px;
}

/* ── Tourist cities: Sort select & cards ───────────────────────────────── */
@media (max-width: 575.98px) {
    .tour-filter-bar,
    .tc-sort-wrap {
        flex-wrap: wrap;
    }

    .tc-sort-wrap select,
    .tc-sort-select,
    select[min-width] {
        min-width: 0 !important;
        width: 100%;
        max-width: 100%;
    }

    .tour-card {
        flex-direction: column;
        align-items: stretch;
    }

    .tour-card > div:first-child {
        flex-direction: column;
    }

    .tour-card img {
        max-width: 100%;
        height: auto;
    }
}

/* ── Orders & Account: Cards & modals ──────────────────────────────────── */
@media (max-width: 575.98px) {
    .order-card,
    .order-details-card {
        margin-left: -12px;
        margin-right: -12px;
        border-radius: 0;
        padding-left: 12px;
        padding-right: 12px;
    }

    .rate-modal,
    .modal-dialog {
        max-width: calc(100% - 24px) !important;
        margin: 12px auto;
    }

    .modal-content {
        border-radius: 12px;
    }
}

/* ── Touch targets: min 44px for buttons/links ─────────────────────────── */
@media (max-width: 767.98px) {
    .btn, .btn-sm,
    .nav-link, .dropdown-item,
    .qty-btn, .pd-thumb,
    a.pd-share-btn, button.pd-share-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        min-height: 40px;
        min-width: 40px;
    }

    .qty-btn {
        min-width: 36px;
        min-height: 36px;
    }
}

/* ── Product grid: 2 cols on small, 1 on very small ────────────────────── */
@media (max-width: 575.98px) {
    .product-grid,
    .cat-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 374.98px) {
    .product-grid,
    .cat-products-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Footer: stack on mobile ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }

    .footer-main {
        padding: 24px 0;
    }
}

/* ── Vendor / Product listing cards ────────────────────────────────────── */
@media (max-width: 575.98px) {
    .vendor-card,
    .product-card {
        padding: 12px;
    }

    .product-card .product-img-wrap {
        aspect-ratio: 1;
    }
}

/* ── Account pages: sidebar & content ──────────────────────────────────── */
@media (max-width: 575.98px) {
    .account-page-wrap {
        padding: 1rem 0 2rem;
    }

    .account-sidebar {
        border-radius: 12px;
    }

    .account-nav-item {
        min-height: 44px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   ALL CUSTOMER SCREENS — شاشات العميل كاملة
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Static pages (About, Contact, FAQ, Terms, etc.) ───────────────────── */
@media (max-width: 575.98px) {
    .sp-page {
        padding: 1.25rem 0 2.5rem;
    }

    .sp-hero {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
    }

    .sp-hero-title {
        font-size: 1.35rem;
    }

    .sp-content, .sp-hero .container {
        max-width: 100%;
    }

    .sp-card {
        padding: 1.25rem 1rem;
    }
}

/* ── Auth (Login, Register, Forgot, Reset) ────────────────────────────── */
@media (max-width: 575.98px) {
    .auth-wrapper {
        padding: 12px;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-body {
        padding: 1.5rem 1rem !important;
    }

    .auth-icon-circle {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }

    .auth-logo {
        font-size: 1.4rem;
    }
}

/* ── Products page (prods-*) ───────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .prods-hero-inner {
        padding: 1rem 0;
    }

    .prods-hero-title {
        font-size: 1.25rem;
    }

    .prods-search-wrap {
        flex-direction: column;
        gap: 8px;
    }

    .prods-search-input {
        width: 100%;
    }

    .mobile-filter-btn {
        width: 100%;
    }
}

/* ── Vendors & Vendor details ─────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .vendors-grid {
        grid-template-columns: 1fr;
    }

    .vd-hero, .vd-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .vd-vendor-card {
        flex-direction: column;
    }
}

/* ── Order confirmation & Cart confirmation ───────────────────────────── */
@media (max-width: 575.98px) {
    .conf-card {
        padding: 1.25rem 1rem;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .conf-address, #dAddress {
        max-width: 100% !important;
        text-align: inherit !important;
    }

    .conf-poll-wrap, #pollWrap {
        padding: 12px 16px 0 !important;
    }

    .items-section, .co-items-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Address page & modal ─────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .addr-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .addr-modal {
        max-width: calc(100% - 24px) !important;
        margin: 12px;
    }

    .addr-modal .form-row .col-md-6,
    .addr-modal .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── Wishlist ─────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .wl-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wl-actions {
        flex-wrap: wrap;
    }

    .wl-grid, .wl-product-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Tourist cities: Index, Details, Book ──────────────────────────────── */
@media (max-width: 575.98px) {
    .tc-hero, .tc-city-hero {
        padding: 1.5rem 0;
    }

    .tc-quick-booking, .qb-panel {
        flex-direction: column;
    }

    .tc-book-form .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .bank-transfer-card, .bkt-card {
        padding: 1rem;
    }

    .bank-account-number, .bkt-account {
        word-break: break-all;
        font-size: .9rem;
    }
}

/* ── Booking confirmation ────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .conf-card, .bk-conf-card {
        margin: 0 -12px;
        border-radius: 0;
        padding: 1.25rem 1rem;
    }

    .bk-conf-actions {
        flex-direction: column;
    }

    .bk-conf-actions .btn {
        width: 100%;
    }
}

/* ── Payments: History, Fail ──────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .payfail-card {
        margin: 0 12px;
        padding: 1.5rem 1rem;
    }

    .payfail-actions {
        flex-direction: column;
    }

    .payfail-actions .btn {
        width: 100%;
    }
}

/* ── Error pages ───────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .error-page-icon {
        font-size: 3rem !important;
    }
    .status-code-number {
        font-size: 2rem !important;
    }

    .status-code-num {
        font-size: 2.5rem !important;
    }
}

/* ── Compare table (horizontal scroll) ─────────────────────────────────── */
@media (max-width: 767.98px) {
    .compare-table {
        min-width: 500px;
    }
}

/* ── Track order, Notifications ────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .track-timeline, .notif-list {
        padding: 0;
    }

    .notif-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .notif-thumb {
        margin-bottom: 8px;
    }
}
