/* ==========================================================================
   EXPLORE PAGE STYLES
   Extends my-wines.css — only overrides and additions needed for the
   public wine screener (Trading 212 / Kraken-style market browser).
   ========================================================================== */

/* ── Page header ─────────────────────────────────────────────────────────── */
.explore-container {
    padding-top: 24px;
    padding-bottom: 60px;
}

.explore-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.explore-header-left .explore-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
}

.explore-header-left .explore-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.explore-header-right {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    flex-shrink: 0;
}

.explore-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    border-right: 1px solid #dee2e6;
    padding-right: 24px;
}

.explore-stat:last-child {
    border-right: none;
    padding-right: 0;
}

.explore-stat-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.explore-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    line-height: 1;
}

/* ── Prebuilt preset buttons ─────────────────────────────────────────────── */
.explore-presets-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    padding-right: 8px;
    border-right: 1px solid #dee2e6;
    margin-right: 4px;
}

.filter-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;   /* pill shape — screener aesthetic */
    font-size: 14px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.filter-preset-btn:hover {
    background: #f0f4ff;
    border-color: #4472C4;
    color: #4472C4;
}

.filter-preset-btn.active {
    background: #4472C4;
    border-color: #4472C4;
    color: white;
}

.filter-preset-btn i {
    font-size: 12px;
}

/* ── Explore card ────────────────────────────────────────────────────────── */
.explore-card {
    cursor: pointer;
    transition: box-shadow 0.18s ease, transform 0.12s ease;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
}

.explore-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13) !important;
}

/* Header */
.ec-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 14px 10px;
}

.ec-header-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ec-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: #fff;
}

.ec-thumb--empty {
    display: inline-block;
    background: #f0f0f0;
}

.ec-title-wrap {
    min-width: 0;
}

.ec-name {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    line-height: 1.35;
    /* Allow wrapping but cap at 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ec-meta {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Market strip */
.ec-market-strip {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 8px 14px 10px;
    background: #f8f9ff;
    border-top: 1px solid #eef0f8;
    border-bottom: 1px solid #eef0f8;
    gap: 8px;
}

.ec-market-left,
.ec-market-right {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ec-market-right {
    text-align: right;
}

.ec-market-label,
.ec-trade-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    font-weight: 600;
}

.ec-market-value {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    line-height: 1.1;
}

.ec-market-change {
    font-size: 11px;
    font-weight: 600;
    margin-top: 1px;
}
.ec-market-change.profit { color: #4da03e; }
.ec-market-change.loss   { color: #ae4747; }

/* Bid / Offer row */
.ec-bid-offer {
    display: flex;
    gap: 0;
    margin-top: auto;
}

.ec-side {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    width: 50%;
    padding: 10px 8px 8px;
    text-decoration: none !important;
    gap: 4px;
}

.ec-side-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #aaa;
    margin-bottom: 2px;
}

.ec-side-mkt {
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
}
.ec-side-mkt.profit { color: #4da03e; }
.ec-side-mkt.loss   { color: #ae4747; }

.ec-trade-value {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    line-height: 1.1;
}

.ec-trade-date {
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    margin-top: 1px;
}

/* Bid/offer price + qty on one line — full width so 80%/20% split from my-wines.css works */
.ec-side-price-row {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 0;
}
.ec-side-price-row .bid-price,
.ec-side-price-row .offer-price,
.ec-side-price-row .bid-qty,
.ec-side-price-row .offer-qty {
    white-space: nowrap;
}

/* Preserve existing bid/offer price styles from my-wines.css */
.explore-bid-link:hover .bid-price,
.explore-offer-link:hover .offer-price {
    filter: brightness(0.9);
}


/* ── Table row improvements for explore ──────────────────────────────────── */
table#explore_table tbody tr:hover {
    background-color: #f8f9ff;
}

table#explore_table td.bid,
table#explore_table td.offer {
    cursor: pointer;
}

table#explore_table td.bid:hover .bid-price,
table#explore_table td.offer:hover .offer-price {
    filter: brightness(0.88);
}

/* ── "Showing X wines" result count ─────────────────────────────────────── */
#resultCount {
    font-size: 13px;
    color: #888;
    padding: 6px 2px 4px;
}

