/* ==========================================
   TẮT HOVER TRÊN MÀN CẢM ỨNG (IOS SAFARI BUG)
========================================== */
@media (hover: none) {

    .result-card:hover,
    .hover-box:hover,
    .news-card:hover,
    .suggest-card:hover,
    .btn-gradient:hover,
    .btn-vhm-main:hover,
    .btn-primary:hover,
    .hover-zoom:hover,
    .transition-hover:hover,
    .album-grid-2 img:hover {
        transform: none !important;
    }
}

/* ==========================================
   MOBILE SIDEBAR & MEGAMENU
========================================== */
.mobile-sidebar {
    position: fixed !important;
    top: 0;
    right: -100%;
    width: 75vw;
    max-width: 320px;
    height: 100vh;
    background-color: #fff;
    z-index: 1055;
    display: block !important;
    padding-top: 60px;
    padding-bottom: 30px;
    overflow-y: auto !important;
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mobile-sidebar.active-sidebar {
    right: 0;
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.navbar-collapse {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    margin-top: 10px;
    padding-bottom: 15px;
}

.navbar-nav {
    gap: 0 !important;
}

.public-nav-link {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 20px !important;
    border-bottom: 1px solid #f5f5f5 !important;
    font-size: 1.05rem !important;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 1.1rem;
    color: var(--text-muted);
    padding: 0 10px;
    cursor: pointer;
}

.show-menu>.nav-link .toggle-icon {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.navbar .has-megamenu {
    position: relative;
}

.navbar .megamenu {
    padding: 10px 0;
    border: none;
    box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.02);
    background: #fcfcfc;
    display: none;
    margin: 0;
    border-radius: 0;
    z-index: 1050;
}

.navbar .nav-item.has-megamenu.show-menu>.megamenu {
    display: block !important;
}

.megamenu-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.megamenu-col {
    border-right: none;
    padding: 0;
    margin-bottom: 10px;
}

.megamenu-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.95rem;
    border-bottom: 1px solid #eee;
    padding: 10px 20px;
    margin-bottom: 5px;
    background: #f9f9f9;
}

.megamenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.megamenu-item {
    display: block;
    padding: 8px 20px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px dashed #eee;
    font-size: 0.9rem;
}

.mm-level-1 {
    font-weight: 500;
    background-color: #fafafa;
}

.mm-level-2 {
    padding-left: 40px;
    font-size: 0.9rem;
}

.mm-icon {
    font-size: 0.6rem;
    margin-right: 6px;
    color: #aaa;
    transition: transform 0.2s;
    display: inline-block;
}

.mm-child-list {
    display: none;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.mm-has-child.show-sub>.mm-child-list {
    display: block;
}

.mm-has-child.show-sub>a>.mm-icon {
    transform: rotate(90deg);
    color: var(--accent-color);
}

.megamenu-item-block {
    margin-bottom: 15px !important;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.megamenu-item-block:last-child {
    border-bottom: none;
}

.megamenu-grid .megamenu-list {
    display: none;
    margin: 0;
    padding: 0;
    padding-left: 10px;
    margin-top: 15px;
}

.megamenu-grid .megamenu-item-block.show-sub-mobile .megamenu-list {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.megamenu-grid .title-arrow {
    transition: transform 0.3s ease;
}

.megamenu-grid .megamenu-item-block.show-sub-mobile .title-arrow {
    transform: rotate(180deg);
}

.megamenu-grid .mm-child-list {
    display: none;
    padding-left: 15px;
    padding-top: 5px;
}

.megamenu-grid .mm-has-child.show-sub .mm-child-list {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.megamenu-grid .mm-has-child.show-sub>a>.mm-icon {
    transform: rotate(90deg);
    color: var(--accent-color);
}

#main-nav .nav-item {
    display: block;
    width: 100%;
    margin-bottom: 5px;
}

#main-nav .dropdown-menu {
    display: none;
    position: static;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    box-shadow: none !important;
    padding-left: 1rem;
}

#main-nav .dropdown-menu.show {
    display: block;
}

#main-nav .dropdown-item {
    padding: 10px 15px;
    border-radius: 5px;
    color: #ffffff !important;
    opacity: 0.85;
    transition: 0.2s;
}

/* ==========================================
   SCROLL NGANG (QUỸ CĂN & PAGE BUILDER)
========================================== */
.property-horizontal-scroll,
.mobile-horizontal-scroll {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.property-horizontal-scroll::-webkit-scrollbar,
.mobile-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.property-scroll-item {
    flex: 0 0 230px !important;
    scroll-snap-align: start;
}

.mobile-horizontal-scroll>.col-md-6 {
    flex: 0 0 85% !important;
    max-width: 85% !important;
    scroll-snap-align: center;
}

.mobile-horizontal-scroll>.col-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    scroll-snap-align: center;
}

/* ==========================================
   THU NHỎ GIAO DIỆN VÀ PADDING
========================================== */
body {
    padding-bottom: 80px !important;
}

.container-fluid {
    padding: 10px;
}

.card-header-custom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.info-grid {
    grid-template-columns: 1fr 1fr;
}

.border-end {
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.kygui-input-col {
    margin-bottom: 10px;
}

.floating-search-bar {
    margin-top: 20px;
}

#public-hero-section {
    padding-bottom: 30px !important;
    min-height: 350px !important;
    height: 350px !important;
}

.prop-hero-section {
    min-height: 300px !important;
    height: 300px !important;
}

#dynamic-hero-text {
    min-height: auto !important;
    padding-top: 1rem !important;
}

