:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-muted: #f3f0ea;
  --border: #e6e1d8;
  --border-strong: #d4cdc0;
  --text: #18181b;
  --text-muted: #57534e;
  --text-subtle: #78716c;
  --primary: #18181b;
  --primary-hover: #27272a;
  --amazon: #ff9900;
  --amazon-hover: #e88900;
  --amazon-ink: #111827;
  --accent-soft: #fff4e0;
  --accent-text: #9a5200;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 8px 24px rgba(24, 24, 27, 0.07);
  --shadow-lg: 0 20px 50px rgba(24, 24, 27, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--text);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text small {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-left: auto;
}

.header-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.header-search input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: var(--surface-muted);
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 0.93rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.btn-amazon {
  background: var(--amazon);
  color: var(--amazon-ink);
  font-weight: 700;
}

.btn-amazon:hover {
  background: var(--amazon-hover);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: #fecaca;
}

.btn-danger-outline:hover {
  background: var(--danger-bg);
}

/* Hero */
.hero-section {
  padding: 32px 0 22px;
}

.hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-copy {
  max-width: 680px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero-kicker .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amazon);
}

.hero-copy h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.hero-bio {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 62ch;
}

.hero-meta {
  margin-top: 14px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
}

.social-chip:hover {
  border-color: var(--text);
}

.hero-callout {
  max-width: 340px;
  flex: 1 1 280px;
}

.callout-card {
  background: var(--accent-soft);
  border: 1px solid #f7d8a3;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.84rem;
  color: #5c3400;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--accent-text);
}

.callout-card p {
  margin: 0;
}

/* Toolbar */
.toolbar-section {
  padding: 6px 0 18px;
}

.toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  max-width: 100%;
  scrollbar-width: thin;
}

.cat-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.cat-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.result-count {
  font-size: 0.84rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.sort-select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

/* Catalog Grid */
.catalog-section {
  padding-bottom: 56px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.product-card:hover .card-media img {
  transform: scale(1.03);
}

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pill-accent {
  background: var(--amazon);
  color: var(--amazon-ink);
}

.pill-dark {
  background: rgba(24, 24, 27, 0.86);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.pill-muted {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.card-admin-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: #ffffff;
}

.icon-btn.danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
}

.card-category {
  font-weight: 600;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-price {
  color: var(--text-subtle);
  font-weight: 600;
}

.card-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title:hover {
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-desc {
  margin: 0 0 16px;
  font-size: 0.87rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.card-actions .btn-amazon {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.card-actions .btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  flex-shrink: 0;
}

/* Empty State & Load More */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.disclosure-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 82ch;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.footer-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-subtle);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
}

.footer-admin-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 24, 27, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  overflow-y: auto;
}

.modal-form {
  max-width: 680px;
}

.modal-detail {
  max-width: 860px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.modal-close {
  border: none;
  background: var(--surface-muted);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-detail .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
}

.detail-media {
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 300px;
}

.detail-media img {
  max-height: 400px;
  width: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.detail-body {
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.25;
}

.detail-price-note {
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-text);
}

.detail-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-line;
  margin-bottom: 24px;
  flex: 1;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-actions .btn-amazon {
  flex: 1;
  min-width: 180px;
}

/* Form Styles */
.form-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.req {
  color: var(--danger);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

.field-hint {
  font-size: 0.77rem;
  color: var(--text-subtle);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.image-input-grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: start;
}

.image-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-dropzone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone:hover {
  border-color: var(--text);
  background: var(--surface-muted);
}

.image-preview-box {
  width: 120px;
  height: 100px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.76rem;
  color: var(--text-subtle);
}

.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.87rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 3px;
  accent-color: var(--text);
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.publish-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
}

.publish-box h3 {
  margin: 0 0 6px;
  font-size: 0.96rem;
  font-family: var(--font-display);
}

.publish-desc {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-btn-label {
  margin: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 80;
  background: var(--text);
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: 340px;
}

/* Responsive */
@media (max-width: 780px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .header-actions {
    margin-left: auto;
  }

  .hide-sm {
    display: none;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-media {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 220px;
  }

  .form-row-2,
  .form-row-3,
  .image-input-grid {
    grid-template-columns: 1fr;
  }

  .image-preview-box {
    width: 100%;
    height: 150px;
  }
}
