/* ==================================================================
   ZTravel - UX/UI cho chuc nang TOUR
   Nap SAU ztravel-them.css. Chi them chuyen dong va trang thai,
   KHONG doi kich thuoc/vi tri tinh (de giu khop voi ban goc).

   Nguyen tac: it mau, mot mau nhan (--main-color), phang, nhe nhang.
   ================================================================== */

:root {
    --ztr-nhanh:   140ms;
    --ztr-vua:     200ms;
    --ztr-cham:    320ms;
    --ztr-duong:   cubic-bezier(.22, .61, .36, 1);
    --ztr-bong-1:  0 1px 2px rgba(16, 24, 40, .05);
    --ztr-bong-2:  0 4px 14px rgba(16, 24, 40, .08);
    --ztr-bong-3:  0 12px 28px rgba(16, 24, 40, .12);
}

/* ------------------------------------------------------------------
   1. Chung: tieu diem ban phim ro rang
   ------------------------------------------------------------------ */
.st-single-tour a:focus-visible,
.st-tour-result a:focus-visible,
.st-list-tour-related .item a:focus-visible,
.ztr-hop-dat-tour :focus-visible,
.tour-booking-bar :focus-visible,
.form-ycau :focus-visible,
.btn-xem-nhanh:focus-visible,
.chon-ngay:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ------------------------------------------------------------------
   2. The tour NGANG (trang danh muc)
   ------------------------------------------------------------------ */
.st-tour-result .item-tour-new {
    transition: box-shadow var(--ztr-vua) var(--ztr-duong),
                transform var(--ztr-vua) var(--ztr-duong),
                border-color var(--ztr-vua) var(--ztr-duong);
    will-change: transform;
}
.st-tour-result .item-tour-new:hover {
    box-shadow: var(--ztr-bong-3);
    border-color: #cfdcef;
    transform: translateY(-2px);
}

/* Anh: phong rat nhe, cat gon trong khung */
.st-tour-result .thumb { overflow: hidden; }
.st-tour-result .thumb img {
    transition: transform var(--ztr-cham) var(--ztr-duong);
}
.st-tour-result .item-tour-new:hover .thumb img { transform: scale(1.045); }

/* Lop phu mo rat nhe khi di chuot, cho cam giac bam duoc */
.st-tour-result .thumb > a::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(4, 69, 161, .16), transparent 55%);
    opacity: 0; transition: opacity var(--ztr-vua) var(--ztr-duong);
    pointer-events: none;
}
.st-tour-result .item-tour-new:hover .thumb > a::after { opacity: 1; }

/* Tieu de doi mau muot */
.st-tour-result .service-title a { transition: color var(--ztr-nhanh) linear; }

