@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ==========================================================================
   ROOT — Wallapop-inspired light theme with our brand
   ========================================================================== */
:root {
    --bg: #ffffff;
    --bg-soft: #fafafa;
    --bg-tint: #f5f5f7;
    --bg-card: #ffffff;
    --border: #e8e8ec;
    --border-strong: #d6d6dd;
    --text: #1a1a1a;
    --text-2: #565666;
    --text-muted: #8b8b95;

    --primary: #13c1ac;          /* Wallapop teal/green */
    --primary-strong: #0fa994;
    --primary-soft: #e6f9f5;
    --warning: #f5b800;           /* stars */
    --danger: #e53935;
    --info: #2196f3;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 999px;

    --shadow-sm: 0 1px 2px rgba(20, 21, 26, 0.05);
    --shadow-md: 0 4px 12px rgba(20, 21, 26, 0.08);
    --shadow-lg: 0 14px 38px rgba(20, 21, 26, 0.12);

    --t-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --t-norm: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --container: 1180px;
    --nav-h: 56px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-font-smoothing: antialiased; font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-soft);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-strong); }
button { font-family: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }

input, textarea, select {
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 14px;
    width: 100%;
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder { color: var(--text-muted); }

/* ==========================================================================
   TOPBAR — like Wallapop's: logo + centered search + right links
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
}
.topbar-inner {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.brand-name {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
}
.brand-accent { color: var(--primary); }

/* Search bar */
.search {
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}
.search input {
    background: var(--bg-tint);
    border: 1px solid transparent;
    border-radius: var(--r-full);
    padding: 9px 16px 9px 40px;
    font-size: 14px;
    height: 40px;
    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.search input:focus {
    background: var(--bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.topnav a, .topnav .topnav-btn {
    color: var(--text-2);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: var(--r-md);
    transition: color var(--t-fast), background var(--t-fast);
}
.topnav a:hover, .topnav .topnav-btn:hover { color: var(--text); background: var(--bg-tint); }

@media (max-width: 720px) {
    .topnav a:not(.btn) span { display: none; }
    .brand-name { display: none; }
    .topbar { padding: 0 12px; }
    .topbar-inner { gap: 8px; }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--r-full);
    font-weight: 700;
    font-size: 14px;
    border: 1px solid transparent;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
    text-align: center;
    color: var(--text);
    line-height: 1;
}
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-strong); color: #fff; }
.btn-ghost {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-tint); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }

/* ==========================================================================
   CONTAINER
   ========================================================================== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 24px 20px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 56px 24px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--r-lg);
}

/* ==========================================================================
   SELLER HEADER (single profile spotlight, like the screenshot)
   ========================================================================== */
.seller-spotlight {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.seller-spotlight-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 32px 20px 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: start;
}
.seller-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tint);
}
.seller-avatar-lg-fb {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #13c1ac, #0fa994);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 36px;
}
.seller-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.seller-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.seller-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
}
.seller-rating .stars { color: var(--warning); font-size: 16px; line-height: 1; letter-spacing: 1px; }
.seller-rating .count { color: var(--text-muted); font-weight: 500; }
.seller-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-2);
    font-size: 13px;
}
.seller-stats .stat { display: inline-flex; align-items: center; gap: 5px; }
.seller-stats .stat svg { color: var(--text-muted); }
.seller-cta { margin-left: auto; flex-shrink: 0; }
.seller-cta a { white-space: nowrap; }

@media (max-width: 720px) {
    .seller-spotlight-inner {
        grid-template-columns: auto 1fr;
        gap: 16px;
        padding: 24px 16px 0;
    }
    .seller-avatar-lg, .seller-avatar-lg-fb { width: 72px; height: 72px; font-size: 28px; }
    .seller-name { font-size: 18px; }
}

