@font-face {
  font-family: Cairo;
  src: url("/fonts/Cairo-Regular.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3efe7;
  --bg-2: #ebe4d8;
  --surface: #fffdf8;
  --ink: #16221f;
  --muted: #5c6b66;
  --line: #e4dcd0;
  --primary: #0e6b5c;
  --primary-dark: #0a4f44;
  --primary-soft: #e5f3ef;
  --accent: #d4a017;
  --accent-soft: #f8eccc;
  --danger: #b44a3c;
  --danger-soft: #f8e8e5;
  --ok: #1b7a4a;
  --ok-soft: #e3f5ea;
  --warn: #9a6b12;
  --shadow: 0 10px 30px rgba(22, 34, 31, 0.07);
  --radius: 18px;
  --nav-h: 72px;
  --tab-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  font-family: Cairo, Tahoma, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5rem; }
p { margin: 0 0 0.8rem; }

.wrap { width: min(1120px, calc(100% - 32px)); max-width: 100%; margin-inline: auto; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: var(--nav-h);
  min-width: 0;
}
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { width: 132px; height: auto; }
.top-search {
  flex: 1; display: flex; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden; min-width: 0;
}
.top-search input {
  flex: 1; border: 0; background: transparent; padding: 10px 16px; min-width: 0;
  outline: none;
}
.top-search button {
  border: 0; background: var(--primary); color: #fff;
  padding: 10px 18px; font-weight: 700;
}
.top-nav { display: none; align-items: center; gap: 8px; }
.top-nav a, .top-nav button.linkish {
  padding: 8px 12px; border-radius: 999px; color: var(--ink); background: none; border: 0;
  font-weight: 600;
}
.top-nav a:hover, .top-nav button.linkish:hover { background: var(--primary-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 700;
  background: var(--primary); color: #fff; text-align: center;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn.gold { background: var(--accent); color: #2a2108; }
.btn.gold:hover { background: #c08e10; color: #2a2108; }
.btn.ghost {
  background: #fff; color: var(--primary-dark);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { background: var(--danger); }
.btn.wa { background: #128c7e; }
.btn.block { width: 100%; }
.btn.small { padding: 7px 12px; font-size: 0.92rem; }

.view { min-height: 60vh; padding-bottom: calc(var(--tab-h) + 24px); }
@media (min-width: 860px) {
  .view { padding-bottom: 40px; }
  .top-nav { display: flex; }
  .top-search { max-width: 520px; }
}

.hero {
  background:
    radial-gradient(1200px 280px at 80% 0%, rgba(212, 160, 23, 0.18), transparent 60%),
    linear-gradient(180deg, #124f46 0%, #0e6b5c 55%, var(--bg) 100%);
  color: #fff;
  padding: 28px 0 54px;
  margin-bottom: -28px;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 8px; }
.hero p { color: rgba(255,255,255,.88); max-width: 36rem; }
.hero-search {
  display: flex; gap: 0; background: #fff; border-radius: 16px;
  overflow: hidden; margin-top: 18px; box-shadow: var(--shadow);
}
.hero-search input {
  flex: 1; border: 0; padding: 14px 16px; color: var(--ink); outline: none; min-width: 0;
}
.hero-search button {
  border: 0; background: var(--accent); color: #2a2108;
  padding: 14px 20px; font-weight: 800;
}

.section { margin: 28px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.section-head h2 { font-size: 1.25rem; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 10px;
}
@media (min-width: 520px) {
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (min-width: 980px) {
  .cat-grid { grid-template-columns: repeat(5, 1fr); }
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px;
  display: flex; align-items: center; gap: 10px;
  color: var(--ink);
  box-shadow: var(--shadow);
  min-height: 72px;
  min-width: 0;
  max-width: 100%;
}
.cat-card:hover { border-color: #b8d8d1; transform: translateY(-1px); }
.cat-ico {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-dark);
  display: grid; place-items: center; flex: 0 0 auto;
}
.cat-ico svg { width: 22px; height: 22px; }
.cat-text { min-width: 0; overflow-wrap: break-word; word-break: normal; }
.cat-card b { display: block; font-size: 0.98rem; color: var(--ink); }
.cat-text span, .cat-card .cat-text span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.ad-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: flex; flex-direction: column;
  min-width: 0;
  max-width: 100%;
}
.ad-card:hover { border-color: #c7ddd7; }
.ad-photo {
  position: relative; aspect-ratio: 16/10; background: #d7d0c4; overflow: hidden;
}
.ad-photo img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 3px 9px; font-size: 0.75rem; font-weight: 800;
}
.badge.feat { background: var(--accent); color: #2a2108; }
.badge.free { background: var(--ok-soft); color: var(--ok); }
.badge.wait { background: var(--accent-soft); color: var(--warn); }
.badge.expired { background: #eee; color: #666; }
.badge.rejected { background: var(--danger-soft); color: var(--danger); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.active { background: var(--primary-soft); color: var(--primary-dark); }
.photo-badges { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.ad-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ad-body h3 { font-size: 1rem; margin: 0; }
.price { color: var(--primary-dark); font-weight: 800; font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.86rem; display: flex; flex-wrap: wrap; gap: 8px; }

@media (min-width: 600px) {
  .ad-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .ad-grid { grid-template-columns: repeat(3, 1fr); }
  .ad-grid.four { grid-template-columns: repeat(4, 1fr); }
}

.layout {
  display: grid; gap: 18px; margin-top: 22px;
}
.filters {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}
.filters h2 { font-size: 1.05rem; }
.filters .row { display: grid; gap: 8px; margin-bottom: 10px; }
.filters label, .form-grid label { display: block; font-weight: 700; font-size: 0.86rem; margin-bottom: 4px; }
.filters input, .filters select,
.form-grid input, .form-grid select, .form-grid textarea,
.auth-card input, .admin-box input, .admin-box select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; background: #fff; color: var(--ink);
}
.form-grid textarea { min-height: 88px; resize: vertical; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (min-width: 860px) {
  .layout.has-filters { grid-template-columns: 270px 1fr; align-items: start; }
  .filters { position: sticky; top: 88px; }
}

.page-head { padding-top: 22px; }
.page-head h1 { font-size: 1.6rem; }

.detail {
  display: grid; gap: 18px; margin: 22px 0 40px;
}
@media (min-width: 860px) {
  .detail {
    grid-template-columns: 1.4fr 0.8fr;
    grid-template-areas: "gallery side" "desc side";
    align-items: start;
  }
  .gallery { grid-area: gallery; }
  .detail-side { grid-area: side; position: sticky; top: 88px; }
  .detail-desc { grid-area: desc; }
}
.gallery { background: #1c1c1c; border-radius: var(--radius); overflow: hidden; }
.gallery-main { aspect-ratio: 16/10; background: #111; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; background: #171717; }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; width: 74px; height: 56px; flex: 0 0 auto; background: none; }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.panel .price { font-size: 1.5rem; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.spec {
  background: var(--bg); border-radius: 12px; padding: 8px 10px;
}
.spec b { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.contact-row { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.form-grid { display: grid; gap: 12px; }
.form-grid .two { display: grid; gap: 12px; }
@media (min-width: 640px) { .form-grid .two { grid-template-columns: 1fr 1fr; } }

.plan-pick { display: grid; gap: 10px; }
@media (min-width: 640px) { .plan-pick { grid-template-columns: 1fr 1fr; } }
.plan {
  border: 2px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; text-align: start;
}
.plan input { accent-color: var(--primary); }
.plan.on { border-color: var(--primary); background: var(--primary-soft); }
.plan.feat.on { border-color: var(--accent); background: var(--accent-soft); }
.plan strong { display: block; font-size: 1.05rem; }
.photos-in input { padding: 8px; }
.photo-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-preview img { width: 86px; height: 70px; object-fit: cover; border-radius: 10px; }

.auth-card, .admin-box, .empty, .notice {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.auth-card { max-width: 420px; margin: 28px auto; }
.empty { text-align: center; padding: 40px 16px; }

.notice.wait { background: var(--accent-soft); border-color: #e4cc80; }
.notice.ok { background: var(--ok-soft); border-color: #b7e0c6; }
.pricing-grid { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 800px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px; box-shadow: var(--shadow);
}
.price-card.best { border-color: var(--accent); box-shadow: 0 10px 30px rgba(212,160,23,.18); }
.price-card .tag { color: var(--muted); }
.price-card .amount { font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.price-card ul { padding-inline-start: 1.1rem; margin: 10px 0 0; }

.my-list { display: grid; gap: 14px; }
.my-ad {
  display: grid; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow);
}
@media (min-width: 700px) {
  .my-ad { grid-template-columns: 160px 1fr; align-items: start; }
}
.my-ad img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.site-footer {
  background: #10241f; color: #e7efe9;
  padding: 36px 0 90px;
  margin-top: 20px;
}
.footer-grid { display: grid; gap: 22px; }
.footer-grid a { display: block; color: #d5e6df; margin: 4px 0; }
.footer-grid h3 { color: #f6e7b2; font-size: 1rem; }
.site-footer .muted { color: #b7c7c0; }
.copy {
  text-align: center; margin: 28px 0 0; color: #f6e7b2; font-weight: 700;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .site-footer { padding-bottom: 36px; }
}

.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fffdf8; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.mobile-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 0.7rem; font-weight: 700; padding: 4px 0;
  min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.mobile-nav a.on, .mobile-nav a:hover { color: var(--primary-dark); }
.mobile-nav svg { width: 22px; height: 22px; }
@media (min-width: 860px) { .mobile-nav { display: none; } }

table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: start; vertical-align: top; }
table.data th { font-size: 0.8rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.admin-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.flash { padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.flash.ok { background: var(--ok-soft); color: var(--ok); }

.admin-layout { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .admin-layout { grid-template-columns: 220px 1fr; align-items: start; }
}
.side-link { display: block; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.side-link.on, .side-link:hover { background: var(--primary-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 12px; color: var(--ink); font-weight: 700; font-size: 0.88rem;
}
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn.wa { background: #1fa855; }
.btn.wa:hover { background: #188f47; color: #fff; }
.price-card ul { list-style: none; padding: 0; }
.price-card li { position: relative; padding-inline-start: 1.15rem; margin: 6px 0; }
.price-card li::before { content: "•"; position: absolute; inset-inline-start: 0; top: 0; color: var(--primary-dark); font-weight: 800; }
.file-btn, .form-grid label.file-btn { position: relative; overflow: hidden; width: auto; display: inline-flex; }
.file-btn input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0;
}
@media (max-width: 859px) {
  .brand img { width: 110px; }
  .top-search button { padding: 10px 14px; }
}
@media (max-width: 400px) {
  .cat-card { padding: 12px 10px; gap: 8px; }
  .cat-ico { width: 38px; height: 38px; }
  .cat-card b { font-size: 0.92rem; }
}
