/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --font-ecommerce: "Inter", "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-price: "Inter", "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --primary: #0044FF;
    --primary-light: #0066FF;
    --primary-bg: hsl(232, 100%, 97%);
    --text-dark: #0A1128;
    --text-mid: #333;
    --text-light: #667;
    --text-muted: #999;
    --border: #E0E4EC;
    --bg-white: #FFFFFF;
    --bg-page: #f9f9fb;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --search-bg: hsl(0, 0%, 95%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-ecommerce);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;

    /* Artwork pinned to the top of the page; the page colour takes over
       below it (the image layer is fixed, the gradient scrolls). */
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--bg-page, #fbfcff) 82%),
        url('/assets/backgrounds/index_default.png');
    background-repeat: no-repeat;
    background-position: center top, center top;
    background-size: cover, cover;
    background-attachment: scroll, fixed;
}

/* Dark mode uses the dedicated dark artwork (per-colour-mode backgrounds). */
html[data-theme="dark"] body {
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--bg-page, #10162a) 82%),
        url('/assets/backgrounds/index_dark.png');
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==================== AUTH MODAL ==================== */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.auth-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}
.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 20, 48, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.auth-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(0, 0, 0, 0.02);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}
.auth-modal-overlay.open .auth-modal {
    transform: translateY(0) scale(1);
}
.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #94a3b8);
    transition: background 0.15s ease, color 0.15s ease;
}
.auth-modal-close:hover {
    background: var(--surface-alt, #f1f5f9);
    color: var(--text-dark);
}
.auth-modal h2 {
    font-size: 22px;
    font-weight: 750;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    text-align: center;
}
.auth-modal .auth-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.auth-modal .auth-card.hidden {
    display: none;
}
.auth-modal .google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 650;
    font-family: var(--font-ecommerce);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: -0.01em;
}
.auth-modal .google-btn:hover {
    border-color: var(--border-strong, #cbd5e1);
    background: var(--surface-alt, #f8fafc);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.auth-modal .google-btn:active {
    transform: scale(0.98);
}
.auth-modal .google-btn svg {
    flex-shrink: 0;
}
.auth-modal .auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}
.auth-modal .auth-divider::before,
.auth-modal .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-modal .auth-divider span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #999);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.auth-modal .auth-field {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-mid, #333);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}
.auth-modal .auth-field input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    background: var(--bg-white);
    font-family: var(--font-ecommerce);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: -0.01em;
    box-sizing: border-box;
}
.auth-modal .auth-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 68, 255, 0.1);
}
.auth-modal .auth-field input::placeholder {
    color: var(--text-muted, #999);
}
.auth-modal .auth-submit {
    display: block;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-ecommerce);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 68, 255, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    letter-spacing: -0.01em;
    margin-top: 8px;
}
.auth-modal .auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 68, 255, 0.28);
    background: linear-gradient(180deg, var(--primary, #2b72ff) 0%, var(--primary-dark, #0033cc) 100%);
}
.auth-modal .auth-submit:active {
    transform: scale(0.98);
}
.auth-modal .auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.auth-modal .auth-message {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin: 12px 0 0;
    min-height: 20px;
}
.auth-modal .auth-message.error { color: var(--danger, #dc2626); }
.auth-modal .auth-message.success { color: var(--success, #16a34a); }
.auth-modal .auth-switch {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light, #667);
    text-align: center;
    margin: 20px 0 0;
}
.auth-modal .auth-switch a {
    color: var(--primary);
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}
.auth-modal .auth-switch a:hover {
    color: var(--primary-dark, #0033cc);
    text-decoration: underline;
}
.auth-modal .verification-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.auth-modal .verification-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-mid, #333);
    line-height: 1.6;
    text-align: center;
    margin: 0 0 24px;
}
.auth-modal .verification-text strong {
    color: var(--text-dark);
    font-weight: 650;
}
.auth-modal .verification-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light, #667);
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.5;
}
.auth-modal .verification-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-modal .auth-resend {
    display: block;
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--bg-white);
    color: var(--primary);
    font-size: 15px;
    font-weight: 650;
    font-family: var(--font-ecommerce);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    letter-spacing: -0.01em;
}
.auth-modal .auth-resend:hover {
    border-color: var(--primary);
    background: hsl(232, 100%, 97%);
}
.auth-modal .auth-resend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
body.auth-modal-open {
    overflow: hidden;
}
@media (max-width: 640px) {
    .auth-modal {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .auth-modal h2 {
        font-size: 20px;
    }
}

/* ==================== HERO ==================== */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 10px 32px 180px;
    /* background:
        radial-gradient(1200px 600px at 50% 0%, rgba(19, 88, 255, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-page) 0%, var(--bg-white) 100%); */
}

.hero-title {
    font-size: clamp(36px, 4.5vw, 52px);
    font-weight: 800;
    text-align: center;
    line-height: 1.15;
    color: var(--text-dark);
    margin-bottom: 40px;
    letter-spacing: -0.03em;
}

.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light, #1186fc) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== HERO SEARCH (matches navbar style) ==================== */
.hero-search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 860px;
    width: 100%;
}

.hero-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 860px;
    height: 56px;
    background: var(--bg-white);
    border: 1.5px solid var(--border-strong);
    border-radius: 16px;
    padding: 0 8px 0 18px;
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.02),
        0 10px 28px rgba(15, 23, 42, 0.06),
        0 3px 10px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-search-bar:focus-within {
    border-color: var(--primary);
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.02),
        0 10px 28px rgba(15, 23, 42, 0.08),
        0 0 0 3px rgba(19, 88, 255, 0.1);
}