/* Chip ngay khoi hanh */
.tour-ngay-khoi-hanh .ngay {
    transition: background-color var(--ztr-nhanh) linear,
                color var(--ztr-nhanh) linear;
}
.tour-ngay-khoi-hanh .ngay:hover { background: #dce9ff; }

/* ------------------------------------------------------------------
   3. The tour DOC (trang chu + tour tuong tu)
   ------------------------------------------------------------------ */
.st-list-tour-related .item {
    transition: box-shadow var(--ztr-vua) var(--ztr-duong),
                transform var(--ztr-vua) var(--ztr-duong),
                border-color var(--ztr-vua) var(--ztr-duong);
}
.st-list-tour-related .item:hover {
    box-shadow: var(--ztr-bong-3);
    border-color: #cfdcef;
}
.st-list-tour-related .item .featured { overflow: hidden; }
.st-list-tour-related .item .featured img { transition: transform var(--ztr-cham) var(--ztr-duong); }
.st-list-tour-related .item:hover .thumb img { transform: scale(1.05); }
.st-list-tour-related .item h3.title a { transition: color var(--ztr-nhanh) linear; }

/* ------------------------------------------------------------------
   4. Nut bam: phan hoi khi nhan
   ------------------------------------------------------------------ */
.bb-booking-now, .btn-chi-tiet, .btn-xem-nhanh,
.btn-gui-yeu-cau, .change-date, .chon-ngay, .bb-btn-search {
    transition: background-color var(--ztr-nhanh) linear,
                color var(--ztr-nhanh) linear,
                box-shadow var(--ztr-nhanh) linear,
                transform var(--ztr-nhanh) var(--ztr-duong);
}
.bb-booking-now:active, .btn-chi-tiet:active, .btn-xem-nhanh:active,
.btn-gui-yeu-cau:active, .change-date:active, .chon-ngay:active, .bb-btn-search:active {
    transform: scale(.97);
}
.bb-booking-now:hover { box-shadow: 0 4px 12px rgba(4, 69, 161, .28); }

/* Nut dang gui: mo di + con tro cho */
.bb-booking-now[disabled], .bb-booking-now.dang-gui {
    opacity: .65; cursor: wait; transform: none !important; box-shadow: none;
}

/* ------------------------------------------------------------------
   5. Khoi "Diem noi bat" mo ra tu the tour (goi AJAX)
   ------------------------------------------------------------------ */
.btn-xem-nhanh { position: relative; }
.btn-xem-nhanh::after {
    content: ""; display: inline-block; vertical-align: middle;
    width: 0; height: 0; margin-left: 7px;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform var(--ztr-vua) var(--ztr-duong);
}
.btn-xem-nhanh[aria-expanded="true"]::after { transform: rotate(180deg); }

.tour-noi-bat-box {
    animation: ztrMoRa var(--ztr-cham) var(--ztr-duong);
    overflow: hidden;
}
@keyframes ztrMoRa {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}
.tour-noi-bat-box ul li, .tour-noi-bat-box ol li { margin-bottom: 4px; }

/* Khung xuong khi dang tai */
.ztr-xuong {
    background: linear-gradient(90deg, #eef1f5 25%, #e2e7ee 37%, #eef1f5 63%);
    background-size: 400% 100%;
    animation: ztrNhapNhay 1.3s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes ztrNhapNhay {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
.tour-noi-bat-box .ztr-xuong { height: 12px; margin-bottom: 8px; }
.tour-noi-bat-box .ztr-xuong:nth-child(1) { width: 40%; height: 14px; }
.tour-noi-bat-box .ztr-xuong:nth-child(2) { width: 92%; }
.tour-noi-bat-box .ztr-xuong:nth-child(3) { width: 78%; }
.tour-noi-bat-box .ztr-xuong:nth-child(4) { width: 85%; }

/* ------------------------------------------------------------------
   6. Trang chi tiet: thu vien anh
   ------------------------------------------------------------------ */
.st-gallery .tour-swiper .swiper-slide img { transition: opacity var(--ztr-vua) linear; }
.st-gallery .tour-swiper-thumbs .swiper-slide img {
    transition: opacity var(--ztr-vua) linear, outline-color var(--ztr-vua) linear;
    outline: 2px solid transparent; outline-offset: -2px;
}
.st-gallery .tour-swiper-thumbs .swiper-slide:hover img { opacity: .85; }
.st-gallery .swiper-button-next,
.st-gallery .swiper-button-prev {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--ztr-bong-2);
    opacity: 0; transition: opacity var(--ztr-vua) linear, transform var(--ztr-nhanh) var(--ztr-duong);
}
.st-gallery .swiper-button-next::after,
.st-gallery .swiper-button-prev::after { font-size: 15px; color: var(--bb-navy); font-weight: 700; }
.st-gallery:hover .swiper-button-next,
.st-gallery:hover .swiper-button-prev { opacity: 1; }
.st-gallery .swiper-button-next:active,
.st-gallery .swiper-button-prev:active { transform: scale(.92); }
@media (hover: none) {
    /* Tren dien thoai khong co di chuot -> hien luon */
    .st-gallery .swiper-button-next, .st-gallery .swiper-button-prev { opacity: 1; }
}

/* ------------------------------------------------------------------
   7. Thuoc tinh tour
   ------------------------------------------------------------------ */
.ztr-thuoc-tinh > div {
    transition: background-color var(--ztr-nhanh) linear;
    border-radius: 8px; padding: 6px 8px; margin: -6px -8px;
}
.ztr-thuoc-tinh > div:hover { background: #fff; }

/* ------------------------------------------------------------------
   8. Lich trinh tung ngay
   ------------------------------------------------------------------ */
.ngay-lich-trinh { transition: border-color var(--ztr-vua) linear; }
.ngay-lich-trinh::before { transition: transform var(--ztr-vua) var(--ztr-duong); }
.ngay-lich-trinh:hover::before { transform: scale(1.25); }
.ngay-lich-trinh .so-ngay { transition: background-color var(--ztr-nhanh) linear; }

/* ------------------------------------------------------------------
   9. Hop dat tour (cot phai)
   ------------------------------------------------------------------ */
.ztr-hop-dat-tour {
    transition: box-shadow var(--ztr-vua) var(--ztr-duong);
}
.ztr-hop-dat-tour:hover { box-shadow: var(--ztr-bong-3); }
.ztr-hop-dat-tour .form-control {
    transition: border-color var(--ztr-nhanh) linear, box-shadow var(--ztr-nhanh) linear;
}
.ztr-hop-dat-tour .form-control:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(4, 69, 161, .12);
    outline: none;
}

/* Nut +/- cho so khach: vung cham to hon, bam muot */
.ztr-hop-dat-tour .row-khach input[type="number"] { text-align: center; }

/* ------------------------------------------------------------------
   10. Thanh dat tour noi duoi man hinh
   ------------------------------------------------------------------ */
.tour-booking-bar {
    transition: transform var(--ztr-cham) var(--ztr-duong),
                opacity var(--ztr-vua) linear;
}
/* An khi chua can (JS them lop nay), truot xuong thay vi bien mat dot ngot */
.tour-booking-bar.ztr-an {
    transform: translateY(110%);
    opacity: 0; pointer-events: none;
}
.tour-booking-bar .btn-collapse svg { transition: transform var(--ztr-vua) var(--ztr-duong); }

/* ------------------------------------------------------------------
   11. Popup chon ngay / gui yeu cau
   ------------------------------------------------------------------ */
.modal.fade .modal-dialog {
    transition: transform var(--ztr-cham) var(--ztr-duong), opacity var(--ztr-vua) linear;
    transform: translateY(14px) scale(.985); opacity: 0;
}
.modal.fade.in .modal-dialog, .modal.fade.show .modal-dialog {
    transform: none; opacity: 1;
}
.ds-ngay-khoi-hanh .chon-ngay { position: relative; }
.ds-ngay-khoi-hanh .chon-ngay::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: var(--main-color); opacity: 0;
    transition: opacity var(--ztr-nhanh) linear; z-index: -1;
}
.ds-ngay-khoi-hanh .chon-ngay:hover::before { opacity: 1; }
.ds-ngay-khoi-hanh .chon-ngay.da-chon {
    background: var(--main-color); color: #fff; border-color: var(--main-color);
}

/* Form gui yeu cau */
.form-ycau .form-control {
    transition: border-color var(--ztr-nhanh) linear, box-shadow var(--ztr-nhanh) linear;
}
.form-ycau .form-control:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(4, 69, 161, .12);
    outline: none;
}
.form-ycau .form-control:user-invalid {
    border-color: var(--bb-do);
    box-shadow: 0 0 0 3px rgba(183, 32, 32, .10);
}
.ztr-ket-qua {
    animation: ztrMoRa var(--ztr-vua) var(--ztr-duong);
    padding: 10px 12px; border-radius: 8px;
}
.ztr-ket-qua.thanh-cong { background: #eaf7ee; }
.ztr-ket-qua.that-bai  { background: #fdeceC; }
.ztr-ket-qua:empty { display: none; }

/* ------------------------------------------------------------------
   12. Trang thai rong / khong co tour
   ------------------------------------------------------------------ */
.khong-co-tour {
    text-align: center; padding: 48px 16px;
    background: #f7f9fc; border-radius: 12px;
    color: var(--bb-xam); font-size: 15px;
}

/* ------------------------------------------------------------------
   13. Phan trang
   ------------------------------------------------------------------ */
.nav-links .page-numbers {
    transition: background-color var(--ztr-nhanh) linear,
                color var(--ztr-nhanh) linear,
                border-color var(--ztr-nhanh) linear;
}

/* ------------------------------------------------------------------
   14. Ton trong lua chon giam chuyen dong cua nguoi dung
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .st-tour-result .item-tour-new:hover,
    .st-list-tour-related .item:hover { transform: none; }
    .st-tour-result .item-tour-new:hover .thumb img,
    .st-list-tour-related .item:hover .thumb img { transform: none; }
    .tour-noi-bat-box, .ztr-ket-qua { animation: none; }
    .ztr-xuong { animation: none; background: #eef1f5; }
}
