/* Marketplace, affiliate & Vinblik Value styles.
   Follows the VINBLIK design system: blue chrome (#1a2849), fixed wine-accent
   stripe palette, 14–16px card radii, 999px pills. */

/* ── Explore tabs ─────────────────────────────────────────────── */
.ex-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.ex-tab {
    flex: 0 0 auto;
    border: 1px solid rgba(0,0,0,0.10);
    background: var(--color-card-bg, #fff);
    color: var(--color-muted, #5b6a63);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ex-tab:hover { border-color: rgba(0,0,0,0.2); }
.ex-tab.active {
    background: #1a2849;
    border-color: #1a2849;
    color: #fff;
}

/* ── Marketplace shelves ──────────────────────────────────────── */
.market-shelf { margin-bottom: 1.6rem; }
.market-shelf-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}
.market-shelf-eyebrow {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted, #5b6a63);
    opacity: 0.7;
}
.market-shelf-title {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.1;
    color: var(--color-dark-text, #131a17);
    margin: 0;
}
.market-shelf-head-right { display: flex; align-items: center; gap: 0.5rem; }
.market-shelf-count { font-size: 0.78rem; color: var(--color-muted, #5b6a63); opacity: 0.7; }
.market-info-btn {
    border: 1px solid rgba(26,40,73,0.25);
    background: #e8ecf6;
    color: #1a2849;
    width: 20px; height: 20px;
    border-radius: 50%;
    font-size: 0.7rem; font-weight: 700;
    cursor: pointer; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.market-info-pop {
    background: #e8ecf6;
    border: 1px solid rgba(26,40,73,0.18);
    color: #1c2420;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 0.78rem;
    line-height: 1.45;
    margin-bottom: 0.6rem;
}
.market-shelf-scroll {
    display: flex;
    gap: 0.7rem;
    overflow-x: auto;
    padding: 4px 2px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.market-shelf-scroll::-webkit-scrollbar { height: 6px; }
.market-shelf-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px; }

/* Expandable shelf grid — rows of cards with progressive "View more" reveal */
.market-shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.7rem;
    padding: 4px 2px 2px;
}
/* Card must fill its grid cell (base style has fixed 190px width for scroll context) */
.market-shelf-grid .market-card { width: 100%; }
.market-shelf-more {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-tertiary-button, #f4f6f5);
    border: 1px solid rgba(19,26,23,0.10);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--color-brand, #1a2849);
    cursor: pointer;
    text-align: center;
    transition: background 0.12s, border-color 0.12s;
}
.market-shelf-more:hover {
    background: var(--color-secondary-button, #e8ecf6);
    border-color: rgba(19,26,23,0.18);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}
.market-bycountry-head {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-dark-text, #131a17);
    margin: 0.4rem 0 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(19,26,23,0.08);
}

/* ── Region drill-down: breadcrumb + horizontal country/region pills ──── */
.region-crumbs {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem;
    margin: -0.3rem 0 0.6rem;
}
.region-crumb {
    background: none; border: none; padding: 0;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.78rem; font-weight: 700; cursor: pointer;
    color: var(--color-brand, #1a2849);
    transition: opacity 0.12s;
}
.region-crumb:hover { opacity: 0.7; text-decoration: underline; }
.region-crumb.active { color: var(--color-dark-text, #131a17); cursor: default; }
.region-crumb.active:hover { opacity: 1; text-decoration: none; }
.region-crumb-sep { color: var(--color-muted, #6b736f); opacity: 0.5; font-size: 0.72rem; }

.region-pills {
    display: flex; gap: 0.45rem;
    overflow-x: auto; scrollbar-width: thin;
    padding: 0.1rem 0.1rem 0.7rem;
    margin-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
}
.region-pills::-webkit-scrollbar { height: 6px; }
.region-pills::-webkit-scrollbar-thumb { background: rgba(19,26,23,0.14); border-radius: 999px; }
.region-pill {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--color-tertiary-button, #f4f6f5);
    border: 1px solid rgba(19,26,23,0.10);
    border-radius: 999px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.8rem; font-weight: 600; white-space: nowrap;
    color: var(--color-dark-text, #131a17);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.region-pill:hover {
    background: var(--color-secondary-button, #e8ecf6);
    border-color: rgba(19,26,23,0.20);
    transform: translateY(-1px);
}
.region-pill-count {
    font-size: 0.68rem; font-weight: 700;
    color: var(--color-brand, #1a2849);
    background: rgba(26,40,73,0.08);
    padding: 0.05rem 0.4rem; border-radius: 999px;
}

/* ── Partner shops rail (affiliate stores in the discovery foot) ──────── */
.ps-shelf { margin-top: 1.25rem; }
.ps-shelf-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; margin-bottom: 0.7rem;
}
.ps-shelf-titleblock { display: flex; flex-direction: column; gap: 0.15rem; }
.ps-shelf-eyebrow {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--color-muted, #6b736f); opacity: 0.7;
}
.ps-shelf-title {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.45rem; font-weight: 500; line-height: 1.1;
    color: var(--color-dark-text, #131a17);
}
.ps-shelf-count { font-size: 0.78rem; color: var(--color-muted, #6b736f); opacity: 0.7; white-space: nowrap; }
.ps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.7rem;
    padding: 4px 2px 12px;
}
.ps-card {
    display: flex; flex-direction: column;
    background: var(--color-card-bg, #fff);
    border: 1px solid rgba(19,26,23,0.08); border-radius: 14px;
    overflow: hidden; cursor: pointer; text-decoration: none; color: inherit;
    transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.ps-card:hover {
    border-color: rgba(19,26,23,0.18);
    box-shadow: 0 4px 18px rgba(19,26,23,0.08);
    transform: translateY(-1px);
}
.ps-head { padding: 14px 14px 10px; display: flex; align-items: center; gap: 10px; color: #fff; }
.ps-avatar {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.32);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1rem; font-weight: 600; flex-shrink: 0;
}
.ps-headmeta { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ps-name {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.05rem; font-weight: 500; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ps-headstats { font-size: 0.7rem; opacity: 0.85; }
.ps-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.ps-topwines { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.ps-wine-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ps-wine-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.1); }
.ps-wine-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.ps-wine-producer {
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--color-muted, #6b736f); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%;
}
.ps-wine-name {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.86rem; color: var(--color-dark-text, #131a17);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ps-price-pill {
    font-size: 0.68rem; font-weight: 700; background: rgba(0,0,0,0.04);
    color: var(--color-dark-text, #131a17); padding: 1px 6px; border-radius: 6px; flex-shrink: 0;
}
.ps-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding-top: 4px; margin-top: auto; }
.ps-signal { font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.06em; }
.ps-signal.linkout  { background: rgba(26,40,73,0.08);  color: #1a2849; border: 1px solid rgba(26,40,73,0.18); }
.ps-signal.wishlist { background: rgba(37,99,235,0.10); color: #1d4ed8; border: 1px solid rgba(37,99,235,0.22); }
.ps-signal.deal     { background: rgba(124,58,237,0.10); color: #6d28d9; border: 1px solid rgba(124,58,237,0.22); }

/* ── Market wine card (marketplace grid + Atlas) ──────────────── */
.market-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--color-card-bg, #fff);
    border: 1px solid rgba(19,26,23,0.09);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.market-card:hover {
    border-color: rgba(19,26,23,0.16);
    box-shadow: 0 10px 24px -14px rgba(26,40,73,0.45);
    transform: translateY(-2px);
}

/* Media: colour-tinted panel holding the bottle/photo, source badge + sale tag */
.market-card-media {
    position: relative;
    height: 150px;
    display: grid;
    place-items: center;
    background: var(--color-secondary-bg, #f4f6f5);
    border-bottom: 1px solid rgba(19,26,23,0.05);
    overflow: hidden;
}
/* Stripe colour is set inline from WineColorHelper.HexAccent — the site's single
   wine-accent source (same helper the wine page / cellar / WineDex / Atlas use). */
.market-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--color-muted); }

.market-bottle { height: 96px; width: auto; display: block; filter: drop-shadow(0 6px 10px rgba(26,40,73,0.12)); }
.market-card-photo { max-height: 130px; max-width: 82%; object-fit: contain; }

.market-src {
    position: absolute; top: 9px; left: 9px;
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
    padding: 3px 8px; border-radius: 999px;
    background: rgba(255,255,255,0.94); color: var(--color-dark-text, #1c2420);
    box-shadow: 0 1px 3px rgba(26,40,73,0.16);
}
.market-src-dot { width: 6px; height: 6px; border-radius: 50%; background: #3f66c9; }
.market-src.friend .market-src-dot    { background: #2f7d5b; }
.market-src.community .market-src-dot { background: #3f66c9; }
.market-src.shop .market-src-dot      { background: #c6863f; }

.market-sale-tag {
    position: absolute; top: 9px; right: 9px;
    font-size: 0.62rem; font-weight: 800;
    background: #b23a2e; color: #fff;
    padding: 3px 7px; border-radius: 6px;
}

.market-card-body { padding: 0.6rem 0.75rem 0.75rem; display: flex; flex-direction: column; gap: 0.14rem; flex: 1; }
.value-pill {
    align-self: flex-start;
    background: #e8ecf6;
    color: #1a2849;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    margin-bottom: 0.2rem;
}
.market-card-badge {
    align-self: flex-start;
    background: #eaf0ea;
    color: #41603f;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    margin-bottom: 0.2rem;
}
.budget-row { display: flex; flex-direction: column; gap: 5px; margin: 0.2rem 0 0.9rem; }
.budget-label { font-size: 0.82rem; font-weight: 700; color: var(--color-primary, #1a2849); }
.budget-slider { width: 100%; max-width: 380px; accent-color: var(--color-primary, #1a2849); cursor: pointer; }

.market-card-producer {
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--color-muted, #5b6a63);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.market-card-name {
    font-family: var(--font-body);
    font-size: 0.9rem; font-weight: 600; line-height: 1.28;
    color: var(--color-dark-text, #1c2420);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.market-card-meta { font-size: 0.68rem; color: var(--color-muted, #5b6a63); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-card-price { display: flex; align-items: baseline; gap: 0.35rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.5rem; }
.market-price-old { font-size: 0.72rem; color: var(--color-muted, #5b6a63); text-decoration: line-through; }
.market-price-new { font-size: 1.02rem; font-weight: 800; color: var(--color-dark-text, #1c2420); font-variant-numeric: tabular-nums; }
.market-price-cur { font-size: 0.66rem; font-weight: 600; color: var(--color-muted, #5b6a63); }
.market-card-sellers { font-size: 0.66rem; color: var(--color-brand, #1a2849); font-weight: 600; margin-top: 0.25rem; }
.market-discount {
    font-size: 0.62rem; font-weight: 700; color: #14532d;
    background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.22);
    border-radius: 999px; padding: 0.05rem 0.4rem; margin-left: auto;
}

/* ── Partner tag (neutral link-out chip, equal prominence) ────── */
.partner-tag {
    display: inline-flex; align-items: center;
    font-size: 0.62rem; font-weight: 600;
    color: var(--color-muted, #5b6a63);
    background: #eef2f0;
    border: 1px solid #e4eae7;
    border-radius: 999px;
    padding: 0.08rem 0.45rem;
    white-space: nowrap;
}

/* ── Wine page: value banner + buy online ─────────────────────── */
.wine-value-banner {
    display: flex; align-items: center; gap: 0.6rem;
    background: #e8ecf6;
    border: 1px solid rgba(26,40,73,0.16);
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    margin: 0.4rem 0 0.6rem;
}
.wine-value-banner .value-pill { font-size: 0.82rem; padding: 0.2rem 0.6rem; margin: 0; }

.buy-online-list { display: flex; flex-direction: column; gap: 0.45rem; }
.buy-online-row {
    display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
    border: 1px solid rgba(19,26,23,0.08);
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    background: var(--color-card-bg, #fff);
}
.buy-online-info { display: flex; align-items: baseline; gap: 0.35rem; flex: 1; min-width: 120px; }
.buy-online-store { font-weight: 700; color: var(--color-dark-text, #131a17); font-size: 0.86rem; }
.buy-online-price { display: flex; align-items: baseline; gap: 0.3rem; }
.buy-online-amount { font-weight: 700; color: var(--color-dark-text, #131a17); }
.buy-online-btn {
    background: #1a2849; color: #f6fbf8;
    border: none; border-radius: 10px;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem; font-weight: 700; cursor: pointer;
    transition: opacity 0.12s;
}
.buy-online-btn:hover { opacity: 0.88; }

/* ── Affiliate store page ─────────────────────────────────────── */
.affiliate-page { padding-bottom: 3rem; }
.affiliate-back {
    display: inline-block;
    font-size: 0.8rem; font-weight: 600;
    color: var(--color-muted, #5b6a63);
    text-decoration: none;
    margin-bottom: 0.6rem;
}
.affiliate-hero {
    border-radius: 16px;
    padding: 1.6rem 1.4rem;
    color: #fff;
    margin-bottom: 1.4rem;
}
.affiliate-hero-inner { display: flex; flex-direction: column; gap: 0.5rem; }
.affiliate-hero-badge {
    align-self: flex-start;
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 999px; padding: 0.15rem 0.55rem;
}
.affiliate-hero-name {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 2rem; font-weight: 600; line-height: 1.05; margin: 0; color: #fff;
}
.affiliate-hero-desc { font-size: 0.9rem; color: rgba(255,255,255,0.86); margin: 0; max-width: 60ch; line-height: 1.5; }
.affiliate-hero-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; color: rgba(255,255,255,0.82); margin-top: 0.3rem; }
.affiliate-visit {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.34);
    color: #fff;
    border-radius: 10px; padding: 0.4rem 0.85rem;
    font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.affiliate-visit:hover { background: rgba(255,255,255,0.26); }

.affiliate-region { margin-bottom: 1.6rem; }
.affiliate-region-title {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.3rem; font-weight: 600; color: var(--color-dark-text, #131a17);
    margin: 0 0 0.7rem;
}
.affiliate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.7rem;
}
.affiliate-card { width: auto; flex: 1 1 auto; }
.affiliate-buy {
    margin-top: 0.5rem;
    width: 100%;
    background: #1a2849; color: #f6fbf8;
    border: none; border-radius: 10px;
    padding: 0.5rem 0.6rem;
    font-size: 0.76rem; font-weight: 700; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.affiliate-buy:hover { opacity: 0.88; }

/* ── Wishlist partner chip ────────────────────────────────────── */
.wl-chip.partner {
    color: #5b6a63;
    background: #eef2f0;
    border: 1px solid #e4eae7;
}

/* ── Merchant inventory importer ──────────────────────────────── */
.inv-summary { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.inv-stat {
    flex: 1; min-width: 90px;
    background: #f4f6f5; border: 1px solid #e4eae7; border-radius: 12px;
    padding: 0.6rem 0.7rem;
    display: flex; flex-direction: column; gap: 0.1rem;
}
.inv-num { font-size: 1.3rem; font-weight: 800; color: #1a2849; line-height: 1; }
.inv-lbl { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #5b6a63; }
.inv-mapping {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem 0.8rem;
    margin: 0.7rem 0;
}
.inv-map-row { display: flex; flex-direction: column; gap: 0.2rem; }
.inv-map-label { font-size: 0.72rem; font-weight: 700; color: #5d4b3f; }
.inv-errors { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.75rem; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════
   Explore v2 — unified peer-to-peer marketplace page
   ═══════════════════════════════════════════════════════════════ */
.mkt-page { padding-top: 0.1rem; position: relative; }

/* ── Producer hero wash — the estate photo fades in behind the top of the results
   when the search matches a producer we hold a licensed photo for. Sits BEHIND all
   content: the wash is z-index 0, every other direct child is lifted to z-index 1.
   (The credit is excluded so it stays readable on top.) ── */
.mkt-page > *:not(.mkt-hero-wash):not(.mkt-hero-credit) { position: relative; z-index: 1; }
.mkt-hero-wash {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 400px;
    z-index: 0;
    pointer-events: none;
    background-size: cover;
    background-position: center 26%;
    opacity: 0;
    animation: mktHeroIn 0.7s ease forwards;
    filter: blur(1px) saturate(1.08);
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 42%, transparent 100%);
            mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 42%, transparent 100%);
}
@keyframes mktHeroIn { from { opacity: 0; } to { opacity: 0.6; } }
.mkt-hero-credit {
    position: absolute;
    top: 3.4rem; right: 0.75rem;
    z-index: 2;
    pointer-events: none;
    font-size: 0.56rem;
    line-height: 1.2;
    color: rgba(28,36,32,0.5);
    background: rgba(247,249,248,0.55);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
}
.mkt-hero-credit-sep { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) {
    .mkt-hero-wash { animation: none; opacity: 0.6; }
}

/* ── Top bar: search + Shop/Friends toggle ── */
.mkt-topbar {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 0.35rem 0 0.9rem;
}
.mkt-search {
    position: relative; flex: 1 1 340px; max-width: 560px;
    display: flex; align-items: center;
}
.mkt-search svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--color-muted); pointer-events: none; }
.mkt-search input {
    width: 100%; height: 42px;
    border: 1px solid rgba(19,26,23,0.12); border-radius: 999px;
    background: var(--color-card-bg, #fff);
    padding: 0 16px 0 42px; font-size: 0.9rem; font-family: var(--font-body);
    color: var(--color-dark-text); outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.mkt-search input::placeholder { color: var(--color-muted); opacity: 0.7; }
.mkt-search input:focus { border-color: var(--color-brand); box-shadow: 0 0 0 3px var(--color-brand-soft); }
.mkt-search-clear {
    position: absolute; right: 12px; border: none; background: transparent;
    color: var(--color-muted); font-size: 0.8rem; cursor: pointer; padding: 4px; line-height: 1;
}
.mkt-views { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.mkt-seg {
    display: inline-flex; background: var(--color-secondary-bg, #f4f6f5);
    border: 1px solid rgba(19,26,23,0.1); border-radius: 999px; padding: 3px;
}
.mkt-seg button {
    border: 0; background: transparent; color: var(--color-muted);
    font-weight: 600; font-size: 0.82rem; font-family: var(--font-body);
    padding: 0.45rem 1rem; border-radius: 999px; cursor: pointer; transition: 0.15s;
}
.mkt-seg button.on { background: var(--color-card-bg, #fff); color: var(--color-dark-text); box-shadow: 0 1px 3px rgba(26,40,73,0.14); }
.mkt-count { font-size: 0.78rem; color: var(--color-muted); white-space: nowrap; }

/* ── Layout: filter rail + main ── */
.mkt-layout { display: grid; grid-template-columns: 232px 1fr; gap: 1.75rem; align-items: start; }
.mkt-rail { position: sticky; top: 0.5rem; display: flex; flex-direction: column; }
.mkt-rail .fgroup { border-top: 1px solid rgba(19,26,23,0.08); padding: 0.85rem 0.1rem 0.35rem; }
.mkt-rail .fgroup:first-child { border-top: 0; padding-top: 0.2rem; }
.mkt-rail h4 { margin: 0 0 0.6rem; font-size: 0.64rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--color-muted); font-weight: 700; }
.fprice { display: flex; align-items: center; gap: 0.5rem; }
.fprice input {
    width: 100%; height: 34px; border: 1px solid rgba(19,26,23,0.12); border-radius: 8px;
    padding: 0 0.6rem; font-size: 0.82rem; font-family: var(--font-body); color: var(--color-dark-text); outline: none;
}
.fprice input:focus { border-color: var(--color-brand); }
.fprice span { color: var(--color-muted); }
.frow { display: flex; align-items: center; gap: 0.55rem; padding: 0.28rem 0; font-size: 0.84rem; color: var(--color-dark-text); cursor: pointer; }
.frow input { accent-color: var(--color-brand); width: 15px; height: 15px; }
.fswatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fsw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(19,26,23,0.14); cursor: pointer; padding: 0; }
.fsw.on { box-shadow: 0 0 0 2px var(--color-brand); }
.ftoggle { display: flex; align-items: center; gap: 0.55rem; font-size: 0.84rem; color: var(--color-dark-text); cursor: pointer; }
.ftoggle input { accent-color: var(--color-brand); width: 15px; height: 15px; }
.fclear {
    margin-top: 0.9rem; border: 1px solid rgba(19,26,23,0.12); background: var(--color-tertiary-button, #f4f6f5);
    color: var(--color-brand); font-weight: 700; font-size: 0.78rem; font-family: var(--font-body);
    border-radius: 8px; padding: 0.5rem; cursor: pointer;
}
.fclear:hover { background: var(--color-secondary-button, #e8ecf6); }

.mkt-main { min-width: 0; }
.mkt-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.mkt-chip {
    border: 1px solid rgba(19,26,23,0.12); background: var(--color-card-bg, #fff); color: var(--color-dark-text);
    font-size: 0.8rem; font-weight: 500; font-family: var(--font-body);
    padding: 0.42rem 0.85rem; border-radius: 999px; cursor: pointer; transition: 0.15s;
}
.mkt-chip:hover { border-color: var(--color-brand); }
.mkt-chip.on { background: var(--color-brand); border-color: var(--color-brand); color: #fff; }

/* ── Wishlist strip ── */
.mkt-wish { background: var(--color-card-bg, #fff); border: 1px solid rgba(19,26,23,0.08); border-radius: 14px; padding: 0.85rem 1rem; margin-bottom: 1.35rem; }
.mkt-wish-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.mkt-wish-head .star { width: 16px; height: 16px; color: #c8a24a; }
.mkt-wish-head b { font-size: 0.85rem; color: var(--color-dark-text); }
.mkt-wish-head span { font-size: 0.75rem; color: var(--color-muted); }
.mkt-wish-head a { margin-left: auto; font-size: 0.78rem; color: var(--color-brand); text-decoration: none; font-weight: 600; }
.mkt-wish-row { display: flex; gap: 0.7rem; overflow-x: auto; padding-bottom: 0.2rem; scrollbar-width: thin; }
.mkt-wmini { flex: 0 0 auto; width: 220px; display: flex; gap: 0.6rem; align-items: center; background: var(--color-secondary-bg, #f4f6f5); border: 1px solid rgba(19,26,23,0.07); border-radius: 10px; padding: 0.5rem; cursor: pointer; transition: 0.14s; }
.mkt-wmini:hover { border-color: rgba(19,26,23,0.16); }
.mkt-wmini-cap { width: 40px; height: 50px; border-radius: 6px; display: grid; place-items: center; flex: none; background: var(--color-card-bg, #fff); }
.mkt-wmini-cap .market-bottle { height: 42px; filter: none; }
.mkt-wmini-info { min-width: 0; display: flex; flex-direction: column; gap: 0.12rem; }
.mkt-wmini-name { font-size: 0.78rem; font-weight: 600; line-height: 1.25; color: var(--color-dark-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-wmini-price { font-size: 0.74rem; color: #2f7d5b; font-weight: 700; }

/* ── Feed states ── */
.mkt-loading { display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: var(--color-muted); font-size: 0.8rem; padding: 1.5rem 0 0.5rem; }
.mkt-spin { width: 16px; height: 16px; border: 2px solid rgba(19,26,23,0.15); border-top-color: var(--color-brand); border-radius: 50%; animation: mkt-spin 0.8s linear infinite; }
@keyframes mkt-spin { to { transform: rotate(360deg); } }
.mkt-sentinel { height: 1px; }
.mkt-empty { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 3rem 1rem; text-align: center; }
.mkt-empty-title { font-size: 0.95rem; font-weight: 700; color: var(--color-dark-text); }
.mkt-results-count { font-size: 0.75rem; color: var(--color-muted); margin-bottom: 0.6rem; }
.mkt-sk-card { height: 246px; border-radius: 14px; background: linear-gradient(90deg, rgba(19,26,23,0.05) 25%, rgba(19,26,23,0.08) 50%, rgba(19,26,23,0.05) 75%); background-size: 200% 100%; animation: mkt-shimmer 1.4s infinite; }
@keyframes mkt-shimmer { to { background-position: -200% 0; } }

/* ── Friends' cellars: per-friend shelves ── */
.mkt-friends { display: flex; flex-direction: column; gap: 1.6rem; }
.mkt-friends-intro { font-size: 0.85rem; color: var(--color-muted); max-width: 62ch; margin: 0.2rem 0 0.3rem; line-height: 1.5; }
.mkt-shelf { display: flex; flex-direction: column; }
.mkt-shelf-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.75rem; }
.mkt-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.85rem; flex: none; }
.mkt-shelf-who { display: flex; flex-direction: column; }
.mkt-shelf-name { font-size: 0.95rem; font-weight: 700; color: var(--color-dark-text); }
.mkt-shelf-sub { font-size: 0.75rem; color: var(--color-muted); }
.mkt-shelf-link { margin-left: auto; font-size: 0.78rem; color: var(--color-brand); text-decoration: none; font-weight: 600; }
.mkt-shelf-row { display: flex; gap: 0.9rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: thin; }
.mkt-shelf-row::-webkit-scrollbar { height: 6px; }
.mkt-shelf-row::-webkit-scrollbar-thumb { background: rgba(19,26,23,0.14); border-radius: 999px; }

/* Friend cellar card (browse, not for sale) */
.fcard { flex: 0 0 auto; width: 184px; display: flex; flex-direction: column; background: var(--color-card-bg, #fff); border: 1px solid rgba(19,26,23,0.09); border-radius: 14px; overflow: hidden; }
.mkt-friends .market-grid .fcard { width: 100%; }
.fcard .market-card-media { height: 120px; }
.fcard .market-bottle { height: 74px; }
.fcard-body { padding: 0.55rem 0.65rem 0.65rem; display: flex; flex-direction: column; gap: 0.12rem; }
.fcard-req {
    margin-top: 0.55rem; width: 100%; height: 32px;
    border: 1px solid var(--color-brand); background: var(--color-card-bg, #fff); color: var(--color-brand);
    font-weight: 700; font-size: 0.78rem; font-family: var(--font-body); border-radius: 8px; cursor: pointer; transition: 0.14s;
}
.fcard-req:hover { background: var(--color-brand); color: #fff; }

/* ── Responsive ── */
@media (max-width: 820px) {
    .mkt-layout { grid-template-columns: 1fr; }
    .mkt-rail {
        position: static; flex-direction: row; flex-wrap: wrap; gap: 0.5rem 1.25rem;
        border: 1px solid rgba(19,26,23,0.08); border-radius: 12px; padding: 0.75rem 1rem;
        background: var(--color-card-bg, #fff); margin-bottom: 1rem;
    }
    .mkt-rail .fgroup { border-top: 0; padding: 0.35rem 0; }
    .mkt-views { margin-left: 0; }
    .mkt-search { order: 3; flex-basis: 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .market-card, .mkt-chip, .mkt-seg button, .fcard-req { transition: none; }
    .mkt-spin, .mkt-sk-card { animation: none; }
}

/* Market section header (Friends selling rail, etc.) */
.mkt-section { margin-bottom: 1.4rem; }
.mkt-section-head { display: flex; flex-direction: column; gap: 0.05rem; margin-bottom: 0.7rem; }
.mkt-section-eyebrow { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-muted); }
.mkt-section-title { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; color: var(--color-dark-text); margin: 0; }
