/* =====================================================
   DOZYCOTS - main stylesheet (mobile first)
   Change the colours in :root to re-theme the whole site.
   ===================================================== */
:root {
    --teal:        #0e7c86;   /* main brand */
    --teal-dark:   #0a5c64;
    --teal-soft:   #e3f4f4;
    --coral:       #ff6f59;   /* call-to-action */
    --coral-dark:  #e85a44;
    --sun:         #ffc857;   /* small highlights */
    --cream:       #fdf8f1;   /* page background */
    --ink:         #1d2b3a;   /* text */
    --muted:       #6b7a89;
    --line:        #eadfce;
    --card:        #ffffff;
    --danger:      #d64545;
    --wa:          #25d366;
    --radius:      16px;
    --shadow:      0 6px 22px rgba(29, 43, 58, .08);
    --shadow-lg:   0 14px 40px rgba(29, 43, 58, .16);
    --font: 'Poppins', 'Noto Sans Telugu', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background:
        radial-gradient(900px 400px at 100% -10%, rgba(255, 200, 87, .22), transparent 60%),
        radial-gradient(800px 380px at -10% 0%, rgba(14, 124, 134, .12), transparent 60%),
        var(--cream);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
p { margin: 0 0 .6em; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 999; }
.skip-link:focus { left: 8px; top: 8px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }   /* honeypot */

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: 600 14px/1 var(--font);
    padding: 12px 20px; border-radius: 999px; border: 2px solid transparent;
    cursor: pointer; text-decoration: none !important; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-accent  { background: var(--coral); color: #fff; box-shadow: 0 6px 16px rgba(255, 111, 89, .35); }
.btn-accent:hover { background: var(--coral-dark); }
.btn-ghost   { background: #fff; color: var(--teal); border-color: var(--teal); }
.btn-ghost:hover { background: var(--teal-soft); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-whatsapp { background: var(--wa); color: #fff; }
.btn-block { width: 100%; padding: 14px; }
.btn-sm { padding: 8px 12px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header::after {   /* colourful thin line */
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--sun), var(--coral));
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; position: relative; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none !important; }
.logo-mark {
    width: 30px; height: 30px; border-radius: 10px 10px 10px 2px;
    background: linear-gradient(135deg, var(--teal), #17a2a8);
    position: relative; box-shadow: 0 4px 10px rgba(14, 124, 134, .35);
}
.logo-mark::after { content: ''; position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--sun); border: 2px solid #fff; }
.logo-text { font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.logo-text b { color: var(--coral); font-weight: 700; }

.menu-toggle { display: inline-flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-toggle span { width: 24px; height: 2.5px; background: var(--ink); border-radius: 3px; transition: .25s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; gap: 4px;
    background: #fff; padding: 12px 16px 18px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.main-nav.open { display: flex; }
.main-nav a { padding: 11px 14px; border-radius: 12px; color: var(--ink); font-weight: 500; text-decoration: none; }
.main-nav a:hover { background: var(--teal-soft); }
.main-nav a.active { background: var(--teal-soft); color: var(--teal-dark); font-weight: 600; }
.main-nav .nav-post { margin-top: 8px; color: #fff; text-align: center; }
.main-nav .nav-post:hover { background: var(--coral-dark); }
.main-nav .nav-link-delete { color: var(--muted); font-size: 14px; }

/* ---------- intro / search ---------- */
.intro { padding-top: 26px; padding-bottom: 6px; text-align: center; }
.intro h1 { font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
.intro-sub { color: var(--muted); margin-bottom: 16px; }
.search-bar {
    display: flex; gap: 8px; max-width: 620px; margin: 0 auto;
    background: #fff; padding: 6px; border-radius: 999px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.search-bar input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 16px; font: 400 15px var(--font); color: var(--ink); outline: none; }
.search-bar .btn { padding: 10px 20px; }

/* ---------- listing ---------- */
.listing { padding-top: 18px; padding-bottom: 40px; }
.result-count { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.ad-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.ad-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
    border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(29, 43, 58, .04);
    transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column;
}
.ad-card:hover, .ad-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.ad-thumb { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--teal-soft), #fff3d6); overflow: hidden; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; }
.ad-badge {
    position: absolute; left: 8px; top: 8px; background: rgba(255, 255, 255, .95); color: var(--teal-dark);
    font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}
.ad-badge.static { position: static; display: inline-block; background: var(--teal-soft); box-shadow: none; margin-bottom: 8px; }
.ad-body { padding: 10px 12px 12px; }
.ad-price { color: var(--coral-dark); font-weight: 700; font-size: 16px; margin: 0; }
.ad-title { font-size: 14px; font-weight: 500; margin: 2px 0 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-meta { color: var(--muted); font-size: 12px; margin: 0; }
.load-more-wrap { text-align: center; margin-top: 24px; }
.empty-state { text-align: center; padding: 50px 16px; background: #fff; border-radius: var(--radius); border: 2px dashed var(--line); }
.empty-emoji { font-size: 44px; margin: 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(15, 28, 40, .55); backdrop-filter: blur(3px);
    display: flex; align-items: flex-end; justify-content: center; overflow-y: auto; padding: 0; }
.modal-box {
    position: relative; background: #fff; width: 100%; max-width: 560px; max-height: 94vh; overflow-y: auto;
    border-radius: 24px 24px 0 0; padding: 24px 18px 28px; animation: slideUp .25s ease;
}
.modal-wide { max-width: 860px; }
.modal-narrow { max-width: 420px; }
.modal-close { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0;
    background: var(--cream); font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); z-index: 2; }
.modal h2 { font-size: 20px; padding-right: 36px; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
body.modal-open { overflow: hidden; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .captcha-field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input[type=text], .field input[type=tel], .field input[type=number], .field input[type=password],
.field select, .field textarea {
    width: 100%; padding: 11px 14px; font: 400 15px var(--font); color: var(--ink);
    border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14, 124, 134, .12); }
.field input[type=file] { font-size: 13px; width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.preview-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.preview-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.captcha-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.captcha-row img { border-radius: 10px; border: 1px solid var(--line); background: #fff7eb; }
.captcha-row input { flex: 1; min-width: 100px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: 600 16px var(--font); letter-spacing: 3px; text-transform: lowercase; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin: 6px 0 14px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--teal); width: 17px; height: 17px; flex: none; }
.form-error { background: #fdecec; color: var(--danger); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.form-ok { background: #e6f7ec; color: #1c7a3d; padding: 10px 14px; border-radius: 12px; font-size: 14px; }

.success-emoji { font-size: 48px; text-align: center; margin: 0; }
#postSuccess { text-align: center; }
.pin-box { background: var(--cream); border: 2px dashed var(--sun); border-radius: 16px; padding: 14px; margin: 14px 0; }
.pin-box strong { font-size: 22px; letter-spacing: 2px; color: var(--teal-dark); }

/* ---------- detail popup ---------- */
.detail-grid { display: grid; gap: 18px; }
.detail-main { aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, var(--teal-soft), #fff3d6); display: grid; place-items: center; }
.detail-main img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.detail-main .big-emoji { font-size: 80px; }
.detail-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.detail-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.detail-thumbs img.on { border-color: var(--coral); }
.detail-price { font-size: 24px; font-weight: 700; color: var(--coral-dark); margin-bottom: 2px; }
.detail-desc { white-space: pre-line; margin: 12px 0; word-break: break-word; }
.detail-seller { background: var(--cream); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 200; font-size: 14px; box-shadow: var(--shadow-lg); }

/* ---------- footer ---------- */
.site-footer { background: #11262e; color: #cfe0e2; margin-top: 20px; }
.site-footer a { color: #ffd98a; }
.footer-grid { display: grid; gap: 26px; padding-top: 38px; padding-bottom: 30px; }
.site-footer h2 { color: #fff; font-size: 16px; margin-bottom: 10px; position: relative; padding-bottom: 8px; }
.site-footer h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px; border-radius: 3px; background: var(--coral); }
.site-footer p { font-size: 14px; }
.site-footer address { font-style: normal; }
.keyword-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-list a { display: inline-block; font-size: 12px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #cfe0e2; }
.keyword-list a:hover { background: var(--coral); color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 0; font-size: 13px; text-align: center; color: #8fa8ac; }
.footer-bottom p { margin: 0; }

/* ---------- tablet ---------- */
@media (min-width: 600px) {
    .ad-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .field-row { grid-template-columns: 1fr 1fr; }
    .intro h1 { font-size: 30px; }
    .modal { align-items: center; padding: 24px; }
    .modal-box { border-radius: 24px; padding: 28px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- desktop ---------- */
@media (min-width: 900px) {
    .menu-toggle { display: none; }
    .main-nav { position: static; display: flex !important; flex-direction: row; align-items: center; gap: 4px; background: none; border: 0; box-shadow: none; padding: 0; }
    .main-nav .nav-post { margin: 0 0 0 8px; padding: 11px 20px; }
    .ad-grid { grid-template-columns: repeat(4, 1fr); }
    .detail-grid { grid-template-columns: 1.1fr 1fr; }
    .footer-grid { grid-template-columns: 1.3fr 1fr 1.3fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
