
/* ============================================
   HOUSE MAP CONTAINER
   ============================================ */
.house-map-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.house-map-image {
    display: block;
    width: 100%;
    height: auto;
}

/* ============================================
   MOBILE DROPDOWN MENU (< 768px only)
   ============================================ */
.house-map-mobile-menu {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;

    @media screen and (max-width: 768px) {
        display: block;
    }
}

.house-map-mobile-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 6px;
    font-size: 0;
    color: transparent;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: background 0.1s ease;
    overflow: hidden;
    text-indent: -9999px;

    &::before,
    &::after {
        content: "";
        position: absolute;
        left: 9px;
        width: 22px;
        height: 2px;
        background: #333;
        border-radius: 2px;
    }

    &::before {
        top: 12px;
        box-shadow: 0 7px 0 #333;
    }

    &::after {
        top: 26px;
    }

    &:hover,
    &:focus {
        background: #fff;
        outline: none;
    }
}

.house-map-mobile-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.1s ease, opacity 0.1s ease;
    position: absolute;
    top: 48px;
    left: 0;
    min-width: 220px;

    &.open {
        max-height: 50vh;
        overflow-y: auto;
        opacity: 1;
    }
}

.house-map-mobile-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s ease;

    &:last-child {
        border-bottom: none;
    }

    &:hover {
        background: #f5f5f5;
    }
}

.mobile-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;

    &.dot-available   { background-color: green; }
    &.dot-reserved    { background-color: #e3c804; }
    &.dot-unavailable { background-color: red; }
}

.mobile-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   TOOLTIP CLOSE BUTTON (mobile only)
   ============================================ */
.tooltip-close {
    display: none;

    @media screen and (max-width: 768px) {
        display: block;
        position: absolute;
        top: 6px;
        right: 10px;
        background: none;
        border: none;
        font-size: 1.4rem;
        color: #999;
        cursor: pointer;
        line-height: 1;
        padding: 2px 6px;

        &:hover {
            color: #333;
        }
    }
}

/* ============================================
   MAP MARKER & DOT
   ============================================ */
.house-map-marker {
    position: absolute;
    display: block;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    cursor: pointer;

    @media screen and (max-width: 1367px) {
        width: 18px;
        height: 18px;
    }

    @media screen and (max-width: 768px) {
        width: 12px;
        height: 12px;
    }

    &:hover .map-dot {
        transform: scale(1.2);
    }

    &:hover,
    &.mobile-tooltip-open {
        z-index: 50;
    }

    &:hover .map-tooltip,
    &.mobile-tooltip-open .map-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(-5px);

        @media screen and (max-width: 768px) {
            transform: translateX(-50%) translateY(10px);
        }
    }

    @media screen and (max-width: 768px) {
        &:hover .map-tooltip {
            opacity: 0;
            visibility: hidden;
            transform: translateX(-50%);
        }

        &.mobile-tooltip-open .map-tooltip {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) translateY(10px);
            z-index: 200;
        }
    }
}

.map-dot {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 50%;
    margin: 0;
    transition: transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);

    @media screen and (max-width: 1367px) {
        width: 18px;
        height: 18px;
    }

    @media screen and (max-width: 768px) {
        width: 12px;
        height: 12px;
    }

    &.dot-available   { background-color: green; }
    &.dot-reserved    { background-color: #e3c804; }
    &.dot-unavailable { background-color: red; }
}

/* ============================================
   TOOLTIP
   ============================================ */
.map-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #242424;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: auto;
    margin-bottom: 5px;
    z-index: 10;

    > div {
        line-height: 1.2;
    }

    @media screen and (max-width: 768px) {
        padding: 10px;
        width: 250px;
    }

    &::before {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 15px;
        background: transparent;
    }

    &::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: #fff transparent transparent transparent;
    }
}

/* ============================================
   TOOLTIP CONTENT
   ============================================ */
.tooltip-title {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 18px;

    @media screen and (max-width: 768px) {
        font-size: 16px;
    }
}

.tooltip-description {
    margin: 1.25rem 0;

    @media screen and (max-width: 768px) {
        margin: 0.85rem 0;
    }

    p {
        margin-bottom: 5px;
    }
}

.tooltip-attributes {
    margin: 1.25rem 0;

    @media screen and (max-width: 768px) {
        margin: 0.85rem 0;
    }

    .tooltip-attribute {
        font-weight: 300;
        margin-bottom: 0.5rem;

        &:last-child {
            margin-bottom: 0;
        }

        span {
            font-weight: bold;
        }
    }
}

.tooltip-status {
    font-weight: 300;
    margin-bottom: 0.5rem;
}

/* ============================================
   OMNIBUS — Lowest price in 30 days
   ============================================ */
