/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f7f8fa; color: #222; line-height: 1.6; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.mt-1 { margin-top: 1rem; }

/* ===== Header ===== */
.site-header { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 1.2rem; font-weight: 700; color: #111; }
.logo:hover { text-decoration: none; }
nav { display: flex; gap: 1.2rem; align-items: center; }
nav a { color: #555; font-weight: 500; }
nav a:hover { color: #2563eb; }

/* ===== Main ===== */
main.container { padding-top: 2rem; padding-bottom: 3rem; }

/* ===== Footer ===== */
.site-footer { background: #111; color: #aaa; text-align: center; padding: 1.2rem; font-size: 0.85rem; margin-top: 3rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 0.5rem 1.1rem; border-radius: 6px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none;
  background: #e5e7eb; color: #222; transition: background 0.15s;
}
.btn:hover { background: #d1d5db; text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: transparent; border: 2px solid #2563eb; color: #2563eb; }
.btn-outline:hover { background: #eff6ff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-link { background: none; border: none; color: #555; font-weight: 500; cursor: pointer; font-size: 1rem; padding: 0; }
.btn-link:hover { color: #2563eb; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge--sold { background: #fecaca; color: #991b1b; }
.badge--available { background: #d1fae5; color: #065f46; }
.badge--new { background: #dbeafe; color: #1e40af; }

/* ===== Hero ===== */
.page-hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.page-hero h1 { font-size: 2rem; font-weight: 800; }
.page-hero p { color: #666; margin-top: 0.4rem; }

/* ===== Filter bar ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; background: #fff; padding: 1rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.filter-bar input, .filter-bar select { flex: 1; min-width: 140px; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.9rem; background: #fff; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: #2563eb; }

/* ===== Item grid ===== */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; }
.item-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); transition: transform 0.15s, box-shadow 0.15s; color: inherit; }
.item-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); text-decoration: none; }
.item-card.sold { opacity: 0.7; }
.item-card__img { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #f3f4f6; }
.item-card__img img { width: 100%; height: 100%; object-fit: cover; }
.item-card__img .no-image { display: flex; align-items: center; justify-content: center; height: 100%; color: #9ca3af; font-size: 0.85rem; }
.item-card__img .badge { position: absolute; top: 8px; right: 8px; }
.item-card__body { padding: 0.8rem 1rem; }
.item-card__body h3 { font-size: 0.95rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.25rem; }
.item-meta { font-size: 0.8rem; color: #6b7280; }
.item-price { font-size: 1.1rem; font-weight: 700; color: #2563eb; margin-top: 0.4rem; }
.item-price.large { font-size: 1.6rem; }

/* ===== Item detail ===== */
.item-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 700px) { .item-detail { grid-template-columns: 1fr; } }
.gallery { display: flex; flex-direction: column; gap: 0.75rem; }
.gallery #main-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; background: #f3f4f6; }
.thumbnails { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; opacity: 0.7; }
.thumb.active, .thumb:hover { border-color: #2563eb; opacity: 1; }
.no-image.large { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: #f3f4f6; border-radius: 10px; color: #9ca3af; font-size: 1rem; }
.item-info { display: flex; flex-direction: column; gap: 0.8rem; }
.item-info h1 { font-size: 1.6rem; font-weight: 800; }
.item-description h3 { margin-bottom: 0.4rem; }
.item-description p { color: #444; white-space: pre-wrap; }

/* ===== Inquiry form / card ===== */
.card { background: #fff; border-radius: 10px; padding: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.inquiry-form h3, .admin-section h2 { margin-bottom: 1rem; }
form label { display: block; margin-bottom: 0.9rem; font-size: 0.9rem; font-weight: 500; color: #374151; }
form label input, form label select, form label textarea {
  display: block; width: 100%; margin-top: 0.3rem;
  padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 0.95rem; font-family: inherit; background: #fff;
}
form label input:focus, form label select:focus, form label textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.error-msg { color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.sold-notice p { color: #6b7280; }

/* ===== Success / auth pages ===== */
.success-page, .auth-page { display: flex; justify-content: center; padding: 3rem 0; }
.success-page .card, .auth-page .card { max-width: 420px; width: 100%; }
.text-center { text-align: center; }
.success-icon { font-size: 3rem; color: #22c55e; margin-bottom: 0.5rem; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2rem; }
.page-info { color: #6b7280; font-size: 0.9rem; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 3rem; color: #6b7280; }

/* ===== Admin ===== */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.6rem; }
.admin-section { margin-bottom: 2.5rem; background: #fff; border-radius: 10px; padding: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 2px solid #e5e7eb; color: #374151; font-weight: 600; }
.admin-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.table-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; background: #f3f4f6; }
.table-thumb.no-img { display: flex; align-items: center; justify-content: center; color: #9ca3af; }
.row-sold td { opacity: 0.55; }
.row-unread { background: #eff6ff; }
.action-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.msg-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Item form */
.item-form { max-width: 760px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.form-actions { display: flex; gap: 0.8rem; margin-top: 0.5rem; }
.existing-images, .img-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.img-remove-label { position: relative; cursor: pointer; }
.img-remove-label img { width: 90px; height: 70px; object-fit: cover; border-radius: 6px; }
.img-remove-label input { position: absolute; top: 4px; right: 4px; cursor: pointer; }
.img-remove-label span { display: block; text-align: center; font-size: 0.75rem; color: #ef4444; margin-top: 2px; }
#preview-container img { width: 90px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid #e5e7eb; }

/* ===== Seller auth pages ===== */
.auth-card { max-width: 540px; width: 100%; }
.auth-brand { font-size: 2.5rem; text-align: center; margin-bottom: 0.5rem; }
.auth-card h1 { text-align: center; font-size: 1.6rem; font-weight: 800; margin-bottom: 0.25rem; }
.auth-subtitle { text-align: center; color: #6b7280; font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-switch { text-align: center; font-size: 0.88rem; color: #6b7280; margin-top: 1rem; }
.btn-full { width: 100%; text-align: center; padding: 0.65rem 1rem; font-size: 1rem; margin-top: 0.5rem; }

/* ===== Stats strip ===== */
.stats-strip { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.stat-card { flex: 1; min-width: 110px; background: #fff; border-radius: 10px; padding: 1rem 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,0.08); text-align: center; }
.stat-card--alert { background: #eff6ff; border: 1px solid #bfdbfe; }
.stat-num { display: block; font-size: 2rem; font-weight: 800; color: #2563eb; line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.06em; }

/* ===== Seller dashboard header ===== */
.seller-subtitle { color: #6b7280; font-size: 0.9rem; margin-top: 0.2rem; }
.header-actions { display: flex; gap: 0.6rem; align-items: center; }

/* ===== Profile page ===== */
.form-divider { border: none; border-top: 1px solid #e5e7eb; margin: 1.5rem 0; }
.success-msg { color: #065f46; background: #d1fae5; border: 1px solid #6ee7b7; padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }

/* ===== Nav seller link ===== */
.nav-seller-link { color: #555; font-weight: 500; }
.nav-seller-link:hover { color: #2563eb; }