#dynamic-hero-text h1,
#dynamic-hero-text h2,
.carousel-caption h1,
.carousel-caption h2,
.carousel-caption .h1 {
    font-size: 1.7rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.75rem !important;
}

#dynamic-hero-text h3,
.carousel-caption h3 {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
    margin-bottom: 1rem !important;
}

#dynamic-hero-text p,
.carousel-caption p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1rem !important;
}

#dynamic-hero-text .btn,
.carousel-caption .btn {
    font-size: 0.85rem !important;
    padding: 10px 20px !important;
}

#hero-slider-container {
    height: 100% !important;
}

/* ==========================================
   TÙY CHỈNH CÁC KHỐI CHI TIẾT
========================================== */
.article-content .carousel-caption {
    position: static !important;
    background: #fff !important;
    padding: 10px 15px !important;
}

.article-content .carousel-caption p {
    color: #333 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bổ sung thêm cho chữ Hero trên Mobile đỡ bị to quá lề */
#heroSlider .carousel-caption h1,
#heroSlider .carousel-caption .h1 {
    font-size: 1.6rem !important;
}

#heroSlider .carousel-caption p.fs-5 {
    font-size: 0.95rem !important;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--primary-color) !important;
    border-radius: 50%;
    background-size: 50%;
}

.col-lg-4 {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 5px solid var(--primary-light);
}

.col-lg-4 .bg-white.text-center {
    display: none !important;
}

.col-lg-4>.sticky-top {
    position: static !important;
    max-height: none !important;
    overflow-y: visible !important;
    height: auto !important;
    top: auto !important;
}

.btn-jump-to-form {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    margin: 20px 0;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(194, 162, 109, 0.4);
    animation: pulse-soft 2s infinite;
}

.floating-contact {
    bottom: 20px;
    right: 15px;
    left: auto;
    gap: 10px;
}

.contact-btn .icon-wrap {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
}

.contact-btn .contact-text {
    display: none !important;
}

.vhm-action-bar {
    height: 50px !important;
    padding: 5px 0 !important;
}

.action-item {
    flex-direction: column;
    padding: 0;
}

.action-item i,
.action-item svg {
    margin-right: 0 !important;
    font-size: 1.1rem !important;
}

.action-item .m-label {
    font-size: 0.65rem !important;
    font-weight: 700;
    margin-top: 2px !important;
    text-transform: none;
}

/* =========================================================
   FIX CÂN ĐỐI ICON & CHỮ THANH STICKY MENU (MOBILE)
========================================================= */
#vhm-sticky-nav {
    top: 85px !important;
    border-radius: 12px;
    height: auto;
    min-height: 55px !important;
}

#dynamic-anchor-nav {
    padding-right: 45px;
    flex-wrap: nowrap !important;
}

#dynamic-anchor-nav .nav-item {
    flex-shrink: 0 !important;
}

/* Đưa về cấu trúc Dọc (Column), Căn giữa tuyệt đối, Màu xám */
#dynamic-anchor-nav .nav-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 12px !important;
    white-space: nowrap !important;
    gap: 4px !important;
    color: #475569 !important;
    border-bottom: 3px solid transparent !important;
}

/* Chỉnh Icon to lên một chút để cân xứng */
#dynamic-anchor-nav .nav-link i {
    margin: 0 !important;
    font-size: 1.15rem !important;
    line-height: 1 !important;
}

/* Chỉnh Chữ nhỏ lại một chút cho thanh lịch */
#dynamic-anchor-nav .nav-link span.nav-text {
    font-size: 0.75rem !important;
    font-weight: 600;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Hiệu ứng khi đang xem (Active) */
#dynamic-anchor-nav .nav-link.active {
    color: var(--primary-color) !important;
    border-bottom: 3px solid var(--primary-color) !important;
}

#dynamic-anchor-nav .separator {
    height: 20px;
}

/* Các cấu hình ảnh chung */
.album-grid-2 img {
    height: 200px !important;
}

.album-gallery .album-main {
    height: 250px !important;
}

.album-gallery .album-thumbs {
    justify-content: flex-start;
}

/* ==========================================
   HIỆU ỨNG ẢNH TRÀN LỀ (EDGE-TO-EDGE) CHO MOBILE
========================================== */
@media (max-width: 767px) {

    /* Ép khối ảnh rộng hơn thẻ cha và kéo dãn ra 2 bên mép màn hình */
    .article-content .custom-album-wrapper,
    .article-content>figure,
    .article-content>img {
        width: calc(100% + 3rem) !important;
        /* Phá vỡ chiều rộng (cộng thêm 1.5rem x 2) */
        max-width: none !important;
        margin-left: -1.5rem !important;
        /* Âm margin bù lại padding p-4 của thẻ cha */
        margin-right: -1.5rem !important;
        border-radius: 0 !important;
        /* Xóa bo góc để ảnh vuông vắn sát mép */
    }

    /* Xóa bo góc của ảnh bên trong Slider */
    .article-content .custom-album-wrapper .carousel-inner,
    .article-content .custom-album-wrapper img,
    .article-content>figure img {
        border-radius: 0 !important;
    }

    /* Đẩy phần chữ chú thích (caption) lùi vào trong một chút để không bị dính sát mép điện thoại */
    .article-content .custom-mobile-caption,
    .article-content figcaption {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}