/* ── No-results state ────────────────────────────────────────────────────── */
.shadow-container {
    background: white;
    border-radius: 12px;
    padding: 60px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

/* ── Save filter dialog (same as my-wines; duplicated here for isolation) ── */
.save-filter-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998;
}

.save-filter-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: min(400px, 90vw);
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    /* needed for absolute-positioned close button inside guest prompt */
    isolation: isolate;
}

.save-filter-dialog h4 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
}

.save-filter-dialog #filterNameInput {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
}

.save-filter-dialog #filterNameInput:focus {
    border-color: #4472C4;
    box-shadow: 0 0 0 3px rgba(68,114,196,0.15);
}

.save-filter-dialog #filterDescInput {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    resize: vertical;
    margin-top: 8px;
    box-sizing: border-box;
    font-family: inherit;
    color: #333;
}

.save-filter-dialog #filterDescInput:focus {
    border-color: #4472C4;
    box-shadow: 0 0 0 3px rgba(68,114,196,0.15);
}

/* Guest save prompt */
.save-filter-dialog--guest {
    text-align: center;
}

.guest-save-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: #f0f4ff;
    border-radius: 50%;
    color: #4472C4;
    font-size: 22px;
    margin: 0 auto 14px;
}

.save-filter-dialog--guest h4 {
    font-size: 17px;
    margin-bottom: 8px;
}

.guest-save-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 4px;
}

.save-filter-guest-cancel {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.save-filter-guest-cancel:hover {
    color: #333;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .explore-header {
        display: none;
    }

    .explore-presets-group {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
    }

    .filter-preset-btn {
        font-size: 12px;
        padding: 6px 11px;
    }
}

@media (max-width: 480px) {
    .explore-card-score {
        font-size: 13px;
        padding: 5px 8px;
    }
}

/* ── v2 additions ── */

/* Status bar — removed, replaced by in-container loading overlay */
.explore-status,
#loadingSpinner,
#loadingSpinnerMobile {
    display: none !important;
}

/* Loading skeleton rows (optional — nice to have while first page loads) */
.skeleton-row td {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: 4px;
    height: 14px;
    color: transparent;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Filter badge (count on dropdown btn) */
.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4472C4;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    margin-left: 4px;
    line-height: 1;
}

/* Add-group button in advanced builder */
.btn-add-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px dashed #aaa;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}
.btn-add-group:hover { border-color: #4472C4; color: #4472C4; }

/* Remove group button */
.btn-remove-group {
    font-size: 12px;
    padding: 3px 8px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #999;
    cursor: pointer;
}
.btn-remove-group:hover { border-color: #ae4747; color: #ae4747; }

/* ── Apply filters — inline hint inside activeFilters bar ────────────────── */
.apply-banner-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #9a7300;
    font-weight: 500;
    white-space: nowrap;
}

.apply-banner-hint i {
    font-size: 12px;
    color: #e6a817;
}

/* Toolbar right side (count + spinner) */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 8px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   RESET BUTTON
   Hidden — reset is handled by tab deselection and clearAllFilters
   in the filter system. The element + JS listener are kept for the
   #emptyStateClear fallback path.
   ═══════════════════════════════════════════════════════════════ */

#resetAllBtn {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING OVERLAY — large centred spinner inside table container
   ═══════════════════════════════════════════════════════════════ */

.explore-card-skeleton {
    pointer-events: none;
}
.explore-card-skeleton .skel-cell {
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 1200px 100%;
    animation: explore-skel-shimmer 1.4s infinite linear;
    will-change: background-position;
}
.explore-card-skeleton .ec-thumb {
    width: 42px;
    height: 42px;
    border-radius: 6px !important;
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%) !important;
    background-size: 1200px 100% !important;
    animation: explore-skel-shimmer 1.4s infinite linear !important;
    will-change: background-position;
}

/* ═══════════════════════════════════════════════════════════════
   SORTABLE COLUMN HEADERS
   ═══════════════════════════════════════════════════════════════ */

#explore_table thead th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s;
}

#explore_table thead th.sortable:hover {
    color: #4472C4 !important;
}

#explore_table thead th .sort-indicator {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 2px;
}

