/* ============================================================
   612 Wharf Avenue Store — Stylesheet
   Clean marketplace aesthetic · Mobile-first · PWA
   ============================================================ */

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

:root {
  --teal:       #0f766e;
  --teal-dk:    #0d6460;
  --teal-lt:    #ccfbf1;
  --teal-faint: #f0fdfa;
  --orange:     #ea580c;
  --orange-lt:  #fff7ed;
  --red:        #dc2626;
  --red-lt:     #fef2f2;
  --green:      #16a34a;
  --green-lt:   #dcfce7;
  --yellow:     #ca8a04;
  --yellow-lt:  #fefce8;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-700:   #374151;
  --gray-800:   #1f2937;
  --gray-900:   #111827;
  --white:      #ffffff;
  --border:     #e5e7eb;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.12);
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  18px;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --max:        1200px;
  --nav-h:      60px;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-900); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
button { font-family: var(--font); }

/* ── LAYOUT ── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

/* ── TYPOGRAPHY ── */
h1 { font-size: clamp(24px, 4vw, 40px); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(20px, 3vw, 28px); font-weight: 700; line-height: 1.2; }
h3 { font-size: clamp(16px, 2vw, 20px); font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }
p  { font-size: 15px; color: var(--gray-600); line-height: 1.7; }

