/* Site polish — share, FAB, breadcrumb, grid/list, cart drawer, slider, ripple, typing */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-warm); }
.breadcrumb-sep { opacity: .4; user-select: none; }
.breadcrumb-current { color: var(--text); font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.share-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
}
.share-btn:hover { border-color: var(--border-light); color: var(--text); }
.share-btn.is-copied { border-color: rgba(0,212,170,.4); color: var(--accent); }
.share-btn--wa:hover { border-color: rgba(37,211,102,.35); color: #25d366; }
.share-btn--tg:hover { border-color: rgba(56,189,248,.35); color: #38bdf8; }

.scroll-top-fab {
    position: fixed;
    right: 20px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 140;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(14, 17, 24, 0.92);
    backdrop-filter: blur(12px);
    color: var(--text-warm);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s, visibility .25s;
    box-shadow: var(--shadow);
}
.scroll-top-fab.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top-fab:hover { border-color: rgba(251,146,60,.4); }
.has-mobile-nav .scroll-top-fab { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

.listing-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.view-toggle button {
    padding: 8px 12px;
    border: none;
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}
.view-toggle button.is-active {
    background: rgba(251,146,60,.12);
    color: var(--text-warm);
}

.listing-grid.is-list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.listing-grid.is-list-view .listing-card > a {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0;
}
.listing-grid.is-list-view .listing-card-img { aspect-ratio: 4/3; min-height: 100px; }
@media (max-width: 520px) {
    .listing-grid.is-list-view .listing-card > a { grid-template-columns: 100px 1fr; }
}

.price-slider-wrap {
    grid-column: 1 / -1;
    width: 100%;
    padding: 8px 0 4px;
}
.price-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.price-slider-inputs {
    position: relative;
    height: 28px;
}
.price-slider-inputs input[type="range"] {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}
.price-slider-inputs input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--bg);
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.price-slider-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: var(--border);
    border-radius: 4px;
}
.price-slider-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dim), var(--gold));
    border-radius: 4px;
}

.pull-refresh-indicator {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 160;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    opacity: 0;
    transition: transform .2s, opacity .2s;
    pointer-events: none;
}
.pull-refresh-indicator.is-pulling { opacity: 1; transform: translateX(-50%) translateY(0); }
.pull-refresh-indicator.is-refreshing { opacity: 1; transform: translateX(-50%) translateY(0); }

.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(0,0,0,.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
}
.cart-drawer-overlay.is-open { opacity: 1; visibility: visible; }
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 190;
    width: min(380px, 100vw);
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}
.cart-drawer-overlay.is-open .cart-drawer { transform: translateX(0); }
.cart-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.cart-drawer-head h2 { font-size: 1rem; }
.cart-drawer-close {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
}
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.cart-drawer-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--bg-input);
}
.cart-drawer-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.cart-drawer-item-info { flex: 1; min-width: 0; }
.cart-drawer-item-info strong { display: block; font-size: 13px; margin-bottom: 4px; }
.cart-drawer-item-info span { font-size: 12px; color: var(--gold); }
.cart-drawer-remove {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}
.cart-drawer-foot {
    padding: 16px 18px;
    border-top: 1px solid var(--border);
}
.cart-drawer-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 700;
}
.cart-drawer-empty { text-align: center; padding: 40px 16px; color: var(--text-muted); font-size: 14px; }

.chat-typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 10px;
    font-size: 12px;
    color: var(--text-muted);
}
.chat-typing-indicator.is-visible { display: flex; }
.chat-typing-dots span {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing-dots span:nth-child(2) { animation-delay: .15s; }
.chat-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingDot {
    0%, 60%, 100% { opacity: .35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.btn-ripple-host { position: relative; overflow: hidden; }
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: btnRipple .55s ease-out;
    background: rgba(255,255,255,.28);
    pointer-events: none;
}
@keyframes btnRipple {
    to { transform: scale(4); opacity: 0; }
}

#confettiCanvas {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-top-fab, .cart-drawer, .pull-refresh-indicator { transition: none; }
    .chat-typing-dots span { animation: none; }
    .btn-ripple { animation: none; display: none; }
}