@media (max-width: 768px) {
    .explore-tabs-bar {
        flex-wrap: nowrap !important;
        overflow-x: scroll;
        scrollbar-width: none;
    }
}

/* ── Explore Tabs ─────────────────────────────────────────────────────────── */
.explore-tabs-bar {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 0 0 0 0;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.explore-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: black;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.explore-tab:hover {
    background: #f0f4ff;
    border-color: #4472C4;
    color: #4472C4;
}

.explore-tab.active {
    background: #4472C4;
    border-color: #4472C4;
    border-bottom-color: #4472C4;
    color: white;
    font-weight: 600;
    z-index: 1;
}

.explore-tab i {
    font-size: 11px;
}

.explore-tab-close {
    font-size: 14px;
    line-height: 1;
    color: #999;
    margin-left: 2px;
    padding: 0 2px;
    border-radius: 50%;
}

.explore-tab-close:hover {
    color: #fff;
    background: #d9534f;
}

.explore-tab-panel {
    border-radius: 6px;
    padding: 10px;
    background: white;
}

.explore-tab-panel .filter-quick-bar {
    border: none;
    border-radius: 0;
}

.filter-btn-secondary { 
    background: #eee; 
    border-color: #eee; 
}

.explore-row {
    line-height: normal;
}

#colVisBtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════
   COLUMN VISIBILITY MENU
   (moved from inline JS string — was buildColMenu() in explore-main.js)
   ═══════════════════════════════════════════════════════════════ */

#colVisMenu {
    display: none;
    position: absolute;
    z-index: 999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    min-width: 160px;
    right: 0;
    top: calc(100% + 4px);
}

#colVisMenu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 13px !important;
    white-space: nowrap;
    transition: background 0.12s;
}

#colVisMenu label:hover {
    background: #f0f4ff;
}

#colVisMenu input[type="checkbox"] {
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   GUEST PAYWALL — full-width banner below the 10th result
   ═══════════════════════════════════════════════════════════════ */

#explorePaywall {
    margin-bottom: 16px;
}

.explore-paywall {
    position: relative;
    width: 100%;
    /* In card view this must span all columns */
}

/* Paywall sits after the card/table container, full width naturally */

/* Gradient fade — sits above the banner, no longer needed when banner is above table */
.explore-paywall-fade {
    display: none;
}

/* Banner */
.explore-paywall-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 28px;
    background: linear-gradient(135deg, #1a3a6b 0%, #2e5aac 60%, #4472C4 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(68, 114, 196, 0.25);
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.explore-paywall-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.explore-paywall-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.explore-paywall-text {
    min-width: 0;
}

.explore-paywall-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 3px;
    line-height: 1.3;
}

.explore-paywall-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    line-height: 1.4;
}

.explore-paywall-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.explore-paywall-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.explore-paywall-btn--primary {
    background: #fff;
    color: #2e5aac !important;
    border: 2px solid #fff;
}

.explore-paywall-btn--primary:hover {
    background: #f0f4ff;
    border-color: #f0f4ff;
}

.explore-paywall-btn--secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.85) !important;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.explore-paywall-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff !important;
}

@media (max-width: 640px) {
    .explore-paywall-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 18px;
        gap: 14px;
    }

    .explore-paywall-title { font-size: 15px; }

    .explore-paywall-actions {
        width: 100%;
    }

    .explore-paywall-btn {
        flex: 1;
        justify-content: center;
    }
}
/* ═══════════════════════════════════════════════════════════════
   PRESET HEADER — tab title + description shown above results
   ═══════════════════════════════════════════════════════════════ */

.explore-preset-header {
    padding: 12px 4px 8px;
}

.explore-preset-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0 0 3px;
    line-height: 1.2;
}

