/* ==========================================================================
   CSS cho Single Dự án MVP (P4-004)
   Bắt buộc dùng class prefix `bds-single-*` tránh rò rỉ và xung đột styles
   ========================================================================== */

/* === Bố cục chung (Layout) === */
.bds-single-project-wrapper {
    padding-top: 2rem;
    padding-bottom: 4rem;
    background-color: #f9fafb;
}

.bds-single-project-wrapper__breadcrumb {
    margin-bottom: 1.5rem;
}

.bds-single-project {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .bds-single-project {
        grid-template-columns: 2fr 1fr;
    }
}

.bds-single-project__main-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .bds-single-project__main-content {
        padding: 2.5rem;
    }
}

/* === Part 1: Gallery (Album ảnh & Lightbox) === */
.bds-single-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bds-single-gallery__main-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #e5e7eb;
}

.bds-single-gallery__main-link {
    display: block;
    width: 100%;
    height: 100%;
}

.bds-single-gallery__main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bds-single-gallery__main-link:hover .bds-single-gallery__main-img {
    transform: scale(1.02);
}

.bds-single-gallery__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
}

.bds-single-gallery__badge-status {
    background-color: #1e541a;
    color: #ffffff;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bds-single-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.bds-single-gallery__thumb-link {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background-color: #e5e7eb;
    display: block;
}

.bds-single-gallery__thumb-link--hidden {
    display: none;
}

.bds-single-gallery__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bds-single-gallery__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Lightbox Modal */
.bds-single-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.bds-single-lightbox[aria-hidden="false"] {
    display: flex;
}

.bds-single-lightbox__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
}

.bds-single-lightbox__prev,
.bds-single-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10000;
    transition: background 0.2s ease;
}

.bds-single-lightbox__prev:hover,
.bds-single-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.25);
}

.bds-single-lightbox__prev { left: 1.5rem; }
.bds-single-lightbox__next { right: 1.5rem; }

.bds-single-lightbox__content {
    max-width: 85%;
    max-height: 80%;
}

.bds-single-lightbox__img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.bds-single-lightbox__counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
}

/* === Part 2: Overview (Tổng quan) === */
.bds-single-overview {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 2rem;
}

.bds-single-overview__title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .bds-single-overview__title {
        font-size: 2rem;
    }
}

.bds-single-overview__location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4b5563;
    font-size: 0.875rem;
}

.bds-single-overview__price-bar {
    margin-top: 1.5rem;
    background-color: #f0f7f0;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.bds-single-overview__price-item {
    display: flex;
    flex-direction: column;
}

.bds-single-overview__price-label {
    font-size: 0.75rem;
    color: #4b5563;
    text-transform: uppercase;
    font-weight: 500;
}

.bds-single-overview__price-val {
    font-size: 1.25rem;
    color: #1e541a;
    font-weight: 800;
}

.bds-single-overview__grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 2rem;
}

@media (min-width: 640px) {
    .bds-single-overview__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.bds-single-overview__grid-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    border-bottom: 1px dashed #f3f4f6;
    padding-bottom: 0.5rem;
}

.bds-single-overview__grid-label {
    color: #4b5563;
    font-weight: 500;
}

.bds-single-overview__grid-val {
    color: #111827;
    font-weight: 600;
}

/* === Part 3: Description (Mô tả chi tiết) === */
.bds-single-description {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 2rem;
}

.bds-single-description__heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.bds-single-description__content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #374151;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.bds-single-description__content p {
    margin-bottom: 1rem;
}

.bds-single-description__toggle-btn {
    background: none;
    border: none;
    color: #1e541a;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1rem;
    padding: 0;
}

.bds-single-description__toggle-btn svg {
    transition: transform 0.3s ease;
}

.bds-single-description__toggle-btn--active svg {
    transform: rotate(180deg);
}

/* === Part 4: Amenities Tabs (Tiện ích) === */
.bds-single-amenities {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 2rem;
}

