/* 
   Hallmark Barns - Inventory Display Styles
 */

/*  Variables  */
:root {
    --hb-primary:    #8B4513;      /* Saddle brown - barn theme         */
    --hb-primary-dk: #6B3410;      /* Darker shade for hover            */
    --hb-accent:     #D4A76A;      /* Warm tan accent                   */
    --hb-text:       #333333;
    --hb-text-light: #666666;
    --hb-border:     #E0D5C8;
    --hb-bg:         #FAFAF7;
    --hb-white:      #FFFFFF;
    --hb-shadow:     0 2px 8px rgba(0, 0, 0, 0.08);
    --hb-shadow-lg:  0 4px 16px rgba(0, 0, 0, 0.12);
    --hb-radius:     8px;
}

/*  View Toggle  */
.hb-view-toggle {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 12px;
}

.hb-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--hb-border);
    border-radius: 4px;
    background: var(--hb-white);
    color: var(--hb-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hb-view-btn:hover {
    border-color: var(--hb-accent);
    color: var(--hb-text);
}

.hb-view-btn.active {
    background: var(--hb-primary);
    border-color: var(--hb-primary);
    color: var(--hb-white);
}

/*  Carousel Section  */
.hb-inventory-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.hb-carousel {
    margin: 0 -10px;
}

/*  Gallery Mode (5-column grid)  */
.hb-carousel.hb-gallery-mode {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin: 0;
}

.hb-carousel.hb-gallery-mode .hb-card {
    margin: 0;
}

.hb-carousel .slick-slide {
    padding: 0 10px;
}

/* Slick arrow overrides */
.hb-carousel .slick-prev,
.hb-carousel .slick-next {
    z-index: 10;
    width: 40px;
    height: 40px;
}
.hb-carousel .slick-prev { left: -5px; }
.hb-carousel .slick-next { right: -5px; }

.hb-carousel .slick-prev:before,
.hb-carousel .slick-next:before {
    color: var(--hb-primary);
    font-size: 28px;
}

/* Slick dots overrides */
.hb-carousel .slick-dots li button:before {
    color: var(--hb-border);
    font-size: 10px;
}
.hb-carousel .slick-dots li.slick-active button:before {
    color: var(--hb-primary);
}

/*  Building Card  */
.hb-card {
    background: var(--hb-white);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    overflow: hidden;
    box-shadow: var(--hb-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.hb-card:hover {
    box-shadow: var(--hb-shadow-lg);
    transform: translateY(-2px);
}

.hb-card-image {
    position: relative;
    width: 100%;
    padding-top: 66.67%;  /* 3:2 aspect ratio */
    overflow: hidden;
    background: var(--hb-bg);
}

.hb-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hb-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.hb-card-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--hb-text);
}

.hb-card-size {
    margin: 0 0 4px;
    font-size: 0.9rem;
    color: var(--hb-text-light);
    font-weight: 600;
}

.hb-card-colors {
    margin: 0 0 4px;
    font-size: 0.82rem;
    color: var(--hb-text-light);
}

.hb-card-options {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: var(--hb-text-light);
    font-style: italic;
}

.hb-card-price {
    margin: 8px 0 2px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hb-primary);
}

.hb-card-rto {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--hb-text-light);
}

.hb-card-btn {
    display: inline-block;
    margin-top: auto;
    padding: 10px 20px;
    background: var(--hb-primary);
    color: var(--hb-white);
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 5px;
    transition: background 0.2s ease;
}

.hb-card-btn:hover {
    background: var(--hb-primary-dk);
    color: var(--hb-white);
    text-decoration: none;
}

/*  Placeholder Image  */
.hb-placeholder-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hb-bg);
    color: var(--hb-text-light);
    font-size: 0.9rem;
}

.hb-placeholder-lg {
    position: relative;
    min-height: 300px;
}

/*  Empty / Error States  */
.hb-no-buildings,
.hb-inventory-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--hb-text-light);
    font-size: 1rem;
    background: var(--hb-bg);
    border: 1px dashed var(--hb-border);
    border-radius: var(--hb-radius);
    max-width: 600px;
    margin: 20px auto;
}

/* 
   Detail Page
    */

.hb-detail-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 24px;
}

/* Gallery spans the left column, rows 1-2 */
.hb-detail-gallery {
    grid-column: 1;
    grid-row: 1 / 3;
}

/* Info sits top-right */
.hb-detail-info {
    grid-column: 2;
    grid-row: 1;
}

/* Pricing sits below info */
.hb-detail-pricing {
    grid-column: 2;
    grid-row: 2;
}

/* RTO spans full width below */
.hb-detail-rto {
    grid-column: 1 / -1;
    grid-row: 3;
}

