/* ============================================================
   Oliver's Shop — shop.css
   Design tokens match the main site's purple/yellow palette.
   ============================================================ */

:root {
  --purple:        #6b21a8;
  --purple-light:  #9333ea;
  --purple-mid:    #7e22ce;
  --pink:          #ec4899;
  --yellow:        #fbbf24;
  --yellow-dark:   #d97706;
  --white-soft:    #fefce8;
  --card-radius:   14px;
  --surface:       rgba(255,255,255,0.06);
  --surface-hover: rgba(255,255,255,0.1);
  --border:        rgba(255,255,255,0.12);
  --text:          #f1f5f9;
  --text-dim:      rgba(255,255,255,0.55);
  --red:           #f87171;
  --green:         #4ade80;
}

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

html { scroll-behavior: smooth; }

body {
  background: linear-gradient(160deg, #2e1065 0%, #1e1b4b 40%, #0f0a1e 100%);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Decorative blobs */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: min(400px,90vw); height: min(400px,90vw);
  background: var(--purple-light);
  top: -100px; right: -80px;
}
body::after {
  width: min(320px,70vw); height: min(320px,70vw);
  background: var(--yellow);
  bottom: -80px; left: -60px;
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,8,36,0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.site-logo {
  font-size: 1.2rem; font-weight: 800;
  color: var(--yellow);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.site-logo:hover { color: #fde68a; }
.site-nav { display: flex; align-items: center; gap: 14px; }
.site-nav a {
  color: var(--text-dim); font-size: 14px; text-decoration: none;
  transition: color .15s;
}
.site-nav a:hover { color: var(--text); }
.nav-admin {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px !important;
}
.nav-admin:hover { background: var(--surface-hover) !important; }
.nav-logout { color: var(--red) !important; }

/* ── Layout ──────────────────────────────────────────────── */
.page-wrap {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: 28px 20px 60px;
}
.page-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800; color: var(--white-soft);
  margin-bottom: 6px;
}
.page-subtitle { color: var(--text-dim); font-size: 15px; margin-bottom: 24px; }

/* ── Flash messages ──────────────────────────────────────── */
.flash {
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; margin-bottom: 18px; font-weight: 500;
}
.flash-success { background: rgba(74,222,128,.15); color: var(--green); border: 1px solid rgba(74,222,128,.3); }
.flash-error   { background: rgba(248,113,113,.15); color: var(--red);   border: 1px solid rgba(248,113,113,.3); }

/* ── Search / filter bar ─────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 28px;
  align-items: center;
}
.filter-bar form { display: contents; }
.search-input {
  flex: 1 1 240px; min-width: 180px;
  padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 15px;
  outline: none; transition: border-color .15s;
}
.search-input:focus { border-color: var(--purple-light); }
.search-input::placeholder { color: var(--text-dim); }
.filter-select {
  padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px;
  outline: none; cursor: pointer; transition: border-color .15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.filter-select:focus { border-color: var(--purple-light); }
.filter-btn {
  padding: 10px 20px;
  background: var(--purple-mid); border: none; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: filter .15s;
}
.filter-btn:hover { filter: brightness(1.15); }
.filter-clear {
  padding: 10px 16px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-dim);
  font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s;
}
.filter-clear:hover { background: var(--surface); color: var(--text); }

/* Category pills */
.cat-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.cat-pill {
  padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 99px;
  background: var(--surface); color: var(--text-dim);
  font-size: 13px; text-decoration: none; transition: all .15s;
}
.cat-pill:hover { background: var(--surface-hover); color: var(--text); }
.cat-pill.active {
  background: var(--purple-mid); border-color: var(--purple-mid);
  color: #fff; font-weight: 600;
}

/* ── Product grid ────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  text-decoration: none; color: inherit;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  border-color: var(--purple-light);
}
.product-card-img {
  width: 100%; aspect-ratio: 1/1;
  object-fit: cover; display: block;
  background: rgba(0,0,0,0.25);
}
.product-card-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 2rem;
}
.product-card-body {
  padding: 14px; flex: 1; display: flex; flex-direction: column;
}
.product-card-cat {
  font-size: 11px; color: var(--yellow); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 4px; font-weight: 600;
}
.product-card-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 4px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-card-desc {
  font-size: 13px; color: var(--text-dim); margin-bottom: 10px;
  line-height: 1.45; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.product-price {
  font-size: 16px; font-weight: 800; color: var(--yellow);
}
.product-badge-featured {
  font-size: 10px; padding: 3px 8px; border-radius: 99px;
  background: rgba(251,191,36,.18); color: var(--yellow);
  border: 1px solid rgba(251,191,36,.3); font-weight: 700;
}

/* No results */
.no-results {
  text-align: center; padding: 60px 20px;
  color: var(--text-dim); font-size: 15px;
}
.no-results span { display: block; font-size: 2.5rem; margin-bottom: 12px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
}
.page-link {
  padding: 8px 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 14px; text-decoration: none;
  transition: background .15s, color .15s;
}
.page-link:hover { background: var(--surface-hover); color: var(--text); }
.page-link.active { background: var(--purple-mid); border-color: var(--purple-mid); color: #fff; font-weight: 700; }

/* ── Product detail ──────────────────────────────────────── */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 700px) { .product-detail { grid-template-columns: 1fr; } }
.product-gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-main {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0,0,0,0.2); cursor: pointer;
}
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumb {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 8px; border: 2px solid transparent;
  cursor: pointer; transition: border-color .15s; opacity: .7;
}
.gallery-thumb.active, .gallery-thumb:hover {
  border-color: var(--purple-light); opacity: 1;
}
.product-info-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.product-info-cat { font-size: 12px; color: var(--yellow); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; margin-bottom: 12px; }
.product-info-price { font-size: 2rem; font-weight: 900; color: var(--yellow); margin-bottom: 16px; }
.product-info-desc { color: var(--text-dim); line-height: 1.7; font-size: 15px; white-space: pre-line; margin-bottom: 24px; }
.product-meta-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.product-meta-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.product-meta-table td:first-child { color: var(--text-dim); width: 100px; }
.product-meta-table td:last-child { font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 14px; text-decoration: none; margin-bottom: 20px; transition: color .15s; }
.back-link:hover { color: var(--text); }

/* ── Admin ───────────────────────────────────────────────── */
.admin-wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; position: relative; z-index: 1; }
.admin-title { font-size: 1.5rem; font-weight: 800; color: var(--white-soft); margin-bottom: 20px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.admin-header h1 { font-size: 1.5rem; font-weight: 800; color: var(--white-soft); margin: 0; }
.admin-nav {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
}
.admin-nav a {
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); transition: all .15s;
}
.admin-nav a:hover { background: var(--surface-hover); color: var(--text); }
.admin-nav a.active { background: var(--purple-mid); border-color: var(--purple-mid); color: #fff; }
.admin-nav a.danger { border-color: rgba(248,113,113,.35); color: var(--red); }
.admin-nav a.danger:hover { background: rgba(248,113,113,.15); }

/* Admin table */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 14px; color: var(--text);
}
.admin-table th {
  text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle;
}
.admin-table tr:hover td { background: var(--surface); }
.admin-table .thumb {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border); display: block;
}
.admin-table .thumb-placeholder {
  width: 44px; height: 44px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-dim);
}
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.badge-pub  { background: rgba(74,222,128,.15); color: var(--green);   border: 1px solid rgba(74,222,128,.3); }
.badge-draft{ background: rgba(255,255,255,.08); color: var(--text-dim);border: 1px solid var(--border); }
.badge-feat { background: rgba(251,191,36,.15);  color: var(--yellow);  border: 1px solid rgba(251,191,36,.3); }