.hero-search-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--text-muted, #94a3b8);
}

.hero-search-bar input,
.hero-search-bar .tag-input {
    flex: 1 0 auto;
    min-width: 0;
    font-size: 16px;
    line-height: 1;
    font-weight: 500;
    color: var(--text-dark);
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    letter-spacing: -0.01em;
}

.hero-search-bar input::placeholder,
.hero-search-bar .tag-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* ==================== SEARCH TAGS / CHIPS ==================== */
.hero-search-bar {
    flex-wrap: nowrap;
    height: auto;
    min-height: 56px;
    padding: 8px 8px 8px 18px;
    align-items: center;
}

.search-tags-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.search-tags-container::-webkit-scrollbar {
    display: none;
}

.search-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 12px;
    background: var(--primary-bg);
    border: 1px solid var(--primary);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    flex: 0 0 auto;
    line-height: 1.4;
    cursor: default;
    animation: tag-appear 0.15s ease-out;
}

@keyframes tag-appear {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.search-tag .tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: background 0.12s ease;
    flex-shrink: 0;
}

.search-tag .tag-remove:hover {
    background: rgba(0, 68, 255, 0.12);
}

/* The tag input sits inside the scrollable tags container: empty it fills the
   free space; while typing app.js sizes it to its text (never shrinking) so the
   chips and the typed text scroll together as one row. */
.tag-input {
    min-width: 0;
    flex: 1 0 auto;
}

