/* ── BestPrice – Shared Styles ── */

:root {
    --accent:  #e8365d;
    --accent2: #ff6b35;
    --dark:    #0f0f0f;
    --light:   #f2f3f5;
    --muted:   #999;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--light);
    color: var(--dark);
    overflow-x: hidden;
}

/* ── Container (overrides Bootstrap to keep 1280px) ── */
.container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
    max-width: 1280px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* ── Header ── */
header {
    background: var(--dark);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0 40px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header img { height: 40px; flex-shrink: 0; }

.search-wrap {
    flex: 1;
    max-width: 540px;
    position: relative;
}

.search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.35);
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    padding: 10px 18px 10px 42px;
    border-radius: 30px;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.search-wrap input::placeholder { color: rgba(255,255,255,0.3); }
.search-wrap input:focus { border-color: var(--accent); background: rgba(255,255,255,0.13); }

.nav-link-header {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: auto;
    transition: color 0.15s;
}
.nav-link-header:hover { color: white; }

/* ── Filters bar ── */
.filters-bar {
    background: white;
    border-bottom: 1px solid #ebebeb;
    padding: 12px 0;
}

.filters-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label { font-size: 12px; color: #888; font-weight: 500; white-space: nowrap; }

.filter-select {
    padding: 7px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #333;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--accent); }

.price-inputs { display: flex; align-items: center; gap: 6px; }

.price-input {
    width: 90px;
    padding: 7px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #333;
    outline: none;
    transition: border-color 0.15s;
}
.price-input:focus { border-color: var(--accent); }
.price-sep { font-size: 12px; color: #aaa; }

.toggle-wrap { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.toggle-wrap input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ── Brand dropdown ── */
.brand-dropdown { position: relative; }

.brand-btn {
    padding: 7px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #333;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    white-space: nowrap;
}
.brand-btn.active { border-color: var(--accent); color: var(--accent); }

.brand-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 240px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 200;
    padding: 10px;
}
.brand-panel.open { display: block; }

.brand-search {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    outline: none;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.brand-search:focus { border-color: var(--accent); }

.brand-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }

.brand-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #333; }
.brand-item:hover { background: #f5f5f5; }
.brand-item input[type=checkbox] { accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.brand-item-count { margin-left: auto; font-size: 11px; color: #aaa; }

.reset-btn, .active-filters-count {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-left: auto;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    display: none;
}

/* ── Product card ── */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    height: 100%;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.11); }

.product-card img { height: 180px; width: 100%; object-fit: contain; padding: 16px; }

.product-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }

.product-brand { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }

.product-name {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    line-height: 1.4;
    flex: 1;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price { font-size: 17px; font-weight: 700; color: var(--dark); letter-spacing: -0.3px; }

.product-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; margin-top: 6px; }
.badge-in  { background: #e6f9f0; color: #1a8a4a; }
.badge-out { background: #fdecea; color: #c0392b; }

.product-btn {
    display: block;
    margin-top: 12px;
    padding: 8px;
    border-radius: 10px;
    background: var(--dark);
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}
.product-btn:hover { background: var(--accent); color: white; }

/* ── Infinite scroll / spinner ── */
.scroll-sentinel { height: 1px; margin-top: 32px; }

.load-more-spinner { display: none; justify-content: center; align-items: center; padding: 28px 0; gap: 8px; color: var(--muted); font-size: 13px; }
.load-more-spinner.visible { display: flex; }

.spinner-ring { width: 20px; height: 20px; border: 2px solid #e0e0e0; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; stroke: #ddd; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; margin: 0 auto 16px; }
.empty-state p { font-size: 15px; }

/* ── Footer (simple) ── */
footer {
    background: var(--dark);
    border-top: 1px solid rgba(255,255,255,0.07);
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}
footer a { color: rgba(255,255,255,0.5); text-decoration: none; }
footer a:hover { color: white; }

/* ── Autocomplete ── */
.ac-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    z-index: 999;
    overflow: hidden;
    min-width: 340px;
}
.ac-section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--muted); padding: 10px 14px 4px;
}
.ac-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; text-decoration: none; color: var(--dark);
    transition: background 0.1s; cursor: pointer;
}
.ac-item:hover, .ac-item.ac-active { background: var(--light); }
.ac-item svg { flex-shrink: 0; color: var(--muted); }
.ac-item-img {
    width: 38px; height: 38px; object-fit: contain;
    border-radius: 7px; background: var(--light); flex-shrink: 0;
}
.ac-item-text { display: flex; flex-direction: column; min-width: 0; }
.ac-item-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item-sub  { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ac-footer {
    display: block; padding: 9px 14px; font-size: 12px;
    color: var(--accent); text-decoration: none; font-weight: 600;
    border-top: 1px solid var(--light);
}
.ac-footer:hover { background: var(--light); }
.ac-cat-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--accent);
    background: rgba(232,54,93,0.08); border-radius: 4px;
    padding: 2px 6px; flex-shrink: 0; white-space: nowrap;
}
.ac-cat { background: rgba(232,54,93,0.03); }
.ac-cat:hover, .ac-cat.ac-active { background: rgba(232,54,93,0.07); }

/* ── Cookie Consent Modal ── */
#cookieConsentModal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1050; display: flex !important; align-items: center; justify-content: center;
}
#cookieConsentModal[style*="display:none"],
#cookieConsentModal[style*="display: none"] { display: none !important; }
.cookie-dialog {
    background: #fff; color: #333; border-radius: 4px; border: 1px solid lightgray;
    box-shadow: 0 0 54px rgba(0,0,0,0.3);
    font-family: 'Inter', sans-serif; max-width: 500px; width: 90%;
}
.cookie-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid #eee; }
.cookie-title  { font-size: 1.1rem; font-weight: 700; margin: 0; color: #333; }
.cookie-close  { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999; line-height: 1; padding: 0; }
.cookie-close:hover { color: #333; }
.cookie-body { padding: 1.5rem; }
.cookie-body p { color: #555; font-size: 0.95rem; line-height: 1.6; margin-bottom: 1rem; }
.cookie-body a { color: #fc5959; text-decoration: underline; }
.cookie-body a:hover { color: #e63946; }
#cookie_settings { background: #f8f9fa; border-radius: 4px; padding: 1rem; border: 1px solid #eee; margin-top: 0.5rem; }
.cookie-toggles { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 0.5rem; }
.cookie-toggle-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.cookie-toggle-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: #fc5959; cursor: pointer; margin: 0; }
.cookie-toggle-item input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }
.cookie-toggle-item label { color: #555; font-size: 0.8rem; margin: 0; cursor: pointer; }
#details_settings { background: #f8f9fa; border: 1px solid #eee; border-radius: 4px; padding: 1rem; margin-top: 0.75rem; }
#details_settings h5 { font-weight: 700; color: #333; font-size: 1rem; margin-bottom: 0.25rem; }
#details_settings h6 { font-weight: 700; color: #fc5959; font-size: 0.9rem; padding-top: 0.75rem; margin-bottom: 0.25rem; }
#details_settings p  { color: #666; font-size: 0.85rem; line-height: 1.5; margin-bottom: 0.25rem; }
#details_settings em { color: #999; font-size: 0.8rem; }
#details_settings table { width: 100%; font-size: 0.8rem; border-collapse: collapse; margin-top: 1rem; }
#details_settings table th { padding: 0.5rem; border-bottom: 1px solid #ddd; font-weight: 700; color: #333; text-align: left; }
#details_settings table td { padding: 0.5rem; border-bottom: 1px solid #eee; color: #666; }
#details_settings::-webkit-scrollbar { width: 6px; }
#details_settings::-webkit-scrollbar-thumb { background: #fc5959; border-radius: 6px; }
#details_settings::-webkit-scrollbar-track { background: #f1f1f1; }
.cookie-footer { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-top: 1px solid #eee; flex-wrap: wrap; gap: 0.5rem; }
#reject-cookies, #settings-button { background: transparent; color: #555; border: 1px solid lightgray; border-radius: 25px; padding: 0.5rem 1.25rem; cursor: pointer; font-family: inherit; font-size: 0.9rem; transition: all 0.2s; margin-right: 0.4rem; }
#reject-cookies:hover, #settings-button:hover { background: #f8f9fa; border-color: #aaa; color: #333; }
#accept-cookies { background: #fc5959; color: white; border: none; border-radius: 25px; padding: 0.5rem 2rem; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.95rem; transition: background 0.2s; }
#accept-cookies:hover { background: #e63946; }
#modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1040; }
@media (max-width: 768px) { .cookie-dialog { width: 95%; } .cookie-header, .cookie-body { padding: 1rem; } }

/* ── Animations ── */
.fade-up { opacity: 0; transform: translateY(10px); animation: fadeUp 0.22s ease forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* ── Section typography ── */
.section-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.section-subtitle { color: var(--muted); font-size: 13px; margin-top: 3px; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.section-link { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; }
.section-link:hover { opacity: 0.8; }
