/* ==========================================================================
   TRANG KẾT QUẢ TÌM KIẾM (/tim-kiem) — DÙNG CHUNG MỌI THEME
   --------------------------------------------------------------------------
   Markup: themes/Base/Search/Views/frontend/index.blade.php + layouts/.
   Nạp bằng thẻ link ngay trong index.blade.php, tức là SAU CSS của theme.

   Chỉ style KHUNG trang. Thẻ khách sạn/tour/du thuyền là thẻ trang danh sách
   của từng theme, style của chúng nằm ở theme đó.

   Theme đổi giao diện bằng biến, đặt trong CSS của theme:
     .srp {
         --srp-accent:       màu nhấn (tab đang mở, link, nút Tìm kiếm)
         --srp-accent-hover: màu nhấn khi rê chuột
         --srp-accent-light: nền nhạt (chip điểm đến khi rê chuột, số trên tab)
         --srp-card-min:     bề rộng tối thiểu một thẻ trong lưới (mặc định 230px)
     }
     .srp .sec-tour { --srp-card-min: 380px; }   ← chỉ riêng khối tour

   Giá trị mặc định khai trong :where() (specificity 0) nên biến theme đặt ở
   .srp luôn thắng, dù file này nạp sau. Rule thường thì KHÔNG như vậy:
   muốn đè rule dưới đây phải viết selector cụ thể hơn.
   ========================================================================== */

:where(.srp) {
    --srp-accent: var(--bs-primary, #0d6efd);
    --srp-accent-hover: var(--srp-accent);
    --srp-accent-light: color-mix(in srgb, var(--srp-accent) 10%, #fff);
    --srp-card-min: 230px;
    --srp-text: #0F172A;
    --srp-body: #475569;
    --srp-muted: #64748B;
    --srp-border: #E2E8F0;
    --srp-bg: #fff;
}

.srp {
    padding-top: 24px;
    padding-bottom: 48px;
    color: var(--srp-body);
}

/* --- Tiêu đề + ô tìm lại --- */
.srp-form {
    margin-bottom: 20px;
}

.srp-form__title {
    margin: 0 0 14px;
    color: var(--srp-text);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.srp-form__row {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 8px;
    max-width: 720px;
}

/* Canh theo Ô NHẬP (cao 48px) chứ không theo cả hàng: màn hẹp nút Tìm rớt xuống
   dòng dưới, để top: 50% là kính lúp rơi vào khe giữa ô nhập và nút. */
.srp-form__icon {
    position: absolute;
    top: 24px;
    left: 14px;
    display: flex;
    color: var(--srp-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.srp-form__icon svg {
    width: 18px;
    height: 18px;
}

.srp-form__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0 14px 0 42px;
    border: 1px solid var(--srp-border);
    border-radius: 10px;
    background: var(--srp-bg);
    color: var(--srp-text);
    font-size: 16px;   /* dưới 16px thì iOS tự phóng to trang khi chạm vào ô */
    box-shadow: none;
}

.srp-form__input:focus {
    border-color: var(--srp-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--srp-accent-light);
}

.srp-form__btn {
    flex: none;
    height: 48px;
    margin: 0;
    padding: 0 22px;
    border: 0;
    border-radius: 10px;
    background: var(--srp-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.srp-form__btn:hover {
    background: var(--srp-accent-hover);
}

/* --- Tab loại dịch vụ ---
   Nhiều loại thì cuộn ngang, không xuống dòng: hàng tab hai tầng nhìn như hai
   bộ lọc khác nhau. */
.srp-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--srp-border);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.srp-tabs::-webkit-scrollbar {
    display: none;
}

.srp-tab {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--srp-border);
    border-radius: 999px;
    background: var(--srp-bg);
    color: var(--srp-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.srp-tab:hover {
    border-color: var(--srp-accent);
    color: var(--srp-accent);
    text-decoration: none;
}

.srp-tab.is-active {
    border-color: var(--srp-accent);
    background: var(--srp-accent);
    color: #fff;
}

.srp-tab__count {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--srp-accent-light);
    color: var(--srp-accent);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.srp-tab.is-active .srp-tab__count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* --- Chip điểm đến --- */
.srp-locs {
    margin-top: 24px;
}

.srp-locs__title,
.srp-sec__title {
    margin: 0 0 14px;
    color: var(--srp-text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
}

.srp-locs__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 12px;
}

.srp-loc {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--srp-border);
    border-radius: 12px;
    background: var(--srp-bg);
    color: var(--srp-text);
    text-decoration: none;
}

.srp-loc:hover {
    border-color: var(--srp-accent);
    background: var(--srp-accent-light);
    color: var(--srp-text);
    text-decoration: none;
}

.srp-loc__icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--srp-accent-light);
    color: var(--srp-accent);
}

.srp-loc__icon svg {
    width: 20px;
    height: 20px;
}

.srp-loc__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.srp-loc__name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 700;
}

/* Dòng phụ được xuống hàng: "Việt Nam · 127 khách sạn · 3 tour" mà cắt bằng … là
   mất đúng con số khách cần đọc. */
.srp-loc__sub {
    margin-top: 2px;
    color: var(--srp-muted);
    font-size: 13px;
    line-height: 1.35;
}

/* --- Khối một loại dịch vụ --- */
.srp-sec {
    margin-top: 32px;
}

.srp-sec__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.srp-sec__head .srp-sec__title {
    margin-bottom: 0;
}

.srp-sec__count {
    margin-left: 4px;
    color: var(--srp-muted);
    font-size: 15px;
    font-weight: 600;
}

.srp-sec__more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--srp-accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.srp-sec__more:hover {
    color: var(--srp-accent-hover);
    text-decoration: underline;
}

.srp-sec__more svg {
    flex: none;
    width: 14px;
    height: 14px;
}

/* --- Thanh công cụ của tab một loại --- */
.srp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.srp-toolbar__total {
    margin: 0;
    color: var(--srp-text);
    font-size: 15px;
    font-weight: 600;
}

.srp-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.srp-sort__label {
    margin: 0;
    color: var(--srp-muted);
    font-size: 14px;
    white-space: nowrap;
}

.srp-sort__select {
    height: 38px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--srp-border);
    border-radius: 8px;
    background-color: var(--srp-bg);
    color: var(--srp-text);
    font-size: 14px;
}

.srp-sort__btn {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--srp-border);
    border-radius: 8px;
    background: var(--srp-bg);
}