.hero-camera-btn,
.hero-search-btn,
.hero-advanced-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-camera-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-page);
    color: var(--text-mid);
    border: 1px solid var(--border);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.hero-camera-btn:hover {
    border-color: var(--border-strong, #cbd5e1);
    background: var(--surface-alt, #f8fafc);
}

.hero-camera-btn svg {
    width: 18px;
    height: 18px;
}

.hero-search-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #fff;
    border: 1px solid var(--primary);
    box-shadow: 0 6px 14px rgba(19, 88, 255, 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.hero-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(19, 88, 255, 0.24);
    background: linear-gradient(180deg, var(--primary, #2b72ff) 0%, var(--primary-dark) 100%);
}

.hero-search-btn svg {
    width: 18px;
    height: 18px;
}

.hero-advanced-btn {
    flex-shrink: 0;
    height: 40px;
    padding: 0 12px;
    color: var(--primary);
    font-size: 15px;
    line-height: 1;
    font-weight: 650;
    white-space: nowrap;
    transition: color 0.18s ease, background 0.18s ease;
    border-radius: 10px;
    background: transparent;
    letter-spacing: -0.01em;
    display: inline-flex;
}

.hero-advanced-btn:hover {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.hero-advanced-btn svg {
    width: 14px;
    height: 14px;
}

.hero-advanced-link {
    display: none;
}

/* ==================== RESPONSIVE HOMEPAGE ==================== */
@media (max-width: 760px) {
    .hero {
        min-height: calc(100vh - 64px);
        padding: 20px 20px 140px;
    }

    .hero-title {
        font-size: clamp(28px, 8vw, 40px);
        margin-bottom: 28px;
    }

    .hero-search-container {
        flex-wrap: wrap;
    }

    .hero-search-bar {
        flex-basis: 100%;
        height: 56px;
        padding: 0 10px 0 16px;
    }

    .hero-search-bar input {
        font-size: 16px;
    }

    .hero-search-btn {
        flex: 1;
    }
}


/* ==================== ECOMMERCE TYPOGRAPHY REFINEMENT ==================== */
body {
    font-family: var(--font-ecommerce);
    letter-spacing: 0;
}

.section-title,
.saved-header h2,
.scanning-section h2,
.hero-title {
    letter-spacing: -0.01em;
}

/* ==================== PHOTO CHOICE POPUP ==================== */
.hero-search-bar {
    position: relative;
}

.photo-choice-popup {
    position: fixed;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 100;
    min-width: 180px;
}

.photo-choice-popup .popup-arrow {
    position: absolute;
    top: -6px;
    width: 12px;
    height: 12px;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
    pointer-events: none;
}

.photo-choice-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    font-family: inherit;
    transition: background 0.12s ease;
    white-space: nowrap;
}

.photo-choice-option:hover {
    background: var(--primary-bg);
}

.photo-choice-option svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--primary);
}

/* ==================== DRAG DROP OVERLAY ==================== */
.drag-drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay-glass, rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.drag-drop-overlay:not([hidden]) {
    display: flex;
}

.drag-drop-border {
    position: absolute;
    inset: 12px;
    border: 3px dashed var(--primary);
    border-radius: 20px;
    background: rgba(0, 68, 255, 0.04);
    animation: drag-border-pulse 1.5s ease-in-out infinite;
}

@keyframes drag-border-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.drag-drop-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    text-align: center;
    pointer-events: none;
}

.drag-drop-content svg {
    opacity: 0.8;
}

.drag-drop-title {
    font-size: 22px;
    font-weight: 750;
    color: var(--text-dark);
    margin: 0;
}

.drag-drop-subtitle {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    margin: 0;
}

/* ==================== COMPACT ADVANCED BUTTON (small devices) ==================== */
/* On small screens the text "Advanced" button becomes a small upside-down-caret
   (down chevron) button to the right of the search button, and the decorative
   search icon is hidden so the input can keep at least half of the bar. */
@media (max-width: 640px) {
    .hero-search-icon {
        display: none;
    }

    .hero-search-bar {
        gap: 6px;
        padding: 8px 8px 8px 14px;
    }

    .hero-advanced-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
        align-items: center;
    }

    .hero-advanced-label {
        display: none;
    }

    .hero-advanced-btn svg {
        transform: rotate(90deg);
    }
}

/* ==================== DISCOVER (marketplace feed) ==================== */
/* eBay/AliExpress-style horizontal rails fed by /api/discover. Cards reuse
   the site's premium card tokens so they follow every theme. */

.discover {
    padding: 34px 0 46px;
}