.explore-preset-desc {
    font-size: 13px;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   WINE NAME FILTER — searchable checkbox dropdown
   ═══════════════════════════════════════════════════════════════ */

.filter-dropdown--wide .filter-dropdown-content {
    min-width: 280px;
    margin-top: 0px;
    padding: 0px;
}

.filter-wine-name-search-wrap {
    padding: 8px 10px 6px;
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    z-index: 1;
}

.filter-wine-name-search {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
}

.filter-wine-name-search:focus {
    border-color: #4472C4;
}

.filter-wine-name-list {
    padding: 4px 0;
}
/* ═══════════════════════════════════════════════════════════════
   SCORE COLUMN — WA / JA badges
   ═══════════════════════════════════════════════════════════════ */
 
.col-score {
    white-space: nowrap;
    text-align: center !important;
}
 
.score-entry {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 4px;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.score-badge.score-wa { background: #7b2d3e; }
.score-badge.score-ja { background: #4472C4; }

.score-source {
    align-self: center;
    font-size: 9px;
    font-weight: 600;
    color: #999;
}

/* Same active-state treatment as .filter-dropdown-btn.has-filters (my-wines.css,
   loaded before this file) — Price Comparison isn't checkbox-driven so it
   needs its own class, but should look identically "active" when applied. */
.filter-dropdown-btn.has-active-comparison {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR LAYOUT — large screens (≥1100px)
   Left: fixed sidebar with tabs. Right: scrollable content area.
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 1100px) {

    /* The outer page container becomes a flex row */
    .explore-container {
        display: flex;
        align-items: flex-start;
        gap: 0;
        padding-top: 0;
        padding-bottom: 0;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    /* ── Left sidebar ── */
    .explore-sidebar {
        width: 220px;
        min-width: 220px;
        flex-shrink: 0;
        height: 100vh;
        position: sticky;
        top: 0;
        overflow-y: auto;
        overflow-x: hidden;
        background: #fff;
        border-right: 1px solid #e8eaf0;
        padding: 24px 0 40px;
        scrollbar-width: thin;
        scrollbar-color: #ddd transparent;
        z-index: 10;
    }

    .explore-sidebar::-webkit-scrollbar { width: 4px; }
    .explore-sidebar::-webkit-scrollbar-track { background: transparent; }
    .explore-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

    /* ── Tab sections in sidebar ── */
    .explore-tabs-section {
        margin-bottom: 4px;
    }

    .explore-tabs-section-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: none;
        border: none;
        border-radius: 0;
        font-size: 14px;
        font-weight: 600;
        color: #111;
        padding: 10px 18px 6px;
        cursor: pointer;
        text-align: left;
    }
    .explore-tabs-section-label:hover { background: none; color: #111; }

    .explore-section-chevron {
        font-size: 10px;
        color: #aaa;
        transition: transform 0.2s ease;
        flex-shrink: 0;
    }
    .explore-tabs-section.collapsed .explore-section-chevron {
        transform: rotate(180deg);
    }

    .explore-tabs-section-body {
        overflow: hidden;
        max-height: 2000px;
        transition: max-height 0.25s ease;
    }
    .explore-tabs-section.collapsed .explore-tabs-section-body {
        max-height: 0;
    }

    /* Vertical tabs in sidebar */
    .explore-tabs-bar {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 1px !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
        overflow: visible !important;
    }

    .explore-tab {
        width: 100%;
        border-radius: 0 !important;
        border: none !important;
        border-left: 3px solid transparent !important;
        padding: 9px 18px 9px 15px !important;
        font-weight: 500 !important;
        color: #444 !important;
        background: transparent !important;
        justify-content: flex-start !important;
        white-space: nowrap;
        transition: background 0.12s, color 0.12s, border-color 0.12s !important;
        gap: 9px !important;
    }

    .explore-tab:hover {
        background: #f4f6ff !important;
        color: #4472C4 !important;
        border-color: transparent !important;
    }

    .explore-tab.active {
        background: #eef2ff !important;
        color: #4472C4 !important;
        font-weight: 600 !important;
        border-left-color: #4472C4 !important;
        border-radius: 0 !important;
    }

    .explore-tab i {
        width: 16px;
        text-align: center;
        font-size: 12px !important;
        flex-shrink: 0;
    }

    /* The + New List tab gets a slight separator above it */
    .explore-tab-new {
        margin-top: 8px !important;
        border-top: 1px solid #f0f0f0 !important;
        color: #4472C4 !important;
        font-weight: 600 !important;
        padding-top: 12px !important;
    }

    .explore-tab-new:hover {
        background: #f0f4ff !important;
    }

    /* ── Right content area ── */
    .explore-content {
        flex: 1;
        min-width: 0;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 24px 28px 60px;
        scrollbar-width: thin;
        scrollbar-color: #ddd transparent;
    }

    .explore-content::-webkit-scrollbar { width: 6px; }
    .explore-content::-webkit-scrollbar-track { background: transparent; }
    .explore-content::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

    /* Filter bar — sits below search in content area */
    #searchDiv {
        margin-bottom: 12px;
    }

    /* The filter system's inline tab bar is hidden on large screens
       (tabs are in the sidebar instead) */
    .explore-tabs-bar {
        display: none !important;
    }

    /* Inline saved tabs also hidden on desktop — sidebar shows them instead */
    .explore-tab-saved-inline {
        display: none !important;
    }

    /* Column vis and view toggle stay in toolbar */
    #tableDiv {
        overflow-x: auto;
    }

    /* Preset header sits in content area */
    #explorePresetHeader {
        margin-bottom: 0;
    }
}

/* ── Sidebar hidden on small screens; original layout applies ── */
@media (max-width: 1099px) {
    .explore-sidebar { display: none !important; }
    .explore-content { display: contents; }
    .explore-tabs-section-label { display: none; }

    /* Restore horizontal tab bar */
    .explore-tabs-bar {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }
}

/* ── Saved tab action buttons (edit pencil + close ×) ─────────────────────── */
.explore-tab-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}

.explore-tab-edit,
.explore-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    line-height: 1;
    color: #999;
    transition: color 0.12s, background 0.12s;
    cursor: pointer;
}