.bds-single-amenities__heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.bds-single-amenities__tabs-nav {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.bds-single-amenities__tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.bds-single-amenities__tab-btn:hover {
    color: #1e541a;
}

.bds-single-amenities__tab-btn--active {
    color: #1e541a;
    border-bottom-color: #1e541a;
}

.bds-single-amenities__panel {
    display: none;
}

.bds-single-amenities__panel--active {
    display: block;
}

.bds-single-amenities__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 640px) {
    .bds-single-amenities__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.bds-single-amenities__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.bds-single-amenities__icon {
    color: #1e541a;
    flex-shrink: 0;
}

/* === Part 5: Legal Info (Pháp lý) === */
.bds-single-legal {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 2rem;
}

.bds-single-legal__heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.bds-single-legal__card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bds-single-legal__info {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.bds-single-legal__icon {
    color: #4b5563;
    margin-top: 0.25rem;
}

.bds-single-legal__details {
    display: flex;
    flex-direction: column;
}

.bds-single-legal__label {
    font-size: 0.75rem;
    color: #4b5563;
    font-weight: 500;
}

.bds-single-legal__val {
    font-size: 0.95rem;
    color: #111827;
    font-weight: 600;
}

.bds-single-legal__brochure {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}

.bds-single-legal__brochure-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    display: block;
    margin-bottom: 0.25rem;
}

.bds-single-legal__brochure-desc {
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 1rem;
}

.bds-single-legal__download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-color: #d1d5db;
    color: #9ca3af;
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* === Part 6: Map Placeholder === */
.bds-single-map {
    padding-bottom: 1rem;
}

.bds-single-map__heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

.bds-single-map__container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    position: relative;
}

.bds-single-map__mockup {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: #f4f6f4;
}

.bds-single-map__overlay-card {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-width: 380px;
    z-index: 20;
}

.bds-single-map__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    display: block;
}

.bds-single-map__address {
    font-size: 0.75rem;
    color: #4b5563;
    margin: 0.25rem 0 0.5rem;
}

.bds-single-map__notice {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: #1e541a;
    font-weight: 600;
}

/* === Part 7 & 9: Sidebar & Lead Form === */
.bds-single-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .bds-single-sidebar {
        position: -webkit-sticky;
        position: sticky;
        top: 2rem;
        /* Giúp sticky không bị tràn chân trang */
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
        padding-bottom: 1rem;
    }
}

.bds-single-sidebar__box {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.bds-single-sidebar__box--hotline {
    background: linear-gradient(135deg, #1e541a 0%, #123510 100%);
    color: #ffffff;
    border: none;
}

.bds-single-sidebar__heading {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.bds-single-sidebar__desc {
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.bds-single-sidebar__phone-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: #ffffff;
    color: #1e541a;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.bds-single-sidebar__phone-btn:hover {
    transform: translateY(-2px);
}

.bds-single-sidebar__zalo-row {
    margin-top: 0.75rem;
}

.bds-single-sidebar__zalo-btn {
    width: 100%;
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.08);
}

.bds-single-sidebar__zalo-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
}

/* CSS Lead Form bên trong Sidebar */
.bds-single-lead-form__header {
    margin-bottom: 1.25rem;
}

.bds-single-lead-form__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.bds-single-lead-form__subtitle {
    font-size: 0.8rem;
    color: #4b5563;
    line-height: 1.4;
}

.bds-single-lead-form__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bds-single-lead-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bds-single-lead-form__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
}

.bds-single-lead-form__input,
.bds-single-lead-form__textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.bds-single-lead-form__disclaimer {
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1.4;
}

.bds-single-lead-form__submit-btn {
    width: 100%;
    padding: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    background-color: #e5e7eb;
    border: 1px solid #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.bds-single-sidebar__share-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.75rem;
}

.bds-single-sidebar__share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bds-single-sidebar__share-btn:hover {
    border-color: #1e541a;
    color: #1e541a;
}

/* === Part 8: Related Projects (Các dự án liên quan) === */
.bds-single-related {
    margin-top: 3rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 2.5rem;
}

.bds-single-related__heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
}

.bds-single-related__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .bds-single-related__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bds-single-related__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.bds-single-related__card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bds-single-related__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

.bds-single-related__card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.bds-single-related__img-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    background-color: #f3f4f6;
    overflow: hidden;
}

.bds-single-related__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bds-single-related__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: #1e541a;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.bds-single-related__body {
    padding: 1rem;
}

.bds-single-related__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7em;
}

.bds-single-related__location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.bds-single-related__footer {
    border-top: 1px solid #f3f4f6;
    padding-top: 0.75rem;
}

.bds-single-related__price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e541a;
}

/* Fallback Single Listing Basic Layout */
.bds-single-listing-wrapper {
    padding: 3rem 0;
    background-color: #f9fafb;
}

.bds-single-listing {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

@media (min-width: 768px) {
    .bds-single-listing {
        padding: 2.5rem;
    }
}

.bds-single-listing__header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 1rem;
}

.bds-single-listing__title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
}

@media (min-width: 768px) {
    .bds-single-listing__title {
        font-size: 1.85rem;
    }
}

.bds-single-listing__meta {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 0.5rem;
}

.bds-single-listing__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .bds-single-listing__grid {
        grid-template-columns: 2fr 1fr;
    }
}

.bds-single-listing__image {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.bds-single-listing__image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.bds-single-listing__content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #374151;
}

.bds-single-listing__box {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.bds-single-listing__box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #111827;
}

.bds-single-listing__box p {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: #4b5563;
}
