/* =============================================================
   KCdesi Classifieds — Frontend CSS  v1.4.0
   Mobile-first: base = mobile, tablet @ 600px, desktop @ 960px
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; }

/* ── Shared tokens ───────────────────────────────────────────── */
.kcdesi-wrap            { width: 100%; max-width: 100%; }
.kcdesi-btn             { display: inline-block; padding: 10px 18px; border-radius: 5px;
                          font-size: 14px; font-weight: 700; text-decoration: none;
                          cursor: pointer; border: none; line-height: 1.4; text-align: center; }
.kcdesi-btn-primary     { background: #0073aa; color: #fff !important; }
.kcdesi-btn-primary:hover { background: #005a87; color: #fff !important; }
.kcdesi-btn-accent      { background: #e53935; color: #fff !important; }
.kcdesi-btn-accent:hover{ background: #c62828; color: #fff !important; }
.kcdesi-btn-sm          { padding: 7px 14px; font-size: 13px; }

.kcdesi-badge           { display: inline-block; padding: 3px 10px; border-radius: 14px;
                          font-size: 11px; font-weight: 700; text-transform: uppercase;
                          letter-spacing: .04em; }
.kcdesi-badge-cat       { background: #e8f4fd; color: #0073aa; }
.kcdesi-badge-price     { background: #f0fdf4; color: #15803d; font-size: 15px;
                          font-weight: 800; padding: 4px 12px; }
.kcdesi-badge-free      { background: #f3f4f6; color: #6b7280; }
.kcdesi-badge-expiring  { background: #fff7ed; color: #c2410c; }

.kcdesi-divider         { border: none; border-top: 1px solid #e8e8e8; margin: 24px 0; }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.kcdesi-breadcrumb      { font-size: 13px; color: #999; margin-bottom: 16px;
                          display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.kcdesi-breadcrumb a    { color: #0073aa; text-decoration: none; }
.kcdesi-breadcrumb a:hover { text-decoration: underline; }
.kcdesi-breadcrumb-sep  { color: #ccc; }

/* ── Notice / alert ──────────────────────────────────────────── */
.kcdesi-notice          { padding: 12px 16px; border-radius: 5px; margin-bottom: 16px; font-size: 14px; }
.kcdesi-notice-success  { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.kcdesi-notice-error    { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.kcdesi-notice-warn     { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }

/* ═══════════════════════════════════════════════════════════════
   LISTINGS SHORTCODE  [kcdesi_classifieds]
   ═══════════════════════════════════════════════════════════════ */

.kcdesi-listings-wrap   { width: 100%; }

/* Header */
.kcdesi-listings-header { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.kcdesi-listings-header h2 { margin: 0; font-size: 22px; }
.kcdesi-post-cta        { display: block; width: 100%; text-align: center; }

/* Filter */
.kcdesi-filter-form     { background: #f8f8f8; border: 1px solid #e5e5e5; border-radius: 6px;
                          padding: 14px; margin-bottom: 18px;
                          display: flex; flex-direction: column; gap: 10px; }
.kcdesi-filter-form select,
.kcdesi-filter-form input[type=search] {
    width: 100%; padding: 10px 12px; border: 1px solid #ccc;
    border-radius: 5px; font-size: 14px; background: #fff; }
.kcdesi-filter-form button { width: 100%; }
.kcdesi-filter-clear    { text-align: center; font-size: 13px; color: #888; text-decoration: none; }
.kcdesi-filter-clear:hover { color: #c62828; }

/* Result count */
.kcdesi-result-count    { font-size: 13px; color: #888; margin-bottom: 14px; }

/* Ad grid — 1 col mobile */
.kcdesi-ads-grid        { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; }

/* Ad card */
.kcdesi-ad-card         { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
                          padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.kcdesi-ad-card:hover   { box-shadow: 0 3px 12px rgba(0,0,0,.09); }
.kcdesi-ad-card-title   { font-size: 16px; font-weight: 700; margin: 0; }
.kcdesi-ad-card-title a { color: #1a1a1a; text-decoration: none; }
.kcdesi-ad-card-title a:hover { color: #0073aa; }
.kcdesi-ad-card-meta    { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kcdesi-ad-date         { font-size: 12px; color: #999; }
.kcdesi-ad-excerpt      { font-size: 13px; color: #555; line-height: 1.55; flex: 1; }
.kcdesi-ad-footer       { display: flex; justify-content: flex-end; margin-top: 4px; }

/* Empty state */
.kcdesi-no-ads          { text-align: center; padding: 40px 16px; color: #999; font-size: 15px; }
.kcdesi-no-ads strong   { display: block; font-size: 18px; color: #666; margin-bottom: 8px; }

/* Pagination */
.kcdesi-pagination      { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.kcdesi-pagination a,
.kcdesi-pagination span { display: inline-block; padding: 8px 14px; border: 1px solid #ddd;
                          border-radius: 4px; font-size: 14px; text-decoration: none;
                          color: #0073aa; background: #fff; min-width: 42px; text-align: center; }
.kcdesi-pagination .current { background: #0073aa; color: #fff; border-color: #0073aa; font-weight: 700; }
.kcdesi-pagination a:hover  { background: #f0f7ff; }
.kcdesi-pagination .dots    { border: none; background: none; color: #aaa; }

/* ═══════════════════════════════════════════════════════════════
   SINGLE CLASSIFIED
   ═══════════════════════════════════════════════════════════════ */

.kcdesi-single-wrap     { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 4px; }

/* Hero meta bar */
.kcdesi-single-meta     { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.kcdesi-single-price-row{ display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kcdesi-single-price    { font-size: 24px; font-weight: 800; color: #15803d; }
.kcdesi-single-price.free { font-size: 18px; color: #6b7280; }
.kcdesi-single-info     { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: #888; }
.kcdesi-single-info span{ display: flex; align-items: center; gap: 4px; }

/* Content */
.kcdesi-single-content  { font-size: 15px; line-height: 1.7; color: #333; margin-bottom: 24px; }

/* Poster info card */
.kcdesi-poster-card     { background: #f8f9fa; border: 1px solid #e8e8e8; border-radius: 8px;
                          padding: 16px; margin-bottom: 24px; }
.kcdesi-poster-card h3  { font-size: 13px; font-weight: 700; text-transform: uppercase;
                          letter-spacing: .05em; color: #888; margin: 0 0 12px; }
.kcdesi-poster-name     { font-size: 16px; font-weight: 700; color: #1a1a1a; margin-bottom: 4px; }
.kcdesi-poster-phone    { font-size: 14px; color: #0073aa; text-decoration: none; }
.kcdesi-poster-phone:hover { text-decoration: underline; }

/* Contact form section */
.kcdesi-contact-section { margin-bottom: 32px; }
.kcdesi-contact-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* Contact form fields */
.kcdesi-contact-form    { display: flex; flex-direction: column; gap: 14px; }
.kcdesi-field           { display: flex; flex-direction: column; gap: 4px; }
.kcdesi-field label     { font-size: 13px; font-weight: 700; color: #333; }
.kcdesi-field input,
.kcdesi-field textarea  { width: 100%; padding: 11px 13px; border: 1px solid #d0d0d0;
                          border-radius: 5px; font-size: 14px; color: #333;
                          font-family: inherit; transition: border-color .15s; background: #fff; }
.kcdesi-field input:focus,
.kcdesi-field textarea:focus { border-color: #0073aa; outline: none;
                               box-shadow: 0 0 0 3px rgba(0,115,170,.1); }
.kcdesi-field textarea  { min-height: 120px; resize: vertical; }
.kcdesi-req             { color: #e53935; }

/* Related ads */
.kcdesi-related         { margin-top: 32px; }
.kcdesi-related h3      { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.kcdesi-related-grid    { display: grid; grid-template-columns: 1fr; gap: 12px; }
.kcdesi-related-card    { background: #fff; border: 1px solid #e0e0e0; border-radius: 7px;
                          padding: 14px; text-decoration: none; display: block;
                          transition: box-shadow .15s; }
.kcdesi-related-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.kcdesi-related-title   { font-size: 14px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; }
.kcdesi-related-meta    { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kcdesi-related-price   { font-size: 13px; font-weight: 700; color: #15803d; }
.kcdesi-related-date    { font-size: 12px; color: #aaa; }

/* Back link */
.kcdesi-back-link       { display: inline-flex; align-items: center; gap: 6px;
                          font-size: 14px; color: #0073aa; text-decoration: none;
                          margin-bottom: 20px; }
.kcdesi-back-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   TABLET  @ 600px
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 600px) {

    /* Listings */
    .kcdesi-listings-header { flex-direction: row; align-items: center; justify-content: space-between; }
    .kcdesi-post-cta        { width: auto; }
    .kcdesi-filter-form     { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .kcdesi-filter-form select      { width: auto; flex: 1; min-width: 160px; }
    .kcdesi-filter-form input[type=search] { width: auto; flex: 2; min-width: 180px; }
    .kcdesi-filter-form button { width: auto; }
    .kcdesi-ads-grid        { grid-template-columns: repeat(2, 1fr); }

    /* Single */
    .kcdesi-single-meta     { flex-direction: row; align-items: flex-start; justify-content: space-between; }
    .kcdesi-related-grid    { grid-template-columns: repeat(2, 1fr); }
    .kcdesi-contact-form    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .kcdesi-field.full      { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════════════════════
   DESKTOP  @ 960px
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 960px) {
    .kcdesi-ads-grid        { grid-template-columns: repeat(3, 1fr); }
    .kcdesi-related-grid    { grid-template-columns: repeat(4, 1fr); }
    .kcdesi-ad-card         { padding: 20px; }
}