/* Tabs */
.tabs {
    max-width: var(--container);
    margin: 24px auto 0;
    padding: 0 20px;
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.tab {
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    transition: color var(--t-fast), border-color var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--text);
    border-bottom-color: var(--primary);
}
.tab .tab-count {
    background: var(--bg-tint);
    color: var(--text-2);
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 700;
}
.tab.active .tab-count {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

@media (max-width: 480px) {
    .tab { padding: 12px 14px; font-size: 13px; }
}

/* ==========================================================================
   MULTI-SELLER FILTER ROW (when more than one seller)
   ========================================================================== */
.sellers-row {
    max-width: var(--container);
    margin: 16px auto 0;
    padding: 0 20px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sellers-row::-webkit-scrollbar { display: none; }
.seller-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: var(--r-full);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.seller-pill:hover { border-color: var(--border-strong); color: var(--text); }
.seller-pill.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.seller-pill img, .seller-pill .pill-fb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.seller-pill .pill-fb {
    background: linear-gradient(135deg, #13c1ac, #0fa994);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}

/* ==========================================================================
   VENTAS TOOLBAR (categories + price + sort)
   ========================================================================== */
.ventas-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 16px 0;
    margin-bottom: 8px;
}
.filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-full);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    white-space: nowrap;
}
.cat-chip:hover { color: var(--text); border-color: var(--border-strong); }
.cat-chip.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}
.cat-chip .chip-count {
    background: var(--bg-tint);
    color: var(--text-muted);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: var(--r-full);
    font-weight: 700;
}
.cat-chip.active .chip-count { background: rgba(255,255,255,0.2); color: #fff; }

.sort-and-price {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}
.price-range, .sort-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-2);
}
.price-range input, .sort-select select {
    border: none;
    padding: 4px 0;
    background: transparent;
    width: auto;
    font-weight: 600;
    color: var(--text);
}
.price-range input { width: 70px; }
.price-range input:focus, .sort-select select:focus { box-shadow: none; }
.price-range, .sort-select { transition: border-color var(--t-fast); }
.price-range:focus-within, .sort-select:focus-within { border-color: var(--primary); }

@media (max-width: 600px) {
    .ventas-toolbar { flex-direction: column; align-items: stretch; }
    .sort-and-price { justify-content: space-between; }
}

/* ==========================================================================
   SEARCH SUGGEST DROPDOWN
   ========================================================================== */
.search { position: relative; }
.search-suggest {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 60;
    max-height: 360px;
    overflow-y: auto;
}
.suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text);
    transition: background var(--t-fast);
}
.suggest-item:hover { background: var(--bg-tint); color: var(--text); }
.suggest-item img {
    width: 44px; height: 44px;
    object-fit: cover;
    border-radius: var(--r-sm);
    background: var(--bg-tint);
    flex-shrink: 0;
}
.suggest-item .s-info {
    display: flex; flex-direction: column;
    min-width: 0; flex: 1;
}
.suggest-item .s-title {
    font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggest-item .s-price {
    font-size: 14px; font-weight: 800;
    color: var(--primary);
}

/* ==========================================================================
   PRODUCTS GRID (Wallapop-like clean cards)
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
@media (min-width: 900px) {
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
}
.product-card {
    background: var(--bg);
    border-radius: var(--r-md);
    overflow: hidden;
    color: var(--text);
    display: flex;
    flex-direction: column;
    transition: transform var(--t-fast), box-shadow var(--t-norm);
    border: 1px solid transparent;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text);
}
.product-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bg-tint);
    overflow: hidden;
    border-radius: var(--r-md);
}
.product-img img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #fff;
    background: var(--text-muted);
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
}
.badge + .badge { top: 36px; }
.badge-nuevo { background: var(--primary); }
.badge-rebajado { background: var(--danger); }
.badge-reservado { background: var(--warning); color: #1a1300; }
.badge-agotado { background: #6b6b7c; }

.product-body {
    padding: 10px 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.product-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.price-old {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: 500;
}
.product-title {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 35px;
    font-weight: 500;
}
.product-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

/* ==========================================================================
   REVIEWS (tab)
   ========================================================================== */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.review-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.review-head { display: flex; align-items: center; gap: 10px; }
.review-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-tint); object-fit: cover; flex-shrink: 0; }
.review-avatar-fb {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #13c1ac, #0fa994); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.review-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.review-from { font-weight: 600; font-size: 14px; color: var(--text); }
.review-stars { color: var(--warning); font-size: 13px; line-height: 1; letter-spacing: 1px; }
.review-text { color: var(--text-2); font-size: 14px; line-height: 1.55; }
.review-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}
.review-foot strong { color: var(--text-2); font-weight: 600; }

