/* ---------- Shared app styles ---------- */
:root {
  --app-primary: #2563eb;
  --app-primary-dark: #1e3a8a;
  --app-border: #e2e8f0;
  --app-radius: 0.875rem;
  --app-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
}

body { background: #f8fafc; color: #0f172a; }
.navbar { background: #fff !important; }

.page-header { margin: 2rem 0 1.5rem; }
.page-header h1 { font-weight: 700; letter-spacing: -0.02em; }
.back-link { display: inline-block; margin-top: 1.5rem; color: #64748b; text-decoration: none; font-size: .9rem; }
.back-link:hover { color: var(--app-primary); }

/* Hero */
.hero {
  margin: 1.5rem 0 2.5rem;
  border-radius: 1.25rem;
  padding: 4rem 2.5rem;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.15), transparent 40%),
    linear-gradient(135deg, var(--app-primary-dark), var(--app-primary));
  box-shadow: var(--app-shadow);
}
.hero-content { max-width: 680px; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; opacity: .8; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.03em; margin: .5rem 0 1rem; }
.hero .lead { opacity: .9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-actions .btn { border-radius: .6rem; font-weight: 600; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-bottom: 3rem; }
.feature-card {
  background: #fff; border: 1px solid var(--app-border); border-radius: var(--app-radius);
  padding: 1.75rem; color: inherit; text-decoration: none; box-shadow: var(--app-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -16px rgba(15,23,42,.3); color: inherit; }
.feature-icon { font-size: 2rem; margin-bottom: .5rem; }
.feature-card h3 { font-size: 1.2rem; font-weight: 700; }
.feature-card p { color: #64748b; }
.feature-link { color: var(--app-primary); font-weight: 600; }

/* Forms */
.form-page { max-width: 820px; margin: 2rem auto 3rem; }
.form-page-header { text-align: center; margin-bottom: 1.75rem; }
.form-page-header h1 { font-weight: 700; letter-spacing: -0.02em; }
.card-form {
  background: #fff; border: 1px solid var(--app-border); border-radius: var(--app-radius);
  box-shadow: var(--app-shadow); padding: 2rem;
}
.form-section-title { font-size: 1rem; font-weight: 600; color: #334155; text-transform: uppercase; letter-spacing: .05em; margin: 1.75rem 0 1rem; }
.card-form .form-control, .card-form .form-select, .filter-bar .form-control, .filter-bar .form-select {
  border-radius: .6rem; border-color: #cbd5e1; background-color: #f8fafc;
}
.card-form .form-control:focus, .card-form .form-select:focus { background-color: #fff; border-color: var(--app-primary); }
.card-form .btn, .filter-bar .btn { border-radius: .6rem; font-weight: 600; }
.textarea-lg { min-height: 160px !important; }
.textarea-xl { min-height: 240px !important; }
.thankyou-icon {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  background: #dcfce7; color: #16a34a; font-size: 2.25rem; line-height: 72px;
}

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.filter-bar .form-control { flex: 1 1 240px; }
.filter-bar .form-select { flex: 0 1 220px; }

/* Listings */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.listing-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--app-border);
  border-radius: var(--app-radius); overflow: hidden; color: inherit; text-decoration: none;
  box-shadow: var(--app-shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.listing-card:hover { transform: translateY(-3px); color: inherit; box-shadow: 0 18px 40px -16px rgba(15,23,42,.3); }
.listing-card.is-sold { opacity: .7; }
.listing-card-img { position: relative; aspect-ratio: 4 / 3; background: #f1f5f9; }
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: #94a3b8; background: #f1f5f9; }
.listing-card-noimg.large { aspect-ratio: 4 / 3; border-radius: var(--app-radius); }
.badge-sold { position: absolute; top: .75rem; left: .75rem; background: #dc2626; color: #fff; font-weight: 700; padding: .3rem .7rem; border-radius: .4rem; font-size: .8rem; }
.listing-card-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.listing-card-body h3 { font-size: 1.1rem; font-weight: 700; margin: .25rem 0; }
.listing-card-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--app-primary); font-weight: 600; }
.listing-card-price { margin-top: auto; font-size: 1.15rem; font-weight: 700; }
.empty-state { background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--app-radius); padding: 3rem; text-align: center; color: #64748b; }

.listing-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; margin: 1rem 0 3rem; }
.listing-gallery .carousel { border-radius: var(--app-radius); overflow: hidden; box-shadow: var(--app-shadow); background: #0f172a; }
.listing-gallery .carousel-item img { aspect-ratio: 4 / 3; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .75rem; overflow-x: auto; }
.gallery-thumbs button { border: 2px solid transparent; padding: 0; border-radius: .5rem; overflow: hidden; background: none; flex: 0 0 auto; }
.gallery-thumbs button:hover { border-color: var(--app-primary); }
.gallery-thumbs img { width: 84px; height: 63px; object-fit: cover; display: block; }
.listing-info h1 { font-weight: 800; letter-spacing: -0.02em; margin: .25rem 0 .75rem; }
.listing-detail-price { font-size: 1.75rem; font-weight: 800; margin-bottom: 1.25rem; }
.listing-description { white-space: pre-line; color: #334155; }

.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin-bottom: 1.25rem; }
.spec-list dt { color: #64748b; font-weight: 500; }
.spec-list dd { margin: 0; }

/* Admin */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.stat-card {
  display: flex; flex-direction: column; align-items: flex-start; background: #fff; border: 1px solid var(--app-border);
  border-radius: var(--app-radius); padding: 1.5rem; text-decoration: none; color: inherit; box-shadow: var(--app-shadow);
  transition: transform .15s ease;
}
.stat-card:hover { transform: translateY(-3px); color: inherit; }
.stat-value { font-size: 2.5rem; font-weight: 800; color: var(--app-primary); line-height: 1; }
.stat-label { color: #64748b; margin-top: .4rem; font-weight: 500; }

.table-card { background: #fff; border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: var(--app-shadow); overflow: hidden; margin-bottom: 3rem; }
.table-card .table thead th { background: #f8fafc; color: #64748b; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; border-bottom-color: var(--app-border); }
.table-card .table td, .table-card .table th { padding: .85rem 1rem; }
tr.clickable { cursor: pointer; }

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-bottom: 3rem; align-items: start; }

.admin-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: .4rem; }
.admin-thumb-empty { background: #e2e8f0; }

.dropzone {
  display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer;
  border: 2px dashed #cbd5e1; border-radius: var(--app-radius); padding: 2rem; background: #f8fafc;
  position: relative; transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover { border-color: var(--app-primary); background: #eff6ff; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-preview { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.image-preview img { width: 96px; height: 72px; object-fit: cover; border-radius: .4rem; }

.image-manage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.image-manage-item { position: relative; border-radius: .5rem; overflow: hidden; }
.image-manage-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.cover-badge { position: absolute; top: .4rem; left: .4rem; }
.image-manage-actions { position: absolute; top: .4rem; right: .4rem; display: flex; gap: .25rem; }

@media (max-width: 991.98px) {
  .listing-detail, .detail-grid { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 1.5rem; }
}


/* Language switch */
.lang-switch { display: inline-flex; margin-left: .75rem; border: 1px solid var(--app-border); border-radius: 999px; padding: 2px; background: #f8fafc; align-self: center; }
.lang-switch a { padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: #64748b; text-decoration: none; }
.lang-switch a.active { background: var(--app-primary); color: #fff; }
.lang-switch a:not(.active):hover { color: var(--app-primary); }

/* Bot protection */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.bot-check { display: flex; justify-content: flex-end; }

