/* ===== Global ===== */
* {
    touch-action: pan-x pan-y;
}

/* ===== Brand Colors ===== */
:root {
    --g4d-primary: #7f111c;
    --g4d-primary-hover: #5e0c14;
}

/* ===== Header ===== */
.g4d-header {
    background-color: var(--g4d-primary);
    position: sticky;
    top: 0;
    z-index: 1045;
}

.g4d-logo {
    height: 50px;
}

/* ===== Footer ===== */
.g4d-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.875rem;
}

/* ===== Buttons ===== */
.btn-g4d {
    background-color: var(--g4d-primary);
    color: #fff;
    border: none;
    font-weight: 700;
}

.btn-g4d:hover,
.btn-g4d:focus {
    background-color: var(--g4d-primary-hover);
    color: #fff;
}

/* ===== Listing Cards ===== */
.listing-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.2s ease;
}

.listing-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.listing-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: #f0f0f0;
}

.listing-card-img-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.1rem;
}

.listing-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
}

.listing-card-city {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
}

.listing-card-address {
    font-size: 1.5rem;
    line-height: 1.2;
    text-align: center;
}

.listing-card-dimension {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
}

.listing-card-price {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
}

.listing-card-date {
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.listing-card-services {
    text-align: center;
    color: #6c757d;
}

.listing-card-footer {
    padding: 0 1rem 1rem;
    margin-top: auto;
}

/* ===== Filter Bar ===== */
.filter-bar {
    background-color: lightgrey;
    padding: 0.75rem 1rem;
}

.filter-bar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

/* ===== Housing Detail Page ===== */
.thumbnail-card {
    border: 2px solid var(--g4d-primary);
    border-radius: 0.5rem;
    overflow: hidden;
}

.housing-center-info {
    text-align: center;
    line-height: 1.6;
}

.housing-price {
    font-size: 2.5rem;
    font-weight: bold;
}

.housing-dimension {
    font-size: 1.35rem;
    font-weight: 600;
}

.housing-availability {
    font-size: 1.35rem;
    font-weight: bold;
}

.building-center-info {
    text-align: center;
}

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.photo-grid-2col {
    grid-template-columns: 1fr 1fr;
}

.photo-grid-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0.375rem;
    background-color: #f0f0f0;
}

/* ===== Rental Form ===== */
.rental-form-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.25rem;
    background-color: #fff;
}

.rental-form-card .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* ===== Confirmation Page ===== */
.confirmation-card {
    max-width: 600px;
    margin: 3rem auto;
    text-align: center;
    padding: 2rem;
    border: 2px solid var(--g4d-primary);
    border-radius: 0.5rem;
}

.confirmation-card .material-icons {
    font-size: 4rem;
    color: #198754;
}

/* ===== Photo Gallery Lightbox ===== */
.photo-clickable {
    cursor: pointer;
    transition: opacity 0.15s;
}

.photo-clickable:hover {
    opacity: 0.85;
}

.gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    z-index: 2;
}

.gallery-counter {
    color: #ccc;
    font-size: 0.9rem;
}

.gallery-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.5rem;
}

.gallery-close:hover {
    color: #ccc;
}

.gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 4rem;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

.gallery-main,
.gallery-main img {
    touch-action: none;
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-select: none;
}

.gallery-main img.zoomed {
    cursor: grab;
}

.gallery-main img.zoomed:active {
    cursor: grabbing;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 1rem;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.gallery-arrow:hover {
    opacity: 1;
}

.gallery-arrow-left {
    left: 0;
}

.gallery-arrow-right {
    right: 0;
}

.gallery-thumbs {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}

.gallery-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 3px;
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.15s, border-color 0.15s;
}

.gallery-thumb:hover {
    opacity: 0.8;
}

.gallery-thumb-active {
    opacity: 1;
    border-color: #fff;
}

/* ===== Chip Multi-select ===== */
.chip-select {
    position: relative;
}

.chip-select-label {
    font-weight: 700;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.2rem;
}

.chip-select-box {
    display: flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.chip-select-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
}

.chip {
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    border-radius: 1rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
    gap: 0.3rem;
}

.chip-remove {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: #6c757d;
    font-weight: bold;
}

.chip-remove:hover {
    color: #dc3545;
}

.chip-select-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    flex-shrink: 0;
}

.chip-clear {
    cursor: pointer;
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1;
}

.chip-clear:hover {
    color: #dc3545;
}

.chip-arrow {
    color: #6c757d;
    font-size: 0.75rem;
}

.multiselect-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.75rem;
    max-height: 250px;
    overflow-y: auto;
}

.multiselect-panel .form-check {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}

/* ===== Responsive ===== */
@media (max-width: 575.98px) {
    .listing-card-city {
        font-size: 1.5rem;
    }

    .listing-card-price,
    .listing-card-date,
    .listing-card-dimension {
        font-size: 1.5rem;
    }

    .gallery-main {
        padding: 2.5rem 0.5rem;
    }

    .gallery-arrow {
        font-size: 1.5rem;
        padding: 0.5rem;
    }
}
