/* ============================================================
   Appraisal / Search Results Page — Apzl Images Style
   Masonry grid, hover overlays, tight gaps, clean toolbar
   ============================================================ */


/* === Page Layout === */

.apzl-results-section {
    padding: 0 var(--margin_left_on_page);
    background-color: #fff;
}
@media (max-width: 600px) {
    .apzl-results-section {
        padding-left: var(--margin_left_on_page_mobile);
        padding-right: var(--margin_left_on_page_mobile);
    }
}


/* === Related Search Tags === */

.apzl-related-searches {
    padding: 16px var(--margin_left_on_page);
    background-color: #fff;
    border-bottom: 1px solid var(--color-border);
}
@media (max-width: 600px) {
    .apzl-related-searches {
        padding-left: var(--margin_left_on_page_mobile);
        padding-right: var(--margin_left_on_page_mobile);
    }
}

.apzl-related-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.apzl-related-inner::-webkit-scrollbar {
    display: none;
}

.apzl-related-tag {
    display: inline-block;
    padding: 6px 16px;
    background-color: var(--color-light-bg);
    border: 1px solid var(--color-border);
    border-radius: 0;
    font-family: var(--font-family-base);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-hover);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.apzl-related-tag:hover {
    background-color: var(--color-text);
    border-color: var(--color-text);
    color: #fff;
    text-decoration: none;
}


/* === Results Toolbar === */

.apzl-results-toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 20px 0 16px;
    gap: 16px;
}
@media (max-width: 600px) {
    .apzl-results-toolbar {
        flex-direction: column;
        gap: 8px;
        padding: 16px 0 12px;
    }
}

.apzl-results-title {
    font-family: var(--font-family-base);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
@media (max-width: 600px) {
    .apzl-results-title {
        font-size: 17px;
    }
}

/* === Masonry Grid — Apzl Style === */

.apzl-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}
.apzl-grid::after {
    --width: 2;
    --height: 1;
    --ratio: calc(var(--width) / var(--height));
    --row-height: 14em;
    content: "";
    flex-basis: calc(var(--ratio) * var(--row-height));
    flex-grow: 1000000;
}

.apzl-grid-item {
    --ratio: calc(var(--width) / var(--height));
    --row-height: 14em;
    flex-basis: calc(var(--ratio) * var(--row-height));
    flex-grow: calc(var(--ratio) * 100);
    position: relative;
    overflow: hidden;
    background-color: var(--color-light-bg);
}

.apzl-grid-link {
    display: block;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}
.apzl-grid-link:hover {
    text-decoration: none;
}

.apzl-grid-img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 14em;
    object-fit: cover;
    transition: opacity 0.3s ease;
    border: none;
    border-radius: 0;
}


/* === Hover Overlay — Apzl Style === */

.apzl-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.0) 0%,
        rgba(0, 0, 0, 0.0) 40%,
        rgba(0, 0, 0, 0.55) 100%
    );
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.apzl-grid-item:hover .apzl-item-overlay {
    opacity: 1;
}

.apzl-item-overlay-top {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 10px 10px 0;
}

.apzl-item-overlay-bottom {
    padding: 0 12px 10px;
}

.apzl-item-price {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--overlay-dark);
    color: #fff;
    font-family: var(--font-family-base);
    font-size: 13px;
    font-weight: 600;
    border-radius: 0;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.apzl-item-lock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.apzl-item-title {
    display: block;
    font-family: var(--font-family-base);
    font-size: 12px;
    font-weight: 400;
    color: #fff;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}


/* === No Results === */

.apzl-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
}
.apzl-no-results svg {
    margin-bottom: 16px;
    color: var(--color-border);
}
.apzl-no-results h3 {
    font-family: var(--font-family-base);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}
.apzl-no-results p {
    font-family: var(--font-family-base);
    font-size: 14px;
    color: var(--color-text-secondary);
    max-width: 400px;
    margin: 0 auto;
}
.apzl-no-results a {
    color: var(--color-link);
    text-decoration: underline;
}


/* === Results Footer === */

.apzl-results-footer {
    padding: 16px 0;
    font-family: var(--font-family-base);
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
}


/* === SEO Text === */



/* === Pagination Wrapper === */

.apzl-pagination-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0 8px;
}


/* === Search Bar (Sticky) === */

.apzl-search-bar {
    background-color: #fff;
    padding: 12px var(--margin_left_on_page);
    border-bottom: 1px solid var(--color-border);
}
@media (max-width: 600px) {
    .apzl-search-bar {
        padding-left: var(--margin_left_on_page_mobile);
        padding-right: var(--margin_left_on_page_mobile);
    }
}