/* --- Lưới thẻ sản phẩm ---
   Grid auto-fill đo bề rộng THẬT của khung: theme có sidebar hay không thì số
   thẻ mỗi hàng vẫn đúng, không phụ thuộc điểm gãy màn hình. Cùng cách với
   .loc-grid của trang địa điểm. */
.srp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--srp-card-min)), 1fr));
    gap: 24px;
}

.srp-grid__item {
    min-width: 0;
}

/* Thẻ của vài theme tự bọc sẵn cột Bootstrap (Mustgo: col-12 col-md-4 ... mb-25).
   Trong ô grid, width % của cột bóp thẻ còn 1/3 ô và padding làm hở gấp đôi — dọn đi. */
.srp-grid__item > [class*="col-"] {
    flex: none;
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    margin-top: 0;
}

/* Khoảng cách giữa các thẻ đã do gap lo; lề dưới sẵn có của thẻ (mb-25...) là thừa */
.srp-grid__item > :last-child {
    margin-bottom: 0;
}

/* --- Phân trang --- */
.srp-pagination {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.srp-pagination .pagination {
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
}

/* --- Trạng thái trống --- */
.srp-empty {
    max-width: 520px;
    margin: 40px auto 0;
    padding: 32px 20px;
    text-align: center;
}

.srp-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--srp-accent-light);
    color: var(--srp-accent);
}

.srp-empty__icon svg {
    width: 30px;
    height: 30px;
}

.srp-empty__title {
    margin: 0 0 6px;
    color: var(--srp-text);
    font-size: 18px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.srp-empty__hint {
    margin: 0;
    color: var(--srp-muted);
}

/* --- Màn nhỏ --- */
@media (max-width: 767.98px) {
    .srp {
        padding-top: 16px;
    }

    .srp-form__title {
        font-size: 21px;
    }

    .srp-form__btn {
        padding: 0 16px;
    }

    .srp-locs__title,
    .srp-sec__title {
        font-size: 18px;
    }

    .srp-sec {
        margin-top: 26px;
    }

    .srp-grid {
        gap: 16px;
    }
}

@media (max-width: 575.98px) {
    /* Chip điểm đến 2 cột: một cột thì 8 chip đẩy khối khách sạn xuống tận màn thứ hai */
    .srp-locs__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .srp-loc {
        gap: 8px;
        padding: 10px;
    }

    .srp-loc__icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .srp-loc__icon svg {
        width: 16px;
        height: 16px;
    }

    .srp-loc__sub {
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    /* Nút Tìm xuống dòng, rộng hết hàng: chung một hàng thì ô nhập chỉ còn chỗ cho vài chữ */
    .srp-form__row {
        flex-wrap: wrap;
    }

    .srp-form__btn {
        width: 100%;
    }
}