/* ── BUTTONS ── */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; font-weight:600; border:none; border-radius:var(--radius); cursor:pointer; transition:all .15s; white-space:nowrap; min-height:40px; font-size:14px; padding:0 16px; text-decoration:none; }
.btn-sm  { min-height:32px; font-size:13px; padding:0 12px; }
.btn-lg  { min-height:48px; font-size:16px; padding:0 24px; border-radius:10px; }
.btn-xl  { min-height:56px; font-size:17px; padding:0 32px; border-radius:12px; }
.btn-full { width:100%; }
.btn-primary { background:var(--teal); color:#fff; }
.btn-primary:hover { background:var(--teal-dk); transform:translateY(-1px); box-shadow:0 4px 12px rgba(15,118,110,.3); }
.btn-orange  { background:var(--orange); color:#fff; }
.btn-orange:hover { background:#c2410c; transform:translateY(-1px); }
.btn-outline { background:transparent; border:1.5px solid var(--border); color:var(--gray-700); }
.btn-outline:hover { border-color:var(--gray-400); background:var(--gray-50); }
.btn-danger  { background:var(--red); color:#fff; }
.btn-danger:hover { background:#b91c1c; }
.btn-ghost   { background:transparent; color:var(--gray-600); }
.btn-ghost:hover { background:var(--gray-100); }
.btn:disabled { opacity:.5; cursor:not-allowed; transform:none !important; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 16px; }
.form-label { display:block; font-size:13px; font-weight:600; color:var(--gray-700); margin-bottom:6px; }
.form-input, .form-select, .form-textarea {
  width:100%; padding:10px 12px; font-size:14px; font-family:var(--font);
  border:1.5px solid var(--border); border-radius:var(--radius);
  background:#fff; color:var(--gray-900); transition:border-color .15s;
  -webkit-appearance:none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline:none; border-color:var(--teal);
  box-shadow:0 0 0 3px rgba(15,118,110,.1);
}
.form-textarea { resize:vertical; min-height:100px; line-height:1.6; }
.form-select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; padding-right:36px; }
.form-hint  { font-size:12px; color:var(--gray-400); margin-top:4px; }
.form-error { font-size:12px; color:var(--red); margin-top:4px; }
.form-row   { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:480px) { .form-row { grid-template-columns:1fr; } }

/* ── BADGE ── */
.badge { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:700; padding:2px 8px; border-radius:20px; }
.badge-teal   { background:var(--teal-lt);   color:var(--teal); }
.badge-orange { background:var(--orange-lt); color:var(--orange); }
.badge-green  { background:var(--green-lt);  color:var(--green); }
.badge-red    { background:var(--red-lt);    color:var(--red); }
.badge-yellow { background:var(--yellow-lt); color:var(--yellow); }
.badge-gray   { background:var(--gray-100);  color:var(--gray-600); }

/* ── NAV ── */
.site-nav { position:sticky; top:0; z-index:100; height:var(--nav-h); background:#fff; border-bottom:1px solid var(--border); box-shadow:var(--shadow-sm); }
.nav-inner { display:flex; align-items:center; gap:12px; height:100%; }
.nav-logo  { font-weight:800; font-size:17px; color:var(--gray-900); flex-shrink:0; }
.nav-logo span { color:var(--teal); }
.nav-search { flex:1; max-width:460px; position:relative; }
.nav-search input { width:100%; padding:9px 12px 9px 36px; border:1.5px solid var(--border); border-radius:20px; font-size:14px; font-family:var(--font); background:var(--gray-50); transition:all .15s; }
.nav-search input:focus { outline:none; border-color:var(--teal); background:#fff; box-shadow:0 0 0 3px rgba(15,118,110,.1); }
.nav-search svg { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--gray-400); pointer-events:none; }
.nav-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.cart-btn { position:relative; }
.cart-count { position:absolute; top:-6px; right:-6px; background:var(--orange); color:#fff; font-size:10px; font-weight:700; width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center; }

/* ── PRODUCT CARD ── */
.product-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media (min-width:480px) { .product-grid { gap:14px; } }
@media (min-width:640px) { .product-grid { grid-template-columns:repeat(3,1fr); } }
@media (min-width:900px) { .product-grid { grid-template-columns:repeat(4,1fr); gap:16px; } }
@media (min-width:1200px) { .product-grid { grid-template-columns:repeat(5,1fr); } }

.product-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; transition:all .2s; cursor:pointer; }
.product-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.product-card-img { aspect-ratio:1; overflow:hidden; background:var(--gray-100); position:relative; }
.product-card-img img { width:100%; height:100%; object-fit:cover; transition:transform .3s; }
.product-card:hover .product-card-img img { transform:scale(1.04); }
.product-card-badge { position:absolute; top:8px; left:8px; }
.product-card-body { padding:10px; }
.product-card-title { font-size:13px; font-weight:600; color:var(--gray-800); margin-bottom:4px; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.product-card-price { font-size:16px; font-weight:700; color:var(--gray-900); }
.product-card-meta  { font-size:11px; color:var(--gray-400); margin-top:3px; }
.product-card-auction { background:var(--red-lt); border-radius:6px; padding:4px 8px; margin-top:6px; }
.product-card-auction .bid { font-size:11px; font-weight:600; color:var(--red); }
.product-card-auction .ends { font-size:10px; color:var(--gray-500); }

/* ── CART SIDEBAR ── */
.cart-overlay { position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:200; opacity:0; pointer-events:none; transition:opacity .2s; }
.cart-overlay.open { opacity:1; pointer-events:all; }
.cart-drawer { position:fixed; top:0; right:0; bottom:0; width:min(400px,100vw); background:#fff; z-index:201; transform:translateX(100%); transition:transform .25s; display:flex; flex-direction:column; }
.cart-drawer.open { transform:translateX(0); }
.cart-header { padding:20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.cart-header h3 { font-size:18px; }
.cart-items-list { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:12px; }
.cart-item { display:flex; gap:12px; padding:12px; background:var(--gray-50); border-radius:var(--radius); }
.cart-item-img { width:64px; height:64px; border-radius:6px; object-fit:cover; flex-shrink:0; background:var(--gray-200); }
.cart-item-info { flex:1; min-width:0; }
.cart-item-title { font-size:13px; font-weight:600; color:var(--gray-800); margin-bottom:4px; }
.cart-item-price { font-size:15px; font-weight:700; color:var(--gray-900); }
.cart-item-remove { color:var(--gray-400); cursor:pointer; font-size:18px; flex-shrink:0; }
.cart-item-remove:hover { color:var(--red); }
.cart-footer { padding:16px 20px; border-top:1px solid var(--border); }
.cart-total { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.cart-total span { font-size:16px; font-weight:700; }
.cart-empty { text-align:center; padding:48px 24px; color:var(--gray-400); }
.cart-empty .icon { font-size:48px; margin-bottom:12px; }

/* ── MODAL ── */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:300; display:flex; align-items:flex-end; justify-content:center; padding:0; }
@media (min-width:640px) { .modal-overlay { align-items:center; padding:24px; } }
.modal { background:#fff; border-radius:var(--radius-xl) var(--radius-xl) 0 0; width:100%; max-width:560px; max-height:90vh; overflow-y:auto; }
@media (min-width:640px) { .modal { border-radius:var(--radius-xl); } }
.modal-header { padding:20px 24px 16px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; background:#fff; z-index:1; }
.modal-body { padding:20px 24px; }
.modal-footer { padding:16px 24px 24px; border-top:1px solid var(--border); display:flex; gap:10px; justify-content:flex-end; }
.close-btn { width:32px; height:32px; border-radius:50%; background:var(--gray-100); border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:18px; color:var(--gray-500); transition:background .15s; }
.close-btn:hover { background:var(--gray-200); color:var(--gray-900); }

/* ── ADMIN LAYOUT ── */
.admin-layout { display:flex; min-height:100vh; }
.admin-sidebar { width:240px; background:var(--gray-900); flex-shrink:0; display:flex; flex-direction:column; position:fixed; top:0; bottom:0; left:0; z-index:50; transform:translateX(-100%); transition:transform .2s; }
.admin-sidebar.open { transform:translateX(0); }
@media (min-width:900px) { .admin-sidebar { transform:translateX(0); position:sticky; } }
.admin-main { flex:1; min-width:0; padding-left:0; }
@media (min-width:900px) { .admin-main { padding-left:240px; } }
.sidebar-logo { padding:20px; border-bottom:1px solid rgba(255,255,255,.08); }
.sidebar-logo a { font-weight:800; font-size:16px; color:#fff; }
.sidebar-logo a span { color:var(--teal); }
.sidebar-nav { flex:1; padding:12px 8px; display:flex; flex-direction:column; gap:2px; overflow-y:auto; }
.sidebar-link { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:var(--radius); font-size:14px; font-weight:500; color:rgba(255,255,255,.6); text-decoration:none; transition:all .15s; }
.sidebar-link:hover { background:rgba(255,255,255,.08); color:#fff; }
.sidebar-link.active { background:var(--teal); color:#fff; }
.sidebar-link svg { flex-shrink:0; opacity:.8; }
.sidebar-footer { padding:12px 8px; border-top:1px solid rgba(255,255,255,.08); }
.admin-topbar { height:60px; background:#fff; border-bottom:1px solid var(--border); display:flex; align-items:center; padding:0 20px; gap:12px; position:sticky; top:0; z-index:40; }
.admin-topbar h1 { font-size:18px; font-weight:700; flex:1; }
.menu-toggle { display:flex; background:none; border:1px solid var(--border); border-radius:var(--radius); padding:8px; cursor:pointer; flex-direction:column; gap:4px; }
.menu-toggle span { display:block; width:18px; height:2px; background:var(--gray-600); border-radius:2px; }
@media (min-width:900px) { .menu-toggle { display:none; } }
.admin-content { padding:20px; }
@media (min-width:640px) { .admin-content { padding:28px 32px; } }

/* ── STATS CARDS ── */
.stats-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-bottom:24px; }
@media (min-width:640px) { .stats-grid { grid-template-columns:repeat(4,1fr); } }
.stat-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px 18px; }
.stat-card .label { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--gray-400); margin-bottom:6px; }
.stat-card .value { font-size:28px; font-weight:800; color:var(--gray-900); line-height:1; }
.stat-card .sub   { font-size:12px; color:var(--gray-400); margin-top:4px; }

/* ── TABLE ── */
.table-wrap { background:#fff; border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; }
table { width:100%; border-collapse:collapse; }
th { padding:12px 16px; text-align:left; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--gray-500); background:var(--gray-50); border-bottom:1px solid var(--border); }
td { padding:14px 16px; font-size:14px; color:var(--gray-700); border-bottom:1px solid var(--border); vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tr:hover td { background:var(--gray-50); }
.td-title { font-weight:600; color:var(--gray-900); max-width:200px; }
.td-img { width:48px; height:48px; border-radius:6px; object-fit:cover; background:var(--gray-100); }

/* ── PHOTO UPLOAD ── */
.photo-upload-zone { border:2px dashed var(--border); border-radius:var(--radius-lg); padding:32px; text-align:center; cursor:pointer; transition:all .15s; background:var(--gray-50); }
.photo-upload-zone:hover, .photo-upload-zone.drag { border-color:var(--teal); background:var(--teal-faint); }
.photo-upload-zone .icon { font-size:36px; margin-bottom:8px; }
.photo-upload-zone p { font-size:14px; color:var(--gray-500); }
.photo-thumbs { display:grid; grid-template-columns:repeat(auto-fill,minmax(80px,1fr)); gap:8px; margin-top:12px; }
.photo-thumb { position:relative; aspect-ratio:1; border-radius:var(--radius); overflow:hidden; background:var(--gray-100); }
.photo-thumb img { width:100%; height:100%; object-fit:cover; }
.photo-thumb-del { position:absolute; top:4px; right:4px; width:20px; height:20px; border-radius:50%; background:rgba(0,0,0,.6); color:#fff; font-size:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; border:none; }
.photo-thumb-main { position:absolute; bottom:4px; left:4px; font-size:10px; background:var(--teal); color:#fff; padding:1px 5px; border-radius:4px; font-weight:700; }

/* ── COUNTDOWN TIMER ── */
.countdown { display:flex; gap:8px; align-items:center; }
.countdown-block { background:var(--red); color:#fff; border-radius:6px; padding:4px 8px; text-align:center; min-width:44px; }
.countdown-block .num { font-size:20px; font-weight:800; line-height:1; display:block; }
.countdown-block .lbl { font-size:9px; text-transform:uppercase; letter-spacing:.05em; opacity:.8; }
.countdown-sep { font-size:20px; font-weight:700; color:var(--red); margin-bottom:10px; }

/* ── TOAST ── */
.toast-container { position:fixed; bottom:24px; right:24px; z-index:500; display:flex; flex-direction:column; gap:8px; pointer-events:none; }
.toast { background:var(--gray-900); color:#fff; padding:12px 16px; border-radius:var(--radius-lg); font-size:14px; font-weight:500; box-shadow:var(--shadow-lg); display:flex; align-items:center; gap:8px; pointer-events:all; animation:toastin .2s ease; max-width:340px; }
.toast.success { background:var(--green); }
.toast.error   { background:var(--red); }
.toast.info    { background:var(--teal); }
@keyframes toastin { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── PWA INSTALL BANNER ── */
.pwa-banner { position:fixed; bottom:0; left:0; right:0; background:var(--gray-900); color:#fff; padding:14px 20px; display:flex; align-items:center; gap:12px; z-index:150; }
.pwa-banner p { font-size:14px; flex:1; margin:0; color:rgba(255,255,255,.9); }
.pwa-banner .close { color:rgba(255,255,255,.5); cursor:pointer; font-size:20px; flex-shrink:0; background:none; border:none; }

/* ── UTILITY ── */
.hidden { display:none !important; }
.loading { opacity:.6; pointer-events:none; }
.spinner { width:20px; height:20px; border:2px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:spin .6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.text-center { text-align:center; }
.mt-4  { margin-top:16px; }
.mt-6  { margin-top:24px; }
.mb-4  { margin-bottom:16px; }
.flex  { display:flex; align-items:center; }
.gap-2 { gap:8px; }
.gap-3 { gap:12px; }
