/* ═══════════════════════════════════════════════════════
   PRICELIO – Product Search Page Styles
═══════════════════════════════════════════════════════ */

.page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
    position: relative;
    z-index: 1;
}

.search-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: .5rem;
    letter-spacing: -.02em;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: .95rem;
    margin-bottom: 1.5rem;
}

/* ── Nav search bar ─────────────────────────────────── */
.search-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: .5rem;
    display: flex;
    gap: .5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transition: all .3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 40px var(--accent-primary-glow);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: .85rem 1.5rem;
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    font-size: 1.05rem;
    outline: none;
}

.search-input::placeholder { color: var(--text-muted); }

.btn-search {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: .85rem 1.5rem;
    border-radius: 100px;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s ease;
}

.btn-search:hover { transform: scale(1.05); }

/* ── Category tabs ──────────────────────────────────── */
.cat-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cat-tab {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    padding: .45rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all .2s ease;
}

.cat-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.cat-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* ── Results grid ───────────────────────────────────── */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* ── Result card (generated by product-search.js) ──── */
.result-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all .2s cubic-bezier(.165,.84,.44,1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.result-card:hover {
    border-color: var(--border-hover);
    transform: translateX(6px);
    background: var(--bg-card-hover);
}

.result-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.result-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

.result-img-placeholder {
    width: 100%;
    height: 100%;
    background: var(--border-subtle);
    border-radius: 4px;
}

.result-body { flex: 1; min-width: 0; }

.result-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-store {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.result-price {
    text-align: right;
    flex-shrink: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.result-old-price {
    display: block;
    font-size: .78rem;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: 400;
    margin-bottom: .1rem;
}

.result-unit-price {
    display: block;
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: .15rem;
}

/* ── Loading / empty states ─────────────────────────── */
.mobile-nav-link { color: var(--text-secondary); text-decoration: none; font-size: 1.4rem; font-weight: 600; transition: color .2s; }
.mobile-nav-link:hover { color: #fff; }

#loading {
    text-align: center;
    padding: 4rem;
}

#empty {
    text-align: center;
    padding: 4rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