/* ==========================================================================
   INFO TAB
   ========================================================================== */
.info-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.info-item h3 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; margin-bottom: 6px; }
.info-item p { color: var(--text); font-size: 15px; }

/* ==========================================================================
   PRODUCT DETAIL PAGE
   ========================================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding-top: 16px;
    padding-bottom: 0;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-2); font-weight: 500; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current {
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 1fr);
    gap: 32px;
    align-items: start;
    margin-top: 12px;
}
@media (max-width: 860px) {
    .product-detail { grid-template-columns: 1fr; }
}

.pd-gallery { position: sticky; top: calc(var(--nav-h) + 16px); }
.pd-main-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.pd-main-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pd-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.pd-thumb {
    aspect-ratio: 1 / 1;
    border: 2px solid transparent;
    border-radius: var(--r-md);
    background: var(--bg);
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    transition: border-color var(--t-fast);
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb:hover { border-color: var(--border-strong); }
.pd-thumb.active { border-color: var(--primary); }

.pd-info { display: flex; flex-direction: column; gap: 18px; }
.pd-price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pd-price {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.02em;
}
.pd-old { font-size: 18px; color: var(--text-muted); text-decoration: line-through; font-weight: 500; }
.pd-discount {
    background: var(--danger);
    color: #fff;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--r-full);
    font-size: 14px;
}
.pd-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    line-height: 1.3;
    margin: 0;
}
.pd-cond {
    display: inline-flex;
    width: max-content;
    background: var(--primary-soft);
    color: var(--primary-strong);
    padding: 4px 12px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.pd-seller {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 12px 14px;
    color: var(--text);
    transition: border-color var(--t-fast), background var(--t-fast);
}
.pd-seller:hover { border-color: var(--border-strong); background: var(--bg-tint); color: var(--text); }
.pd-seller img, .pd-seller-fb {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.pd-seller-fb {
    background: linear-gradient(135deg, #13c1ac, #0fa994);
    color: #fff; font-weight: 700; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
.pd-seller-info { display: flex; flex-direction: column; min-width: 0; }
.pd-seller-info strong { font-size: 14px; font-weight: 700; }
.pd-seller-info small { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.pd-cta { width: 100%; padding: 14px 20px; font-size: 16px; }
.pd-cta-note {
    font-size: 12px; color: var(--text-muted);
    text-align: center; margin-top: -6px;
}

.pd-section { margin-top: 6px; }
.pd-section h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}
.pd-desc {
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}
.pd-share-row { display: flex; gap: 8px; flex-wrap: wrap; }

.related-title {
    font-size: 22px;
    font-weight: 800;
    margin-top: 32px;
    margin-bottom: 16px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    margin-top: 64px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 28px 20px;
    color: var(--text-muted);
    font-size: 13px;
}
.site-footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* ==========================================================================
   LOGIN PAGE (light too — same vibe)
   ========================================================================== */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--bg-soft); }
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.login-card h1 { font-size: 22px; font-weight: 800; margin: 16px 0 4px; }
.login-card .muted { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.brand-center { flex-direction: column; gap: 8px; }
.brand-center .brand-logo { width: 64px; height: 64px; border-radius: 16px; }
.back-link { display: inline-block; margin-top: 18px; color: var(--text-muted); font-size: 13px; }

.alert { padding: 10px 14px; border-radius: var(--r-md); font-size: 13px; margin-bottom: 12px; }
.alert-danger { background: #fee5e5; color: var(--danger); border: 1px solid #fbb; }
.alert-success { background: var(--primary-soft); color: var(--primary-strong); border: 1px solid #a5e5d8; }

/* ==========================================================================
   ADMIN PAGE (kept dark for contrast — it's the back office)
   ========================================================================== */
.admin-page {
    background: #08080c;
    color: #f4f4f7;
}
.admin-page input,
.admin-page textarea,
.admin-page select {
    background: #14141d;
    border-color: rgba(255,255,255,0.1);
    color: #f4f4f7;
}
.admin-page input::placeholder { color: #6b6b7c; }
.admin-page input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(19,193,172,0.2); }

.admin-bar {
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(13, 13, 20, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 10;
}
.admin-bar .brand { color: #f4f4f7; }
.admin-bar .brand:hover { color: #f4f4f7; }
.admin-bar small.muted { color: #6b6b7c; font-weight: 500; margin-left: 6px; }
.admin-actions { display: flex; gap: 8px; }
.admin-page .btn-ghost {
    background: #14141d;
    color: #f4f4f7;
    border-color: rgba(255,255,255,0.08);
}
.admin-page .btn-ghost:hover {
    background: #1a1a25;
    border-color: rgba(255,255,255,0.16);
    color: #f4f4f7;
}
.admin-main {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.admin-card {
    background: rgba(20,20,29,0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-xl);
    padding: 24px;
    backdrop-filter: blur(8px);
}
.card-head h2 { font-size: 18px; font-weight: 700; }
.card-head .muted { color: #6b6b7c; font-size: 13px; margin-top: 4px; }
.add-form { display: flex; gap: 10px; margin-top: 16px; }
.add-form input { flex: 1; }
.form-msg { margin-top: 10px; font-size: 13px; }
.form-msg.ok { color: var(--primary); }
.form-msg.err { color: var(--danger); }
.admin-page .muted { color: #6b6b7c; }
.admin-page .empty-state {
    background: #14141d;
    border-color: rgba(255,255,255,0.08);
    color: #6b6b7c;
}

.profiles-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.profile-row {
    display: flex; align-items: center; gap: 14px;
    background: #14141d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-lg);
    padding: 14px 16px;
}
.profile-row .avatar { width: 44px; height: 44px; border-radius: 50%; background: #0d0d14; object-fit: cover; flex-shrink: 0; }
.profile-row .avatar-fb {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #13c1ac, #0fa994); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.profile-row .info { flex: 1; min-width: 0; }
.profile-row .name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-row .meta { font-size: 12px; color: #6b6b7c; margin-top: 2px; }
.profile-row .meta a { color: #a8a8b8; }
.profile-row .actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.toggle-switch {
    position: relative;
    width: 38px;
    height: 22px;
    background: #0d0d14;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: background var(--t-fast);
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #a8a8b8;
    transition: transform var(--t-fast), background var(--t-fast);
}
.toggle-switch.on { background: var(--primary); border-color: transparent; }
.toggle-switch.on::after { transform: translateX(16px); background: #fff; }

.icon-btn {
    width: 34px; height: 34px;
    border-radius: var(--r-md);
    background: #0d0d14;
    border: 1px solid rgba(255,255,255,0.08);
    color: #a8a8b8;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { color: #f4f4f7; border-color: rgba(255,255,255,0.16); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

@media (max-width: 600px) {
    .add-form { flex-direction: column; }
    .profile-row { flex-wrap: wrap; }
}

/* Admin stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.stats-grid .stat {
    background: #14141d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stats-grid .stat strong {
    font-size: 24px;
    font-weight: 800;
    color: #f4f4f7;
    letter-spacing: -0.02em;
}
.stats-grid .stat span {
    font-size: 12px;
    color: #6b6b7c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Admin articles grid */
.admin-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.admin-article-card {
    background: #14141d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color var(--t-fast);
}
.admin-article-card:hover { border-color: rgba(255,255,255,0.18); }
.admin-article-img {
    aspect-ratio: 1 / 1;
    background: #0d0d14;
    position: relative;
    overflow: hidden;
}
.admin-article-img img { width: 100%; height: 100%; object-fit: cover; }
.admin-article-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.admin-article-price {
    font-weight: 800;
    color: var(--primary);
    font-size: 16px;
}
.admin-article-title {
    font-size: 12px;
    color: #a8a8b8;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}
.admin-article-meta {
    font-size: 11px;
    color: #6b6b7c;
    margin-top: 4px;
}
.admin-article-actions {
    display: flex;
    gap: 6px;
    padding: 0 12px 12px;
}
.admin-article-actions .btn {
    flex: 1;
    padding: 7px 10px;
    font-size: 12px;
    border-radius: var(--r-sm);
}
.admin-block-btn {
    background: #2a1a1a;
    color: #ff8a8a;
    border: 1px solid rgba(239,68,68,0.3);
}
.admin-block-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.admin-view-btn {
    background: #1a1a25;
    color: #a8a8b8;
    border: 1px solid rgba(255,255,255,0.1);
}
.admin-view-btn:hover { color: #f4f4f7; border-color: rgba(255,255,255,0.2); }

/* Blacklist list */
.blacklist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}
.blacklist-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #14141d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-size: 13px;
}
.blacklist-row .label { flex: 1; min-width: 0; color: #f4f4f7; word-break: break-word; }
.blacklist-row .meta { color: #6b6b7c; font-size: 11px; }
.blacklist-row .pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 10px;
    font-weight: 700;
    margin-right: 6px;
}
.blacklist-row .pill.url { background: #1a2a4d; color: #7eb8ff; }
.blacklist-row .pill.title { background: #2a1a4d; color: #c79bff; }

@media (max-width: 600px) {
    .admin-articles-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Article flags overlay */
.admin-flags {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}
.admin-flags .flag {
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-full);
    backdrop-filter: blur(8px);
}
.admin-flags .flag-pin { background: rgba(245,184,0,0.9); color: #1a1300; }
.admin-flags .flag-hide { background: rgba(107,107,124,0.9); }
.admin-flags .flag-clicks { background: rgba(229,57,53,0.9); }

.admin-article-card.is-hidden { opacity: 0.5; }
.admin-article-card.is-pinned { box-shadow: 0 0 0 2px var(--warning); }

.admin-article-actions { gap: 4px; padding: 0 8px 10px; }
.admin-article-actions .icon-btn { width: auto; min-width: 30px; padding: 0 6px; flex: 1; }
.icon-btn.on-pin { color: var(--warning); border-color: var(--warning); }
.icon-btn.on-hide { color: #ff8a8a; border-color: rgba(239,68,68,0.4); }

/* Activity (chart + top clicks) */
.activity-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: 16px;
}
@media (max-width: 760px) {
    .activity-grid { grid-template-columns: 1fr; }
}
.activity-h {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b6b7c;
    font-weight: 700;
    margin-bottom: 12px;
}
.activity-chart-wrap, .activity-top-wrap {
    background: #14141d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-md);
    padding: 16px;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(14, 1fr);
    gap: 6px;
    align-items: end;
    height: 160px;
}
.bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    position: relative;
}
.bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--primary), #0fa994);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height var(--t-norm);
}
.bar-num {
    font-size: 10px;
    color: #f4f4f7;
    font-weight: 700;
    position: absolute;
    bottom: 18px;
    line-height: 1;
}
.bar-day {
    font-size: 10px;
    color: #6b6b7c;
}

.top-clicks { display: flex; flex-direction: column; gap: 6px; }
.top-click-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--r-sm);
    color: #f4f4f7;
    background: #0d0d14;
    transition: background var(--t-fast);
}
.top-click-row:hover { background: #1a1a25; color: #f4f4f7; }
.top-click-row .rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800;
    flex-shrink: 0;
}
.top-click-row img {
    width: 36px; height: 36px;
    object-fit: cover;
    border-radius: var(--r-sm);
    flex-shrink: 0;
}
.top-click-row .info {
    display: flex; flex-direction: column;
    flex: 1; min-width: 0;
}
.top-click-row .t {
    font-size: 12px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-click-row .p {
    font-size: 13px; font-weight: 800;
    color: var(--primary);
}
.top-click-row .clicks {
    font-size: 12px; font-weight: 700;
    color: #ff8a8a;
    flex-shrink: 0;
}
