/* =============================================================
   HPL Search Widgets
   hpl-widget-box  = vertical card
   hpl-widget-bar  = horizontal bar
   ============================================================= */

.hpl-widget,
.hpl-widget * {
    box-sizing: border-box;
}

/* ── Shared reset ─────────────────────────────────────────── */
.hpl-widget input,
.hpl-widget select,
.hpl-widget button {
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

/* =============================================================
   VERTICAL BOX  [hpl_search_box]
   ============================================================= */

.hpl-widget-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 22px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    width: 100%;
}

.hpl-wbox-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #111 !important;
    margin: 0 0 20px !important;
    line-height: 1.25 !important;
}

.hpl-wbox-field {
    margin-bottom: 12px;
}

.hpl-wbox-field--half {
    flex: 1;
    margin-bottom: 0;
}

.hpl-wbox-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.hpl-wbox-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
}

.hpl-wbox-input,
.hpl-wbox-select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    color: #222;
    background: #fff;
    font-size: 15px;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.hpl-wbox-input:focus,
.hpl-wbox-select:focus {
    border-color: #8B1A1A;
}

.hpl-wbox-input::placeholder { color: #bbb; }

.hpl-wbox-select-wrap {
    position: relative;
}

.hpl-wbox-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #aaa;
    pointer-events: none;
}

.hpl-wbox-submit {
    display: block;
    width: 100%;
    padding: 14px;
    background: #8B1A1A;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.02em;
    margin-top: 4px;
    transition: background 0.15s;
}

.hpl-wbox-submit:hover { background: #a82020; }

.hpl-wbox-sell {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    color: #555;
    text-decoration: underline;
}

.hpl-wbox-sell:hover { color: #8B1A1A; }

/* =============================================================
   HORIZONTAL BAR  [hpl_search_bar]
   ============================================================= */

.hpl-widget-bar {
    width: 100%;
}

.hpl-wbar-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hpl-wbar-inner {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.hpl-wbar-segment {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 16px;
    flex: 1;
    min-width: 0;
}

.hpl-wbar-segment--cat    { flex: 1.4; }
.hpl-wbar-segment--kw     { flex: 2; }
.hpl-wbar-segment--zip    { flex: 1; }
.hpl-wbar-segment--radius { flex: 1; }

.hpl-wbar-divider {
    width: 1px;
    background: #e8e8e8;
    margin: 8px 0;
    flex-shrink: 0;
}

.hpl-wbar-label {
    font-size: 10px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 2px;
    white-space: nowrap;
}

.hpl-wbar-input,
.hpl-wbar-select {
    background: transparent;
    border: none;
    color: #222;
    font-size: 14px;
    padding: 0;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

.hpl-wbar-input::placeholder { color: #bbb; }

.hpl-wbar-submit {
    background: #8B1A1A;
    color: #fff;
    border: none;
    padding: 0 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    transition: background 0.15s;
    white-space: nowrap;
}

.hpl-wbar-submit:hover { background: #a82020; }

.hpl-wbar-sell-wrap {
    text-align: right;
}

.hpl-wbar-sell {
    font-size: 13px;
    color: #555;
    text-decoration: underline;
}

.hpl-wbar-sell:hover { color: #8B1A1A; }

/* ── Responsive: bar collapses to vertical on mobile ──────── */
@media (max-width: 700px) {
    .hpl-wbar-inner {
        flex-direction: column;
        border-radius: 8px;
    }
    .hpl-wbar-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }
    .hpl-wbar-segment {
        padding: 10px 14px;
    }
    .hpl-wbar-submit {
        padding: 14px;
        width: 100%;
        font-size: 16px;
    }
    .hpl-wbar-sell-wrap {
        text-align: center;
    }
}

/* =============================================================
   LISTINGS SHELF WIDGET  [hpl_listings_widget]
   Also used by "More Like This" on single listing pages
   Horizontal scroll row — compact cards, no wrapping
   ============================================================= */

.hpl-lw-wrap {
    width: 100%;
}

.hpl-lw-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.hpl-lw-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #222 !important;
    margin: 0 !important;
}

.hpl-lw-view-all {
    font-size: 13px;
    color: #8B1A1A;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    flex-shrink: 0;
}

.hpl-lw-view-all:hover { text-decoration: underline; color: #8B1A1A; }

/* ── Scrollable shelf ─────────────────────────────────────── */
.hpl-lw-shelf-wrap {
    position: relative;
}

.hpl-lw-shelf {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar on desktop — arrows handle navigation */
@media (hover: hover) {
    .hpl-lw-shelf { scrollbar-width: none; }
    .hpl-lw-shelf::-webkit-scrollbar { display: none; }
}

/* ── Arrow buttons (desktop only) ────────────────────────── */
.hpl-lw-arrow {
    display: none; /* shown via JS once scroll is needed */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    padding: 0;
    color: #333;
}

.hpl-lw-arrow svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.hpl-lw-arrow:hover {
    background: #8B1A1A;
    border-color: #8B1A1A;
    color: #fff;
}

.hpl-lw-arrow--prev { left: -18px; }
.hpl-lw-arrow--next { right: -18px; }

.hpl-lw-arrow.hpl-arrow-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Only show arrows on devices with a mouse */
@media (hover: hover) {
    .hpl-lw-arrow { display: flex; }
}

/* On touch devices keep the thin scrollbar instead */
@media (hover: none) {
    .hpl-lw-shelf { scrollbar-width: thin; scrollbar-color: #ccc #f0f0f0; }
    .hpl-lw-shelf::-webkit-scrollbar { display: block; height: 4px; }
    .hpl-lw-shelf::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 2px; }
    .hpl-lw-shelf::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
}

/* ── Card ─────────────────────────────────────────────────── */
.hpl-lw-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 160px;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #222;
    scroll-snap-align: start;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.hpl-lw-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.10);
    border-color: #8B1A1A;
    color: #222;
}

.hpl-lw-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f5f5f5;
    overflow: hidden;
    flex-shrink: 0;
}

.hpl-lw-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpl-lw-card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 12px;
}

.hpl-lw-featured-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: #b08700;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.03em;
}

.hpl-lw-card-body {
    padding: 9px 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hpl-lw-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #1a7f37;
}

.hpl-lw-contact {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
    font-weight: 400;
}

.hpl-lw-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hpl-lw-card-vehicle,
.hpl-lw-card-location {
    font-size: 11px;
    color: #aaa;
}

/* ── Semi-transparent modifier (transparent="1") ────────────── */

.hpl-widget--glass.hpl-widget-box {
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.hpl-widget--glass .hpl-wbox-input,
.hpl-widget--glass .hpl-wbox-select {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

.hpl-widget--glass .hpl-wbox-label {
    color: #333 !important;
}

.hpl-widget--glass.hpl-widget-bar .hpl-wbar-inner {
    background: rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.hpl-widget--glass .hpl-wbar-label {
    color: #333 !important;
}

.hpl-widget--glass .hpl-wbar-divider {
    background: rgba(0, 0, 0, 0.1) !important;
}