.omnibus-price {
    font-size: 0.7rem;
    color: #999;
    font-weight: 400;
    margin-top: 0;

    span {
        font-weight: 600;
        color: #999;
    }
}

.tooltip-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

/* ============================================
   HOUSE LIST TABLE
   ============================================ */
.house-list-container {
    width: 100%;
    overflow-y: auto;
    overflow-x: auto;
    background: #fff;
    max-height: 500px;

    @media screen and (max-width: 768px) {
        display: none;
    }
}

.house-list-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    line-height: 1.2;
    margin-bottom: 0;

    * {
        line-height: 1.2;
    }

    thead th {
        background-color: #fff;
        color: #999;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.8rem;
        padding: 12px 12px;
        text-align: left;
    }

    td {
        padding: 8px 12px;
        color: #333;
        border-bottom: 1px solid #f0f0f0;
        vertical-align: middle;
        font-size: 0.8rem;
    }

    tbody tr:hover {
        background-color: #f9f9f9;
    }
}

/* ============================================
   MOBILE HOUSE CARDS (< 768px only)
   ============================================ */
.house-cards-container {
    display: none;

    @media screen and (max-width: 768px) {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0;
        margin-top: 10px;
    }
}

.house-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 16px;
    line-height: 1.3;
}

.house-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.house-card-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #242424;
}

.house-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.house-card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
}

.house-card-description {
    font-size: 0.85rem;
    color: #666;

    p {
        margin: 0.5rem !important;
    }
}

.house-card-label {
    color: #999;
    font-weight: 400;
}

.house-card-value {
    color: #333;
    font-weight: 600;
}

.house-card-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1 0 auto;
    max-width: 50%;
    display: inline-block;
    padding: 10px 5px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    transition: all 0.1s ease;

    &.disabled {
        pointer-events: none;
        opacity: 0.5;
    }

    &.outline {
        border: 1px solid #ccc;
        color: #666;
        background: transparent;

        &:hover {
            border-color: var(--e-global-color-text);
            color: var(--e-global-color-text);
        }
    }

    &.primary {
        background-color: var(--e-global-color-primary);
        border: 1px solid var(--e-global-color-primary);
        color: #fff;

        &:hover {
            background-color: #5a9aca;
            border-color: #5a9aca;
        }
    }
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.status-available {
    background-color: #e6f8ec;
    color: #27ae60;
}

.status-unavailable {
    background-color: #fbecec;
    color: #c0392b;
}

.status-reserved {
    background-color: #fff8e1;
    color: #e3c804;
}

/* ============================================
   TABLE ACTION BUTTONS
   ============================================ */
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================
   HOUSE PLANS WIDGET
   ============================================ */
.house-plans-wrapper {
    width: 100%;
}

.house-plan-section {
    display: grid;
    grid-gap: 15px;
    grid-template-columns: 60% auto;
    align-items: center;
    
    @media screen and (max-width: 1024px) {
        display: block;
    }
}

.house-plan-title {
    font-size: 1.4rem;
    font-weight: 400;
    color: #242424;
    text-transform: uppercase;
    margin: 0;
    margin-bottom: 15px;
}

.house-plan-image {
    @media screen and (max-width: 1024px) {
        margin-bottom: 20px;
    }
}

.house-plan-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Surface summary table */
.house-plan-surface-table-wrap {
    overflow-x: auto;
}

.house-plan-surface-table {
    border-collapse: collapse;
    line-height: 1.4;
    margin-bottom: 0;
    background: #fff;
}

.house-plan-surface-table thead th {
    background-color: #f8f8f8;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

.house-plan-surface-table thead th.col-use,
.house-plan-surface-table thead th.col-floor {
    text-align: right;
    white-space: nowrap;
}

.house-plan-surface-table tbody td {
    padding: 10px 16px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.house-plan-surface-table tbody td.col-use,
.house-plan-surface-table tbody td.col-floor {
    text-align: right;
    white-space: nowrap;
}

.house-plan-surface-table tbody tr:hover {
    background-color: #fafafa;
}

.house-plan-surface-table tfoot td {
    padding: 12px 16px;
    border-top: 2px solid #e0e0e0;
    font-size: 0.9rem;
    color: #242424;
}

.house-plan-surface-table tfoot td.col-use,
.house-plan-surface-table tfoot td.col-floor {
    text-align: right;
    white-space: nowrap;
}

@media screen and (max-width: 768px) {
    .house-plan-title {
        font-size: 1.1rem;
    }

    .house-plan-surface-table thead th,
    .house-plan-surface-table tbody td,
    .house-plan-surface-table tfoot td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

.house-plans-divider {
    height: 1px;
    margin: 30px auto !important;
    max-width: 50% !important;
    padding: 0;
    border: 0;
    background-color: #c9a24d !important;
}