/* WinClassified modern marketplace theme
   Inspired by the clean, card-based layout of leading classifieds sites. */

:root {
    --brand: #bd2426;
    --brand-dark: #991c1e;
    --brand-soft: #fff1f1;
    --ink: #212223;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f6f6f6;
    --card: #ffffff;
    --shadow: 0 2px 10px rgba(33, 34, 35, .08);
    --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ---------- Header ---------- */
.wc-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.wc-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--ink);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 800;
}
.brand-dot { color: var(--brand); }

.location-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font-size: 14px;
    background: #fff;
    white-space: nowrap;
}
.country-select {
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    outline: 0;
    cursor: pointer;
    max-width: 130px;
    padding: 2px 0;
}
.country-select:hover { color: var(--brand); }

.top-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    font-weight: 600;
}
.top-links a { color: var(--ink); }
.top-links a:hover { color: var(--brand); }

.post-btn,
input[type="submit"].post-btn,
button.post-btn {
    background: var(--brand);
    color: #fff !important;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none !important;
}
.post-btn:hover,
input[type="submit"].post-btn:hover { background: var(--brand-dark); }

/* ---------- Hero + search ---------- */
.hero {
    background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
    border-bottom: 1px solid var(--line);
}
.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 42px;
    text-align: center;
}
.hero h1 {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -.6px;
}
.hero h1 span { color: var(--brand); }
.hero p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 17px;
}

.search-panel {
    display: flex;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    padding: 8px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}
.search-panel input[type="text"],
.search-panel .search-field-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 8px;
    color: var(--ink);
}
.search-panel input[type="text"]:focus { background: var(--brand-soft); }

.search-btn,
input[type="submit"].search-btn {
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 12px 26px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
.search-btn:hover,
input[type="submit"].search-btn:hover { background: var(--brand-dark); }

.hero-note {
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
}

/* ---------- Categories ---------- */
.category-strip {
    max-width: 1200px;
    margin: 28px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.cat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 10px;
    text-align: center;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    display: block;
    color: var(--ink);
}
.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--brand);
    text-decoration: none;
    color: var(--brand);
}
.cat-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: var(--brand-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.cat-name { font-weight: 700; font-size: 14px; }

/* ---------- Sections / cards ---------- */
.section {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 20px;
}
.section-box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.section-title {
    margin: 0;
    font-size: 21px;
    letter-spacing: -.3px;
}
.view-all { font-weight: 700; font-size: 14px; }

.ad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.ad-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
}
.ad-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #d4d4d4;
}
a.ad-card { color: inherit; text-decoration: none; }
a.ad-card:hover { color: inherit; text-decoration: none; }
.ad-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
    display: block;
}
.ad-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ad-price { color: var(--brand); font-weight: 800; font-size: 17px; }
.ad-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ad-meta { color: var(--muted); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.ad-badge {
    display: inline-block;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    align-self: flex-start;
}
.ad-phone { margin-top: auto; font-weight: 700; font-size: 13px; }

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    background: #fafafa;
    border-radius: 10px;
    border: 1px dashed var(--line);
}