.discover-inner {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.discover-head {
    margin-bottom: 6px;
}

.discover-title {
    margin: 0 0 4px;
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-dark, #101a33);
}

.discover-sub {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted, #66758d);
}

.discover-block {
    margin-top: 26px;
    padding: 18px 18px 6px;
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--premium-border, var(--border, #e6ebf4));
    border-radius: 18px;
    box-shadow: var(--premium-shadow-soft, 0 8px 22px rgba(15, 23, 42, 0.045));
}

.discover-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.discover-block-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-dark, #101a33);
}

.discover-view-all {
    font-size: 13px;
    font-weight: 750;
    color: var(--primary, #1358ff);
    text-decoration: none;
    white-space: nowrap;
}

.discover-view-all:hover {
    text-decoration: underline;
}

.discover-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 214px;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 6px 2px 14px;
}

/* Shared cards: product cards are 332px wide, brand cards 240px. */
.discover-row[data-kind="products"] {
    grid-auto-columns: 332px;
}
.discover-row[data-kind="brands"] {
    grid-auto-columns: 200px;
}



.discover-row::-webkit-scrollbar {
    height: 8px;
}

.discover-row::-webkit-scrollbar-thumb {
    background: var(--border, #e2e8f2);
    border-radius: 99px;
}

/* ---- product card ---- */
.discover-card {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--premium-border, var(--border, #dfe6f2));
    border-radius: 18px;
    background: linear-gradient(180deg, var(--premium-card, #ffffff) 0%, var(--premium-card, #ffffff) 80%, var(--bg-page, #fbfcff) 100%);
    box-shadow: var(--card-shadow, var(--shadow-card, 0 14px 30px rgba(17, 24, 39, 0.07))), var(--card-edge, none);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.discover-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong, #d2ddf0);
    box-shadow: var(--premium-shadow, 0 20px 42px -12px rgba(17, 24, 39, 0.12)), var(--card-edge, none);
}

.discover-thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border-radius: 13px;
    background: var(--bg-page, #f2f5fa);
    overflow: hidden;
}

.discover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.discover-name {
    font-size: 13.5px;
    font-weight: 750;
    line-height: 1.3;
    color: var(--text-dark, #101a33);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.discover-brand {
    font-size: 11.5px;
    font-weight: 650;
    color: var(--text-muted, #66758d);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discover-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary, #1358ff);
}

.discover-count {
    font-size: 11.5px;
    font-weight: 650;
    color: var(--text-muted, #66758d);
}

/* ---- brand card ---- */
.discover-brand-card {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 14px 16px;
    border: 1px solid var(--premium-border, var(--border, #dfe6f2));
    border-radius: 18px;
    background: linear-gradient(180deg, var(--premium-card, #ffffff) 0%, var(--premium-card, #ffffff) 80%, var(--bg-page, #fbfcff) 100%);
    box-shadow: var(--card-shadow, var(--shadow-card, 0 14px 30px rgba(17, 24, 39, 0.07))), var(--card-edge, none);
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.discover-brand-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong, #d2ddf0);
    box-shadow: var(--premium-shadow, 0 20px 42px -12px rgba(17, 24, 39, 0.12)), var(--card-edge, none);
}

.discover-brand-logo {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--bg-page, #f2f5fa);
    overflow: hidden;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary, #1358ff);
}

.discover-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.discover-brand-card .discover-name {
    min-height: 0;
    -webkit-line-clamp: 1;
    text-align: center;
}

/* ---- skeletons + empty state ---- */
.discover-card.is-skeleton .discover-thumb,
.discover-brand-card.is-skeleton .discover-brand-logo {
    background: linear-gradient(100deg, var(--bg-page, #f2f5fa) 40%, var(--surface-alt, #f8faff) 50%, var(--bg-page, #f2f5fa) 60%);
    background-size: 200% 100%;
    animation: discoverShimmer 1.2s ease-in-out infinite;
}

.discover-card.is-skeleton .discover-name,
.discover-brand-card.is-skeleton .discover-name {
    border-radius: 6px;
    background: linear-gradient(100deg, var(--bg-page, #f2f5fa) 40%, var(--surface-alt, #f8faff) 50%, var(--bg-page, #f2f5fa) 60%);
    background-size: 200% 100%;
    animation: discoverShimmer 1.2s ease-in-out infinite;
    color: transparent;
}

@keyframes discoverShimmer {
    from { background-position: 120% 0; }
    to { background-position: -80% 0; }
}

@media (max-width: 640px) {
    .discover {
        padding: 26px 0 34px;
    }

    .discover-inner {
        width: calc(100% - 32px);
    }

    .discover-block {
        padding: 14px 10px 4px;
    }

    .discover-row {
        grid-auto-columns: 172px;
        gap: 11px;
    }
}