.apzl-search-bar-fixed {
    background: #fff;
    display: inline-block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 12;
    padding: 10px 32px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 8px var(--shadow-xs);
}


/* === Legacy form styles (sticky search bar) === */

form#basicSrchFrm input.sch {
    font-size: 1rem;
    height: 52px;
    border: 1px solid var(--color-border);
    margin: 0 0 0 -1px;
    border-radius: 0;
    padding: 0 20px;
    font-family: var(--font-family-base);
}
.img-search-btn {
    margin-left: -1px;
    border: 1px solid var(--color-border);
    border-radius: 0;
    border-left: 1px solid var(--color-border);
    background-color: #fff;
    padding: 2px 12px 2px 4px;
}
.img-search-btn i {
    color: var(--color-accent);
    padding: 0 0 0 10px;
}
form#basicSrchFrm .search-btn {
    margin-left: -1px;
    border: 1px solid var(--color-border);
    border-radius: 0;
    border-left: 1px solid var(--color-border);
    background-color: #fff;
    padding: 2px 12px 2px 4px;
}
form#basicSrchFrm .search-btn i {
    color: var(--color-accent);
    padding: 0 0 0 10px;
}


/* === Responsive Grid === */

@media (max-width: 768px) {
    .apzl-grid {
        gap: 1px;
    }
    .apzl-grid-item {
        --row-height: 10em;
    }
    .apzl-grid::after {
        --row-height: 10em;
    }
    .apzl-grid-img {
        max-height: 10em;
    }
    .apzl-item-overlay {
        opacity: 1;
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.0) 0%,
            rgba(0, 0, 0, 0.0) 50%,
            rgba(0, 0, 0, 0.45) 100%
        );
    }
    .apzl-item-overlay-bottom {
        padding: 0 8px 6px;
    }
    .apzl-item-title {
        font-size: 11px;
    }
    .apzl-item-price {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .apzl-grid-item {
        --row-height: 8em;
    }
    .apzl-grid::after {
        --row-height: 8em;
    }
    .apzl-grid-img {
        max-height: 8em;
    }
}


/* === Legacy Section Styles (for valuables, demo, valuation pages) === */

section.filter-bar,
section.suggested-carousel,
section.search-results {
    padding: 0 var(--margin_left_on_page);
    background-color: #fff;
}
@media (max-width: 600px) {
    section.filter-bar,
    section.suggested-carousel,
    section.search-results {
        padding-left: var(--margin_left_on_page_mobile);
        padding-right: var(--margin_left_on_page_mobile);
    }
}


/* === Legacy Class Aliases (for valuation page etc.) === */

.gallery-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}
.gallery-items-container::after {
    --width: 2;
    --height: 1;
    --ratio: calc(var(--width) / var(--height));
    --row-height: 14em;
    content: "";
    flex-basis: calc(var(--ratio) * var(--row-height));
    flex-grow: 1000000;
}
.antique-item {
    --ratio: calc(var(--width) / var(--height));
    --row-height: 14em;
    flex-basis: calc(var(--ratio) * var(--row-height));
    flex-grow: calc(var(--ratio) * 100);
    position: relative;
    overflow: hidden;
    background-color: var(--color-light-bg);
}
.antique-item a {
    cursor: pointer;
}
.antique-item img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 14em;
    object-fit: cover;
    border: none;
    border-radius: 0;
}
.f99nDs22XTHDErPs {
    position: absolute;
    display: flex;
    bottom: 10px;
    width: 100%;
    justify-content: center;
}
.item-overlay-label {
    color: white;
    justify-content: center;
    background-color: var(--overlay-dark);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 0;
    font-size: 13px;
    font-family: var(--font-family-base);
}
.item-meta-text {
    padding: 16px 0;
    font-family: var(--font-family-base);
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
}


/* === Legacy suggested words & headline (valuation page) === */

.suggested-words {
    margin: 0;
    width: 100%;
    padding-top: 10px;
}
.suggested-words li {
    display: inline-block;
    margin-right: 4px;
}
.suggested-words a {
    border: 1px solid var(--color-border);
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 0;
    background-color: var(--color-light-bg);
    text-decoration: none;
    line-height: 2.5em;
    white-space: nowrap;
    color: var(--color-text-hover);
    font-family: var(--font-family-base);
    transition: all 0.15s ease;
}
.suggested-words a:hover {
    background-color: var(--color-text);
    border-color: var(--color-text);
    color: #fff;
}
.item-inline-muted {
    font-size: 1em;
    display: inline;
    color: var(--color-text-muted);
}
.section-heading-lg {
    padding: 0;
    font-size: 1.4em;
    line-height: normal;
}
.section-subtitle {
    padding: 0;
    font-size: 1em;
    font-weight: normal;
}
.section-desc-muted {
    font-size: 0.8em;
    font-family: var(--font-family-base);
    color: var(--color-text-muted);
}
.caption-search-result {
    padding: 10px 0;
}


