/* ============================================================
   Triprex Search Results Page
   ============================================================ */

/* Reset theme max-width on results page AND destination full page */
body.triprex-results-body .site-main,
body.triprex-results-body main,
body.single-destination .site-main,
body.single-destination main {
    max-width: 100% !important;
    padding: 0 !important;
}

/* ── Hero bar ── */
.triprex-results-hero {
    background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%);
    padding: 60px 0 40px;
    text-align: center;
    color: #fff;
}
.triprex-results-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.triprex-results-desc {
    font-size: 1rem;
    color: rgba(255,255,255,.75);
    max-width: 680px;
    margin: 0 auto;
}

/* ── Filter/count bar ── */
.triprex-results-bar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.triprex-results-bar-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.triprex-type-tabs {
    display: flex;
    gap: 8px;
}
.triprex-tab-btn {
    padding: 8px 22px;
    border-radius: 50px;
    border: 2px solid #e0e0e0;
    background: transparent;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.triprex-tab-btn.active,
.triprex-tab-btn:hover {
    background: #F56E28;
    border-color: #F56E28;
    color: #fff;
}
.triprex-results-count {
    font-size: 14px;
    color: #666;
    margin-left: auto;
}
.triprex-results-count strong { color: #333; }

/* ── Split layout ── */
.triprex-results-layout {
    display: flex;
    height: calc(100vh - 160px);
    min-height: 600px;
}

/* Left grid column */
.triprex-results-grid-col {
    width: 55%;
    overflow-y: auto;
    padding: 24px;
    background: #f8f8f8;
}
.triprex-results-grid-col::-webkit-scrollbar { width: 4px; }
.triprex-results-grid-col::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.triprex-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
@media (max-width: 1200px) {
    .triprex-results-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .triprex-results-layout { flex-direction: column; height: auto; }
    .triprex-results-map-col { display: none !important; }
    .triprex-results-grid-col { width: 100% !important; }
    .triprex-results-grid { grid-template-columns: 1fr; }
    #triprex-dest-map-col { display: none !important; }
    #triprex-dest-grid-col { width: 100% !important; }
    #triprex-dest-grid { grid-template-columns: 1fr; }
    .triprex-dest-split-body { flex-direction: column; height: auto; }
}

/* ── Card ── */
.triprex-result-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    transition: box-shadow .25s, transform .25s;
    cursor: pointer;
    position: relative;
}
.triprex-result-card:hover,
.triprex-result-card.triprex-card-active {
    box-shadow: 0 6px 24px rgba(245,110,40,.18);
    transform: translateY(-3px);
}
.triprex-result-card.triprex-card-active { outline: 2px solid #F56E28; }

.triprex-card-img-wrap {
    display: block;
    position: relative;
    height: 190px;
    overflow: hidden;
}
.triprex-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.triprex-result-card:hover .triprex-card-img-wrap img { transform: scale(1.05); }
.triprex-card-no-img { width: 100%; height: 100%; background: #e8e8e8; }

.triprex-card-body { padding: 14px 16px 16px; }
.triprex-card-title { font-size: 15px; font-weight: 700; margin: 0 0 6px; line-height: 1.35; }
.triprex-card-title a { color: inherit; text-decoration: none; }
.triprex-card-title a:hover { color: #F56E28; }
.triprex-card-location { font-size: 12px; color: #888; margin: 0 0 4px; display: flex; align-items: center; gap: 4px; }
.triprex-card-location svg { flex-shrink: 0; color: #F56E28; }
.triprex-card-duration { font-size: 12px; color: #aaa; margin: 0 0 10px; }
.triprex-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.triprex-card-price { font-size: 15px; font-weight: 700; color: #F56E28; }
.triprex-card-price del { color: #aaa; font-size: 12px; margin-right: 4px; }
.triprex-no-results-msg { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #999; }

/* ── Map column ── */
.triprex-results-map-col { width: 45%; position: sticky; top: 0; height: calc(100vh - 160px); }
#triprex-results-map { width: 100%; height: 100%; }

/* ── Single pin popup ── */
.triprex-map-popup { width: 220px; }
.triprex-map-popup img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px 8px 0 0; display: block; }
.triprex-map-popup-body { padding: 10px 12px 12px; }
.triprex-map-popup h4 { font-size: 13px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.triprex-map-popup h4 a { color: #222; text-decoration: none; }
.triprex-map-popup h4 a:hover { color: #F56E28; }
.triprex-map-popup-price { font-size: 13px; font-weight: 700; color: #F56E28; margin-bottom: 8px; }
.triprex-map-popup-btn {
    display: block; text-align: center; background: #F56E28; color: #fff;
    font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 6px;
    text-decoration: none; transition: background .2s;
}
.triprex-map-popup-btn:hover { background: #d9551a; color: #fff; }

/* ── Card type badge ── */
.triprex-card-type-badge {
    position: absolute; top: 10px; right: 10px;
    font-size: 11px; font-weight: 700; padding: 3px 10px;
    border-radius: 20px; z-index: 2; backdrop-filter: blur(4px);
    display: inline-flex; align-items: center; gap: 3px;
}
.triprex-card-type-badge.tour  { background: rgba(245,110,40,.9);  color: #fff; }
.triprex-card-type-badge.hotel { background: rgba(26,111,196,.9);  color: #fff; }

/* Tab count pill */
.triprex-tab-count {
    display: inline-block; background: rgba(0,0,0,.12);
    border-radius: 20px; padding: 1px 7px; font-size: 11px; margin-left: 4px;
}
.triprex-tab-btn.active .triprex-tab-count { background: rgba(255,255,255,.25); }

/* Map legend */
.triprex-map-legend {
    position: absolute; bottom: 28px; left: 12px;
    background: #fff; border-radius: 8px; padding: 8px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    display: flex; flex-direction: column; gap: 6px;
    z-index: 10; font-size: 12px; font-weight: 600;
}
.triprex-legend-item { display: flex; align-items: center; gap: 8px; color: #333; }
.triprex-legend-pin { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.triprex-legend-pin.tour  { background: #F56E28; }
.triprex-legend-pin.hotel { background: #1a6fc4; }

/* Mapbox overrides */
.mapboxgl-popup-content {
    padding: 0 !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.15) !important;
}
.mapboxgl-popup-close-button { color: #fff; font-size: 16px; right: 6px; top: 4px; z-index: 1; }

/* Keep markers from overlapping — raise z-index on hover/active */
.mapboxgl-marker { transition: z-index 0s; }
.mapboxgl-marker:hover { z-index: 9999 !important; }
.triprex-pin-bubble-inner { position: relative; z-index: 1; }

/* Cluster bubbles sit on top of single-pin bubbles */
.triprex-cluster-bubble { z-index: 2 !important; }

/* ============================================================
   CLUSTER POPUP — multiple items at same location
============================================================ */
.triprex-cluster-popup-wrap .mapboxgl-popup-content {
    border-radius: 12px !important;
    overflow: hidden;
    min-width: 280px;
}

.triprex-cluster-popup-header {
    background: #1a1a2e;
    color: #fff;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
}

.triprex-cluster-popup-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.triprex-cluster-popup-list::-webkit-scrollbar { width: 4px; }
.triprex-cluster-popup-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Each item row */
.triprex-cluster-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}
.triprex-cluster-item:last-child { border-bottom: none; }
.triprex-cluster-item:hover { background: #f9f9f9; }

.triprex-cluster-item img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.triprex-cluster-item-no-img {
    width: 54px;
    height: 54px;
    background: #eee;
    border-radius: 8px;
    flex-shrink: 0;
}

.triprex-cluster-item-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.triprex-cluster-item-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: .85;
}
.triprex-cluster-item-type svg { width: 10px; height: 10px; }
.triprex-cluster-item-title {
    font-size: 12px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.triprex-cluster-item:hover .triprex-cluster-item-title { color: #F56E28; }
.triprex-cluster-item-price {
    font-size: 12px;
    font-weight: 800;
    color: #F56E28;
}

/* ============================================================
   DESTINATION PAGE SPLIT LAYOUT
============================================================ */
.triprex-dest-split-wrap { width: 100%; margin-top: 60px; }
.triprex-dest-split-bar {
    background: #fff; border-top: 1px solid #eee; border-bottom: 1px solid #eee;
    padding: 14px 0; position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.triprex-dest-bar-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.triprex-dest-bar-title { font-size: 18px; font-weight: 700; color: #1a1a1a; margin: 0; flex-shrink: 0; }
.triprex-dest-split-body { display: flex; height: calc(100vh - 160px); min-height: 600px; }
#triprex-dest-grid-col { width: 55%; overflow-y: auto; padding: 24px; background: #f8f8f8; }
#triprex-dest-grid-col::-webkit-scrollbar { width: 4px; }
#triprex-dest-grid-col::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
#triprex-dest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
#triprex-dest-map-col { width: 45%; position: sticky; top: 0; height: calc(100vh - 160px); }
#triprex-dest-map { width: 100%; height: 100%; }