/* Btn */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 9px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  border: none; transition: filter .15s, opacity .15s; white-space: nowrap;
}
.btn-primary { background: var(--purple-mid); color: #fff; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-yellow  { background: var(--yellow); color: #000; }
.btn-yellow:hover { filter: brightness(1.1); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-danger { background: rgba(248,113,113,.2); border: 1px solid rgba(248,113,113,.4); color: var(--red); }
.btn-danger:hover { background: rgba(248,113,113,.35); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

/* Form */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.form-group label span { color: var(--red); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-size: 15px;
  outline: none; transition: border-color .15s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--purple-light); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { appearance: none; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text-dim); }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--purple-light); cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 24px; }

/* Image upload zone */
.upload-zone {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 28px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--purple-light); background: var(--surface-hover); }
.upload-zone p { color: var(--text-dim); font-size: 14px; margin-top: 8px; }
.upload-zone input[type=file] { display: none; }
.upload-icon { font-size: 2rem; }

/* Image list in edit */
.img-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.img-item {
  position: relative; width: 90px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--surface); cursor: grab;
}
.img-item img { width: 90px; height: 90px; object-fit: cover; display: block; }
.img-item-actions {
  position: absolute; top: 4px; right: 4px;
  display: flex; gap: 4px;
}
.img-delete-btn {
  background: rgba(0,0,0,.65); border: none; border-radius: 50%;
  color: var(--red); width: 22px; height: 22px; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.img-delete-btn:hover { background: rgba(248,113,113,.4); }
.img-primary-badge {
  position: absolute; bottom: 4px; left: 4px;
  background: var(--yellow); color: #000; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
}
.img-sort-handle { font-size: 10px; color: var(--text-dim); text-align: center; padding: 4px 0 6px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.login-box {
  width: 320px; padding: 32px;
  background: rgba(0,0,0,.4); border: 1px solid var(--border);
  border-radius: 16px; backdrop-filter: blur(10px);
}
.login-box h1 { font-size: 1.3rem; font-weight: 800; color: var(--white-soft); margin-bottom: 4px; }
.login-box p  { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; }
.login-box label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 5px; }
.login-box input[type=password] {
  width: 100%; padding: 11px 14px; margin-bottom: 12px;
  background: rgba(0,0,0,.3); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-size: 15px;
}
.login-box input[type=password]:focus { outline: none; border-color: var(--purple-light); }
.login-box .submit-btn {
  width: 100%; padding: 12px;
  background: var(--yellow); color: #000; border: none;
  border-radius: 9px; font-weight: 800; font-size: 16px;
  cursor: pointer; transition: filter .15s;
}
.login-box .submit-btn:hover { filter: brightness(1.08); }
.login-error { color: var(--red); font-size: 13px; margin-bottom: 10px; font-weight: 500; }

/* Stats */
.stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.stat-card {
  flex: 1 1 140px; text-align: center; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--yellow); }
.stat-lbl { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }

@media (max-width: 480px) {
  .admin-wrap { padding: 16px 12px 40px; }
  .form-card  { padding: 18px; }
}