/* === General resets for this page === */

ol, ul {
    list-style-type: none;
    padding: 0;
}
a:focus {
    color: var(--color-link);
    text-decoration: underline;
}

/* ============================================================
   Favorites Heart Button — top-left, distinct from price badge
   ============================================================ */
.apzl-fav-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
    background: rgba(0,0,0,0.45);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    transition: color 0.2s, background 0.2s, transform 0.15s;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.apzl-grid-item:hover .apzl-fav-btn,
.apzl-fav-btn.active {
    opacity: 1;
    pointer-events: auto;
}
.apzl-fav-btn:hover {
    background: rgba(0,0,0,0.65);
    transform: scale(1.15);
    color: #fff;
}
.apzl-fav-btn.active {
    color: #e74c3c;
    background: rgba(0,0,0,0.55);
}
.apzl-fav-btn:not(.active):hover {
    color: #e74c3c;
}

/* Favorites page — always show heart */
.fav-grid-item .apzl-fav-btn {
    opacity: 1;
    pointer-events: auto;
}


/* ============================================================
   Price Database & Appraisal Pages — Mobile Responsive
   ============================================================ */

/* --- Page overflow fix --- */
.value-based-search-page {
    overflow-x: hidden;
    width: 100%;
}

@media (max-width: 768px) {
    /* Kill ALL horizontal overflow sources */
    .value-based-search-page,
    .value-based-search-page > .container,
    .value-based-search-page .row,
    .value-based-search-page .search-hero,
    .value-based-search-page .search-hero .container {
        overflow-x: hidden;
        max-width: 100% !important;
    }

    /* Fix Bootstrap row negative margins */
    .value-based-search-page .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .value-based-search-page .row > [class*="col"] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    /* Fix nested container (container inside container) */
    .value-based-search-page .search-hero .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100% !important;
    }

    /* Outer container */
    .value-based-search-page > .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Hero section */
    .value-based-search-page {
        padding-top: 1.5rem;
        padding-bottom: 0;
    }

    /* Search hero heading */
    .search-hero h1,
    .search-hero .display-5 {
        font-size: 1.4rem !important;
        margin-bottom: 0.75rem !important;
    }
    .search-hero .lead {
        font-size: 0.85rem;
        margin-bottom: 1rem !important;
    }
    .search-hero .bi-search {
        display: none;
    }

    /* Search bar inside hero */
    .search-hero .apzl-search-bar {
        padding: 0;
        border: none;
    }

    /* Trending tags overflow */
    .search-hero .mt-4 {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 4px;
    }

    /* Filter panel */
    .apzl-filter-panel--dark {
        padding: 12px;
    }
    .apzl-filter-groups {
        flex-direction: column;
        gap: 12px;
    }
    .apzl-filter-pair {
        flex-direction: row;
        gap: 8px;
    }
    .apzl-filter-actions {
        flex-direction: column;
        gap: 8px;
    }
    .apzl-filter-btn {
        width: 100%;
    }

    /* Category cards grid */
    .value-based-search-page .row.g-3 {
        gap: 0 !important;
    }

    /* Featured collection hero cards */
    .fc-hero-card {
        height: 140px;
        border-radius: 8px;
        overflow: hidden;
    }
    .fc-hero-img {
        height: 100%;
        object-fit: cover;
    }
    .fc-hero-title {
        font-size: 0.95rem;
    }
    .fc-hero-subtitle {
        font-size: 0.7rem;
    }

    /* Results section padding */
    .apzl-results-section {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Related searches */
    .apzl-related-searches {
        padding-left: 8px;
        padding-right: 8px;
    }
    .apzl-related-tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* Search bar fixed mode */
    .apzl-search-bar-fixed {
        padding: 8px 8px;
    }
}

@media (max-width: 480px) {
    .search-hero h1,
    .search-hero .display-5 {
        font-size: 1.15rem !important;
    }
    .search-hero .lead {
        font-size: 0.78rem;
    }

    /* Category browse section */
    .value-based-search-page h2 {
        font-size: 1.2rem;
    }
    .value-based-search-page h5 {
        font-size: 0.9rem;
    }
    .value-based-search-page .mb-5 {
        margin-bottom: 1.5rem !important;
    }

    /* Subscribe CTA inside page */
    .value-based-search-page .btn-lg {
        font-size: 0.85rem;
        padding: 10px 20px;
    }

    /* Featured cards smaller */
    .fc-hero-card {
        height: 120px;
    }
    .fc-hero-title {
        font-size: 0.85rem;
    }
}