/* ---------- Search results ---------- */
.results-head {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.results-head h1 { margin: 0; font-size: 26px; letter-spacing: -.4px; }
.results-head em { color: var(--brand); font-style: normal; }
.result-count { color: var(--muted); font-size: 14px; }
.filter-pill {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 13px;
}

/* ---------- Forms ---------- */
.form-card {
    max-width: 460px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.form-card h1 { margin: 0 0 6px; font-size: 24px; text-align: center; }
.form-card .subtitle { text-align: center; color: var(--muted); margin-bottom: 22px; }
.form-row { margin-bottom: 16px; }
.form-label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.field-hint { margin-top: 5px; color: var(--muted); font-size: 12px; }
.error-message { display: block; margin-top: 5px; color: #bd2426; font-size: 13px; }
.form-input,
input[type="text"].form-input,
input[type="password"].form-input,
input[type="email"].form-input,
input[type="file"].form-input,
textarea.form-input,
select.form-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}
.form-input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.primary-btn,
input[type="submit"].primary-btn {
    width: 100%;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}
.primary-btn:hover,
input[type="submit"].primary-btn:hover { background: var(--brand-dark); }
.secondary-link { display: block; text-align: center; margin-top: 14px; font-size: 14px; }

/* ---------- Footer ---------- */
.footer {
    background: #fff;
    border-top: 1px solid var(--line);
    margin-top: 48px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 34px 20px 18px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.footer-col h3 { margin: 0 0 12px; font-size: 15px; }
.footer-col a { display: block; color: var(--muted); padding: 4px 0; font-size: 14px; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Simple content pages ---------- */
.content-page {
    max-width: 900px;
    margin: 32px auto;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.content-page h1 { margin-top: 0; }

/* ---------- Category sub-nav ---------- */
.wc-subnav {
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.wc-subnav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    overflow-x: auto;
}
.wc-subnav a {
    display: inline-block;
    padding: 11px 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.wc-subnav a:hover { color: var(--brand); text-decoration: none; }

.form-card.wide { max-width: 720px; }
.form-actions { margin-top: 20px; }
.success-message { color: #176b3a; font-weight: 700; text-align: center; margin-top: 12px; }

/* ---------- Ad detail page ---------- */
.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 18px;
}
.detail-breadcrumb a { color: var(--muted); }
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .85fr);
    gap: 18px;
    align-items: start;
}
.detail-gallery { margin-bottom: 18px; }
.detail-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
.detail-main-image {
    width: 100%;
    height: 460px;
    object-fit: contain;
    background: #f3f3f3;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.detail-thumbs { display: flex; gap: 10px; margin-top: 10px; }
.detail-thumb,
.detail-thumb-placeholder {
    width: 76px;
    height: 60px;
    object-fit: cover;
    border: 2px solid var(--brand);
    border-radius: 8px;
    background: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--muted);
}
.detail-description-card { min-height: 180px; }
.detail-section-title { margin: 0 0 14px; font-size: 17px; }
.detail-desc { white-space: pre-wrap; line-height: 1.7; color: #343536; }
.detail-title { margin: 10px 0 6px; font-size: 25px; line-height: 1.25; }
.detail-price { color: var(--brand); font-size: 26px; font-weight: 800; margin-bottom: 16px; }
.detail-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.detail-meta-item { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.detail-meta-item span { color: var(--muted); }
.detail-meta-item strong { font-weight: 700; }
.seller-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.seller-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}
.seller-subtitle { color: var(--muted); font-size: 12px; }
.seller-phone-row { display: flex; align-items: center; gap: 10px; }
.seller-phone-row .primary-btn { width: auto; padding: 9px 14px; font-size: 13px; white-space: nowrap; }
.detail-phone-hidden { display: none; }
.safety-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.safety-card li { margin-bottom: 7px; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rel-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}
.rel-card:hover { color: inherit; text-decoration: none; border-color: var(--brand); }
.rel-thumb { width: 100%; height: 120px; object-fit: cover; background: #f0f0f0; }
.rel-body { padding: 11px; display: flex; flex-direction: column; gap: 6px; }
.rel-title { margin: 0; font-size: 13px; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .category-strip { grid-template-columns: repeat(3, 1fr); }
    .ad-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-main-image { height: 360px; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .wc-header-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
    .brand { font-size: 20px; }
    .top-links { width: 100%; margin-left: 0; justify-content: space-between; gap: 10px; }
    .location-pill { display: none; }
    .hero-inner { padding: 34px 14px 30px; }
    .hero h1 { font-size: 26px; }
    .hero p { font-size: 15px; }
    .search-panel { flex-direction: column; border-radius: 12px; }
    .search-btn, input[type="submit"].search-btn { width: 100%; }
    .category-strip { grid-template-columns: repeat(2, 1fr); padding: 0 14px; }
    .section { padding: 0 14px; margin: 24px auto; }
    .section-box { padding: 16px; }
    .ad-grid { grid-template-columns: 1fr; }
    .detail-main-image { height: 260px; }
    .detail-meta-grid { grid-template-columns: 1fr; }
    .seller-phone-row { flex-direction: column; align-items: stretch; }
    .related-grid { grid-template-columns: 1fr; }
    .footer-inner { padding: 26px 14px 16px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