.explore-tab-edit:hover {
    color: #4472C4;
    background: rgba(68, 114, 196, 0.1);
}

.explore-tab.active .explore-tab-edit:hover {
    color: #fff;
    background: rgba(255,255,255,0.2);
}

/* Sidebar saved tab — edit/close shown on hover only */
@media (min-width: 1100px) {
    .explore-sidebar .explore-tab-saved .explore-tab-actions {
        opacity: 0;
        transition: opacity 0.15s;
        margin-left: auto;
    }

    .explore-sidebar .explore-tab-saved:hover .explore-tab-actions,
    .explore-sidebar .explore-tab-saved.active .explore-tab-actions {
        opacity: 1;
    }

    /* Sidebar saved tab label should not overflow */
    .explore-sidebar .explore-tab-saved .explore-tab-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    .explore-sidebar .explore-tab-saved {
        display: flex;
        align-items: center;
    }
}

/* ── Edit-filters icon (sliders) in saved tab action row ──────────────────── */
.explore-tab-edit-filters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    color: #999;
    transition: color 0.12s, background 0.12s;
    cursor: pointer;
}

.explore-tab-edit-filters:hover {
    color: #4472C4;
    background: rgba(68, 114, 196, 0.1);
}

.explore-tab.active .explore-tab-edit-filters {
    color: rgba(255,255,255,0.7);
}

.explore-tab.active .explore-tab-edit-filters:hover {
    color: #fff;
    background: rgba(255,255,255,0.2);
}

/* Sidebar: show all action icons on hover */
@media (min-width: 1100px) {
    .explore-sidebar .explore-tab-saved .explore-tab-actions {
        opacity: 0;
        transition: opacity 0.15s;
    }
    .explore-sidebar .explore-tab-saved:hover .explore-tab-actions,
    .explore-sidebar .explore-tab-saved.active .explore-tab-actions {
        opacity: 1;
    }
}

/* ── Preset header — saved list action buttons ────────────────────────────── */
.explore-preset-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.explore-preset-header-text {
    min-width: 0;
}

.explore-preset-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.explore-preset-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.explore-preset-action-btn:hover {
    background: #f0f4ff;
    border-color: #4472C4;
    color: #4472C4;
}

.explore-preset-action-btn i {
    font-size: 11px;
}

.explore-preset-action-btn--danger {
    color: #888;
}

.explore-preset-action-btn--danger:hover {
    background: #fff5f5;
    border-color: #d9534f;
    color: #d9534f;
}

