/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/* --- 1. BIẾN CẤU CẤU HÌNH --- */
:root {
    --at-primary-color: #ed1c24;    /* Màu đỏ thương hiệu */
    --at-secondary-color: #2c3e50;
    --at-text-main: #333333;
    --at-text-muted: #666666;
    --at-bg-light: #f4f7f6;
    --at-shadow-sm: 0 5px 15px rgba(0,0,0,0.08);
    --at-shadow-lg: 0 12px 30px rgba(0,0,0,0.15);
    --at-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --at-border-radius: 12px;
}

/* --- 2. LAYOUT CHUNG CHO TRANG TOUR --- */
.tour-archive-wrapper { background-color: var(--at-bg-light); padding-bottom: 50px; }

/* --- 3. HIỆU ỨNG CARD TOUR --- */
.at-tour-card {
    background: #fff;
    border-radius: var(--at-border-radius);
    overflow: hidden;
    box-shadow: var(--at-shadow-sm);
    transition: var(--at-transition);
    height: 100%;
    border: 1px solid #edf2f1;
    display: flex;
    flex-direction: column;
}
.at-tour-card:hover { transform: translateY(-8px); box-shadow: var(--at-shadow-lg); }
.at-tour-card .card-image { position: relative; height: 210px; overflow: hidden; }
.at-tour-card .card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.at-tour-card:hover .card-image img { transform: scale(1.1); }
.at-tour-card .card-badge { position: absolute; bottom: 12px; left: 12px; background: rgba(0,0,0,0.7); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 500; backdrop-filter: blur(4px); }
.at-tour-card .card-content { padding: 18px; flex-grow: 1; }
.at-tour-card .card-title { font-size: 16px; font-weight: 700; line-height: 1.5; margin-bottom: 12px; color: var(--at-text-main); }
.at-tour-card .card-title a { color: inherit; }
.at-tour-card .card-title a:hover { color: var(--at-primary-color); }
.at-tour-card .card-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.at-tour-card .meta-item { display: flex; align-items: center; font-size: 13px; color: var(--at-text-muted); }
.at-tour-card .meta-item i { color: var(--at-primary-color); width: 22px; font-size: 14px; }
.at-tour-card .card-footer { border-top: 1px dashed #eee; padding-top: 15px; display: flex; align-items: center; justify-content: space-between; }
.at-tour-card .price-label { font-size: 12px; color: #999; }
.at-tour-card .price-amount { color: var(--at-primary-color); font-weight: 800; font-size: 18px; }

/* Container chính */
.at-search-container {
    max-width: 950px;
    margin: 0 auto;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    height: 64px; /* Cố định chiều cao thanh */
    display: flex !important;
    align-items: center !important; /* Căn giữa dọc quan trọng nhất */
    padding: 0 8px 0 25px !important;
}

.at-search-form-sc {
    display: flex !important;
    align-items: center !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
}

/* --- FIX LỖI DÍNH LIỀN VÀ CĂN GIỮA --- */
.at-search-container {
    max-width: 900px;
    margin: 0 auto 50px !important; /* Tạo khoảng cách 50px với nội dung phía dưới */
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    height: 60px; /* Cố định chiều cao thanh search */
    display: flex !important;
    align-items: center !important; /* Ép mọi thứ vào giữa trục dọc */
    padding: 0 8px 0 25px !important;
    position: relative;
    z-index: 99;
}

/* Ép Form bên trong cũng phải Flex để căn dọc */
.at-search-form-sc {
    display: flex !important;
    align-items: center !important; 
    width: 100%;
    height: 100%;
    margin-bottom: 0 !important;
}

.at-search-field {
    flex: 1;
    display: flex !important;
    align-items: center !important; /* Căn giữa icon và chữ */
    height: 30px; /* Chiều cao vạch ngăn cách */
    border-right: 1px solid #eee;
    padding: 0 15px;
}

.at-search-field:last-of-type { border-right: none; }

/* Triệt tiêu lỗi lệch của các thẻ Input/Select */
.at-search-field input, 
.at-search-field select {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    height: 40px !important; /* Chiều cao vùng nhập liệu */
    line-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
}

/* NÚT TÌM KIẾM - CĂN GIỮA TUYỆT ĐỐI */
.at-search-submit {
    background: #ed1c24 !important;
    color: #fff !important;
    height: 44px !important; /* Thấp hơn thanh chính một chút */
    padding: 0 25px !important;
    border-radius: 40px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    border: none !important;
    cursor: pointer;
    
    /* Căn giữa chữ và icon kính lúp */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 0 0 10px !important; /* Xóa margin bottom mặc định của Flatsome */
    line-height: 1 !important;
}

/* Khoảng cách cho trang kết quả (Archive/Search) */
.at-tour-grid-container {
    margin-top: 30px !important; /* Đẩy lưới tour xuống thêm một chút */
}

.at-search-submit i { margin-left: 8px; font-size: 14px; }
/* --- TRANG CHI TIẾT TOUR --- */
.at-tour-header { background: #fff; padding: 25px 0; border-bottom: 1px solid #eee; }
.at-entry-title { font-size: 28px; margin-bottom: 12px; font-weight: 800; color: #333; }
.at-header-meta { display: flex; align-items: center; gap: 20px; font-size: 14px; color: #666; flex-wrap: wrap; }
.at-rating i { color: #f1c40f; margin-right: 5px; }
.at-wishlist { margin-left: auto; cursor: pointer; }
.at-gallery-grid { display: flex; gap: 10px; height: 400px; margin-bottom: 30px; border-radius: 12px; overflow: hidden; }
.at-big-item { flex: 2; }
.at-gallery-right-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.at-gallery-item { position: relative; height: 100%; }
.at-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.at-gallery-item img:hover { transform: scale(1.05); }
.at-small-item { flex: 1; }
.at-last-item .at-view-all { position: absolute; bottom: 15px; right: 15px; background: rgba(0,0,0,0.7); color: #fff; border: none; padding: 8px 15px; border-radius: 5px; font-size: 13px; }
.at-info-highlight { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); margin-bottom: 35px; }
.at-params-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; flex-grow: 1; }
.at-param-item { display: flex; align-items: center; gap: 10px; }
.at-param-item .at-icon { width: 35px; height: 35px; background: #f8f9fa; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--at-primary-color); }
.at-text { font-size: 14px; color: #555; }
.at-price-summary { text-align: right; border-left: 1px solid #eee; padding-left: 30px; }
.at-price-summary del { color: #999; font-size: 14px; }
.at-main-price { font-size: 30px; color: var(--at-primary-color); font-weight: 800; }
.at-booking-card { background: #fff; border: 1.5px solid var(--at-primary-color); padding: 30px; border-radius: 15px; box-shadow: 0 10px 30px rgba(210, 30, 30, 0.1); margin-bottom: 25px; }
.at-booking-card h4 { color: var(--at-primary-color); text-align: center; text-transform: uppercase; font-weight: 800; }
.at-booking-card p { text-align: center; color: #777; font-size: 13px; }
.at-flight-schedule { background: #f0f4f8; padding: 20px; border-radius: 10px; border: 1px dashed #bcd0c7; }
.at-sidebar-sticky { position: sticky; top: 120px; }
.at-service-box { padding: 20px; border-radius: 10px; margin-bottom: 20px; border-left: 5px solid; }
.at-include { background: #e8f6f3; border-color: #16a085; }
.at-exclude { background: #fdedec; border-color: #c0392b; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 849px) {
    .at-gallery-grid { height: auto; flex-direction: column; }
    .at-info-highlight { flex-direction: column; gap: 20px; align-items: flex-start; }
    .at-price-summary { border-left: none; padding-left: 0; border-top: 1px solid #eee; width: 100%; padding-top: 20px; }
    
    /* Responsive cho Search Shortcode */
    .at-search-container { border-radius: 20px; padding: 15px; margin-top: 20px !important; }
    .at-search-form-sc { flex-direction: column; gap: 10px; }
    .at-search-field { width: 100%; border-right: none; border-bottom: 1px solid #f0f0f0; height: 50px; }
    .at-search-submit { width: 100%; height: 50px; }
}

/* --- GRID HỆ THỐNG --- */
.at-tour-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1024px) { .at-tour-grid-container { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .at-tour-grid-container { grid-template-columns: 1fr; } }

/* 1. Ép 4 cột cho PC và 2 cột cho Mobile */
.at-slider-navigation .col { 
    width: 25% !important; 
    flex-basis: 25% !important; 
    max-width: 25% !important;
}

@media (max-width: 849px) { 
    .at-slider-navigation .col { 
        width: 50% !important; 
        flex-basis: 50% !important; 
        max-width: 50% !important;
    } 
}

/* 1. Ép layout cho Tour Slider */
.at-custom-tour-slider .col { 
    width: 25% !important; 
    flex-basis: 25% !important; 
    max-width: 25% !important;
}

@media (max-width: 849px) { 
    .at-custom-tour-slider .col { 
        width: 50% !important; 
        flex-basis: 50% !important; 
        max-width: 50% !important;
    } 
}

/* 2. CSS CHỈ dành cho nút điều hướng của Tour */
/* Dùng chuỗi class dài để tăng độ ưu tiên, Flatsome sẽ không đè được */
.at-custom-tour-slider.flickity-enabled .flickity-prev-next-button {
    width: 44px !important;
    height: 44px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Căn giữa mũi tên bên trong */
.at-custom-tour-slider .flickity-button-icon {
    width: 16px !important;
    height: 16px !important;
    fill: #333 !important;
    position: static !important; /* Bỏ vị trí tuyệt đối cũ */
}

/* Hover đổi màu */
.at-custom-tour-slider .flickity-prev-next-button:hover {
    background: #ed1c24 !important;
}
.at-custom-tour-slider .flickity-prev-next-button:hover .flickity-button-icon {
    fill: #ffffff !important;
}

/* 3. TRẢ LẠI NÚT LỚN CHO BANNER */
/* Đoạn này bảo vệ Banner không bị "bé tẹo" */
.slider-wrapper .flickity-prev-next-button {
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
}
/* Ép tiêu đề luôn cao bằng nhau (3 dòng) */
.at-tour-card .card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    min-height: 66px; /* Ép tiêu đề luôn chiếm diện tích 3 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Giới hạn tối đa 3 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Đảm bảo nội dung giãn đều */
.at-tour-card .card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 18px;
}

/* Đẩy giá tiền luôn nằm dưới đáy card */
.at-tour-card .card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}
/* --- TỔNG THỂ TRANG CHI TIẾT --- */
.at-tour-container {
    background-color: #f8fafc; /* Màu nền xám nhạt sang trọng */
}

/* --- GALLERY GRID (Hiệu ứng hover nhẹ) --- */
.at-gallery-grid {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.at-gallery-item img {
    transition: transform 0.5s ease;
}

.at-gallery-item:hover img {
    transform: scale(1.05);
}

/* Nút xem ảnh thiết kế lại cho "xịn" */
.at-view-all {
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.8) !important;
    color: #333 !important;
    border: none;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* --- KHỐI THÔNG TIN NỔI BẬT (INFO HIGHLIGHT) --- */
.at-info-highlight {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #edf2f7;
    margin-bottom: 35px;
}

.at-param-item .at-icon {
    width: 42px;
    height: 42px;
    background: #fff1f1; /* Nền icon màu hồng nhạt cùng tông đỏ */
    color: var(--at-primary-color);
    font-size: 18px;
    border-radius: 12px;
}

.at-price-summary {
    border-left: 2px dashed #e2e8f0;
    padding-left: 35px;
}

.at-main-price {
    letter-spacing: -1px;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.05);
}

/* --- PHẦN NỘI DUNG LỊCH TRÌNH (BODY) --- */
.at-tour-body {
    background: #fff;
    padding: 35px;
    border-radius: 16px;
    border: 1px solid #edf2f7;
}

.at-section-title {
    font-size: 22px;
    font-weight: 800;
    position: relative;
    padding-left: 15px;
    margin-bottom: 25px;
}

.at-section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 24px;
    background: var(--at-primary-color);
    border-radius: 10px;
}

/* Tối ưu các thẻ p, li trong bài viết chi tiết */
.at-content-inner p {
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 1.5rem;
}

.at-content-inner h4 {
    color: #2d3748;
    font-weight: 700;
    margin-top: 2rem;
}

/* --- SIDEBAR & STICKY BOOKING CARD --- */
.at-sidebar-sticky {
    position: sticky;
    top: 100px; /* Cách top menu 100px khi cuộn */
}

.at-booking-card {
    border: 2px solid var(--at-primary-color);
    border-radius: 20px !important;
    background: #fff;
}

.at-booking-card h4 {
    letter-spacing: 0.5px;
}

/* --- PHẦN TOUR LIÊN QUAN --- */
.at-related-tours-section h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 40px;
}

/* Tinh chỉnh nút slide cho đẹp */
.flickity-prev-next-button {
    background: #fff !important;
    border: 1px solid #eee;
    opacity: 0.8;
}

.flickity-prev-next-button:hover {
    opacity: 1;
    background: var(--at-primary-color) !important;
    color: #fff !important;
}