/*  Gallery  */
.hb-gallery-main {
    width: 100%;
    border-radius: var(--hb-radius);
    overflow: hidden;
    background: var(--hb-bg);
    border: 1px solid var(--hb-border);
}

.hb-gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
    object-fit: contain;
    background: var(--hb-bg);
}

.hb-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.hb-gallery-thumb {
    flex: 0 0 80px;
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.hb-gallery-thumb:hover {
    opacity: 1;
}

.hb-gallery-thumb.active {
    border-color: var(--hb-primary);
    opacity: 1;
}

.hb-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*  Info Table  */
.hb-detail-title {
    margin: 0 0 16px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--hb-text);
}

.hb-info-table {
    width: 100%;
    border-collapse: collapse;
}

.hb-info-table th,
.hb-info-table td {
    padding: 8px 12px;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--hb-border);
}

.hb-info-table th {
    font-weight: 600;
    color: var(--hb-text-light);
    width: 40%;
}

.hb-info-table td {
    color: var(--hb-text);
}

/*  Detail Options  */
.hb-detail-options {
    margin-top: 16px;
}

.hb-detail-options h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--hb-text);
}

.hb-detail-options ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.hb-detail-options li {
    font-size: 0.9rem;
    color: var(--hb-text);
    padding: 2px 0;
}

/*  Pricing Table  */
.hb-detail-pricing h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hb-text);
}

.hb-pricing-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--hb-white);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    overflow: hidden;
}

.hb-pricing-table th,
.hb-pricing-table td {
    padding: 10px 14px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--hb-border);
}

.hb-pricing-table th {
    text-align: left;
    font-weight: 500;
    color: var(--hb-text-light);
}

.hb-pricing-table td {
    text-align: right;
    font-weight: 600;
    color: var(--hb-text);
}

.hb-pricing-total th,
.hb-pricing-total td {
    border-bottom: none;
    border-top: 2px solid var(--hb-primary);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hb-primary);
    padding: 12px 14px;
}

.hb-delivery-note {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--hb-text-light);
    font-style: italic;
}

/*  RTO Section  */
.hb-detail-rto {
    background: var(--hb-bg);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: 24px;
}

.hb-detail-rto h3 {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--hb-text);
}

.hb-rto-subtitle {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: var(--hb-text-light);
}

/* Tabs */
.hb-rto-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.hb-rto-tab {
    padding: 8px 20px;
    border: 2px solid var(--hb-border);
    border-radius: 5px;
    background: var(--hb-white);
    color: var(--hb-text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hb-rto-tab:hover {
    border-color: var(--hb-accent);
}

.hb-rto-tab.active {
    background: var(--hb-primary);
    color: var(--hb-white);
    border-color: var(--hb-primary);
}

/* Panel / Table */
.hb-rto-panel {
    transition: opacity 0.2s ease;
}

.hb-hidden {
    display: none;
}

.hb-rto-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--hb-white);
    border-radius: var(--hb-radius);
    overflow: hidden;
    border: 1px solid var(--hb-border);
}

.hb-rto-table thead th {
    background: var(--hb-primary);
    color: var(--hb-white);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 14px;
    text-align: left;
}

.hb-rto-table tbody td {
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--hb-text);
    border-bottom: 1px solid var(--hb-border);
}

.hb-rto-table tbody tr:last-child td {
    border-bottom: none;
}

.hb-rto-table tbody tr:hover {
    background: rgba(139, 69, 19, 0.04);
}

.hb-rto-note {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--hb-text-light);
    font-style: italic;
}

/* 
   Responsive
    */

@media (max-width: 1200px) {
    .hb-carousel.hb-gallery-mode {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .hb-carousel.hb-gallery-mode {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hb-carousel.hb-gallery-mode {
        grid-template-columns: repeat(2, 1fr);
    }

    .hb-detail-container {
        display: flex;
        flex-direction: column;
    }

    .hb-detail-gallery,
    .hb-detail-info,
    .hb-detail-pricing,
    .hb-detail-rto {
        width: 100%;
    }

    .hb-gallery-thumb {
        flex: 0 0 60px;
        width: 60px;
        height: 45px;
    }

    .hb-rto-table thead th,
    .hb-rto-table tbody td {
        padding: 8px 10px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .hb-carousel.hb-gallery-mode {
        grid-template-columns: 1fr;
    }

    .hb-card-title {
        font-size: 1rem;
    }

    .hb-card-price {
        font-size: 1.15rem;
    }

    .hb-detail-title {
        font-size: 1.3rem;
    }

    .hb-rto-tabs {
        flex-wrap: wrap;
    }

    .hb-rto-tab {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
    }
}