@media (max-width: 640px) {
    .explore-preset-actions {
        width: 100%;
    }
    .explore-preset-action-btn {
        flex: 1;
        justify-content: center;
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* ── Filter system notifications — toast style ───────────────────────────── */
.wine-filter-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    pointer-events: none;
    white-space: nowrap;
}

.wine-filter-notification p {
    margin: 0;
    color: #fff;
}

.wine-filter-notification.notice-success { background: #2e7d32; }
.wine-filter-notification.notice-error   { background: #c62828; }
.wine-filter-notification.notice-warning { background: #e65100; }
.wine-filter-notification.notice-info    { background: #1565c0; }
/* ── Sidebar tab emojis ───────────────────────────────────────────────────── */
.explore-tab-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    font-size: 13px;
    line-height: 1;
    margin-right: 1px;
}

.filter-dropdown-content select, .filter-dropdown-content input {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* ── Sticky table header ─────────────────────────────────────────────────── */
#explore_table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    box-shadow: 0 1px 0 #dee2e6;
}

/* ── Skeleton loading rows ───────────────────────────────────────────────── */
@keyframes explore-skel-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.explore-skeleton-row td {
    padding: 10px 8px;
}

.explore-skeleton-row .skel-cell {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 1200px 100%;
    animation: explore-skel-shimmer 1.4s infinite linear;
    will-change: background-position;
    min-width: 30px;
}

/* ── Watchlist star button ───────────────────────────────────────────────── */
.explore-star-btn {
    background: none;
    border: none;
    padding: 0 4px 0 0;
    margin: 0;
    cursor: pointer;
    color: #d0d0d0;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}

.explore-star-btn:hover {
    color: #f59e0b;
    transform: scale(1.2);
}

.explore-star-btn.is-watched {
    color: #f59e0b;
}

/* Star in card header */
.ec-header .explore-star-btn {
    font-size: 16px;
    padding: 0;
    margin-left: 4px;
    align-self: flex-start;
}

/* ── Watchlist sidebar tabs (named, multiple) ────────────────────────────── */
@media (min-width: 1100px) {
    .explore-sidebar .explore-tab-watchlist {
        display: flex;
        align-items: center;
    }
    .explore-sidebar .explore-tab-watchlist .explore-tab-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
    .explore-sidebar .explore-tab-watchlist .explore-tab-actions {
        opacity: 0;
        margin-left: auto;
        flex-shrink: 0;
        transition: opacity 0.15s;
    }
    .explore-sidebar .explore-tab-watchlist:hover .explore-tab-actions,
    .explore-sidebar .explore-tab-watchlist.active .explore-tab-actions {
        opacity: 1;
    }
}

/* ── Watchlist dialog list items (inside .save-filter-dialog) ────────────── */
#watchlistDialogLists {
    margin: 8px 0 4px;
}
.watchlist-dialog-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}
.watchlist-dialog-item:last-of-type { border-bottom: none; }
.watchlist-dialog-item:hover { color: #4472C4; }
.watchlist-dialog-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: #f59e0b;
    flex-shrink: 0;
}
.watchlist-dialog-item-name { font-weight: 500; }
.watchlist-dialog-item-desc { font-size: 12px; color: #888; margin-top: 2px; }

/* ── Toast notification ──────────────────────────────────────────────────── */
.explore-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 11px 22px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 10001;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* ── Keyboard-focused table row ──────────────────────────────────────────── */
.explore-row.keyboard-focus {
    outline: 2px solid #4472C4;
    outline-offset: -2px;
    background-color: #f0f4ff !important;
}

/* ── Live-poll change flash — identical to my-wines.css / my-bids-offers.css ── */
@keyframes rowFlash {
    0%   { background-color: #fff6d6; }
    100% { background-color: transparent; }
}
tr.row-flash, .card.row-flash { animation: rowFlash 1s ease-out; }

/* ── 1yr price range bar (col-range_1y) ───────────────────────────────────── */
.range-bar-cell {
    display: flex;
    flex-direction: column;
    min-width: 110px;
    padding: 4px 6px;
}

.range-bar-track {
    position: relative;
    height: 3px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px 3px 4px;
}

.range-bar-indicator {
    position: absolute;
    top: -12px;
    transform: translateX(-50%);
    font-size: 11px;
    line-height: 1;
    color: #4472C4;
}

.range-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
}