/* public/front/css/custom-responsive.css */

/* ===================================================================
   1. CART TABLE — ubah jadi tampilan "kartu" di layar kecil,
      bukan tabel yang di-scroll horizontal (lebih mudah dibaca)
   =================================================================== */
@media (max-width: 767px) {
    .cart-table table,
    .cart-table thead,
    .cart-table tbody,
    .cart-table th,
    .cart-table td,
    .cart-table tr {
        display: block;
    }

    .cart-table thead {
        display: none; /* header kolom disembunyikan, diganti label per baris */
    }

    .cart-table tr {
        border: 1px solid #e5e5e5;
        border-radius: 6px;
        margin-bottom: 16px;
        padding: 12px;
    }

    .cart-table td {
        text-align: right !important;
        padding: 8px 0;
        border: none !important;
        position: relative;
        padding-left: 45% !important;
    }

    .cart-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 40%;
        font-weight: 600;
        text-align: left;
        color: #666;
    }

    .cart-table td:first-child {
        text-align: center !important;
        padding-left: 0 !important;
    }
    .cart-table td:first-child::before {
        content: none;
    }
}

/* ===================================================================
   2. GALERI PRODUK — thumbnail jadi scroll horizontal di mobile,
      bukan kolom sempit di samping gambar utama
   =================================================================== */
@media (max-width: 767px) {
    .product-left-img-tab {
        flex-direction: column;
    }

    .product-left-img-tab .product-tabs3 {
        flex-direction: row !important;
        overflow-x: auto;
        white-space: nowrap;
        margin-left: 0 !important;
        margin-top: 12px;
        padding-bottom: 4px;
    }

    .product-left-img-tab .product-tabs3 .nav-link {
        display: inline-block;
        margin-right: 8px;
        flex-shrink: 0;
    }

    .product-thumbnail {
        width: 60px !important;
    }
}

/* ===================================================================
   3. DROPDOWN AUTOCOMPLETE (pencarian kota/kecamatan) — jangan
      pakai lebar hardcode yang bisa kepotong di layar sempit
   =================================================================== */
#destination-results,
#new-destination-results,
#origin-results {
    max-width: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
}

/* ===================================================================
   4. GENERAL SAFETY NET — cegah elemen mana pun bikin scroll
      horizontal tak sengaja di body (penyebab paling umum tampilan
      "kepotong" di HP: gambar/tabel yang lebih lebar dari layar)
   =================================================================== */
img {
    max-width: 100%;
    height: auto;
}

.table-responsive-sm {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 575px) {
    .container, .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}