@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Manrope:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #17140F;
  --ink-soft: #211D16;
  --stone: #2B2620;
  --stone-light: #352F26;
  --line: #4A4030;
  --brass: #B8894A;
  --brass-bright: #D9B36C;
  --ivory: #F3ECDD;
  --ivory-dim: #C9BFA9;
  --garnet: #6E2A34;
  --garnet-bright: #8C3B47;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--ivory);
  font-family: 'Manrope', sans-serif;
  min-height: 100vh;
}
.font-display { font-family: 'Cormorant Garamond', serif; }
.font-mono { font-family: 'IBM Plex Mono', monospace; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }
input, textarea { font-family: inherit; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--ink); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; background: none; }
.brand img { height: 32px; width: 32px; object-fit: contain; border-radius: 4px; }
.brand-name { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; color: var(--ivory); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: none; padding: 8px; border-radius: 6px; position: relative; display: flex; }
.icon-btn:hover { background: var(--stone); }
.cart-badge {
  position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--garnet); color: var(--ivory); font-size: 10px; display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
}

/* Hero */
.hero {
  position: relative; overflow: hidden; padding: 100px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  background-size: cover; background-position: center;
}
.hero-glint {
  position: absolute; top: -20%; left: 0; width: 35%; height: 140%;
  background: linear-gradient(90deg, transparent, rgba(217,179,108,0.16), transparent);
  animation: glint 7s ease-in-out infinite; pointer-events: none;
}
@keyframes glint { 0% { transform: translateX(-160%) rotate(10deg); } 100% { transform: translateX(160%) rotate(10deg); } }
@media (prefers-reduced-motion: reduce) { .hero-glint { animation: none; } }
.hero-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass-bright); margin-bottom: 16px; }
.hero h1 { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 3.4rem; margin: 0 0 16px; color: var(--ivory); }
.hero p { max-width: 460px; color: var(--ivory-dim); font-size: 0.95rem; }
.hero-cta { margin-top: 32px; padding: 12px 26px; border-radius: 4px; background: var(--brass); color: var(--ivory); font-weight: 600; font-size: 0.9rem; }
.hero-cta:hover { background: var(--brass-bright); }

/* Catalog */
.catalog { padding: 48px 20px; max-width: 1200px; margin: 0 auto; }
.categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip { font-family: 'IBM Plex Mono', monospace; font-size: 12px; padding: 6px 12px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.03em; background: var(--stone); color: var(--ivory); border: 1px solid var(--line); }
.chip.active { background: var(--brass); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.empty-msg { text-align: center; padding: 60px 0; color: var(--ivory-dim); }

.card {
  position: relative; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column;
  background: var(--stone); border: 1px solid var(--line); transition: transform 0.3s;
}
.card:hover { transform: translateY(-4px); }
.card-img { position: relative; width: 100%; aspect-ratio: 1/1; background: var(--ink-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-img img { transform: scale(1.05); }
.tag-hole { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.sold-out { position: absolute; inset: 0; background: rgba(23,20,15,0.6); display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ivory-dim); }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; line-height: 1.2; }
.card-cat { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--ivory-dim); }
.card-footer { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-price { font-family: 'IBM Plex Mono', monospace; color: var(--brass-bright); }
.add-btn { font-size: 12px; padding: 8px 12px; border-radius: 4px; background: var(--brass); color: var(--ivory); }
.add-btn:hover { background: var(--brass-bright); }
.add-btn:disabled { background: var(--stone-light); opacity: 0.4; cursor: not-allowed; }

footer.site-footer { text-align: center; padding: 32px 20px; border-top: 1px solid var(--line); font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ivory-dim); }

/* Cart drawer */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; right: 0; top: 0; height: 100%; width: 100%; max-width: 380px;
  background: var(--ink); border-left: 1px solid var(--line); z-index: 45;
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s;
}
.drawer.open { transform: translateX(0); }
.drawer-header { padding: 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer-header h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.cart-item { display: flex; gap: 12px; }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; background: var(--stone); }
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.qty-controls { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.qty-btn { width: 24px; height: 24px; border-radius: 4px; background: var(--stone-light); color: var(--ivory); display: flex; align-items: center; justify-content: center; }
.drawer-footer { padding: 20px; border-top: 1px solid var(--line); }
.drawer-total { display: flex; justify-content: space-between; margin-bottom: 16px; }
.btn-primary { width: 100%; padding: 12px; border-radius: 4px; background: var(--garnet); color: var(--ivory); font-weight: 600; font-size: 0.9rem; }
.btn-primary:hover { background: var(--garnet-bright); }
.btn-gold { width: 100%; padding: 12px; border-radius: 4px; background: var(--brass); color: var(--ivory); font-weight: 600; font-size: 0.9rem; }
.btn-gold:hover { background: var(--brass-bright); }
.btn-gold:disabled { opacity: 0.3; cursor: not-allowed; }

/* Modal (checkout) */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; background: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
.modal-header { padding: 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; margin: 0; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.field { width: 100%; padding: 10px 12px; border-radius: 4px; background: var(--stone); color: var(--ivory); border: 1px solid var(--line); outline: none; font-size: 0.9rem; }
.field::placeholder { color: var(--ivory-dim); }
textarea.field { resize: none; }
.method-row { display: flex; gap: 8px; }
.method-btn { flex: 1; padding: 10px; border-radius: 4px; background: var(--stone); color: var(--ivory); border: 1px solid var(--line); }
.method-btn.active { background: var(--brass); }
.pix-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; }
.pix-qr { width: 150px; height: 150px; border-radius: 4px; background: var(--ivory); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.pix-code { font-family: 'IBM Plex Mono', monospace; font-size: 10px; word-break: break-all; text-align: center; color: var(--ivory-dim); padding: 0 8px; }
.card-row { display: flex; gap: 12px; }
.review-list { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; }
.review-line { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--ivory-dim); }
.review-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.confirm-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 16px 0; }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--brass); display: flex; align-items: center; justify-content: center; }

/* Admin */
.admin-login { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 120px 20px; }
.admin-login .field { max-width: 280px; text-align: center; }
.admin-error { color: var(--garnet-bright); font-size: 0.85rem; }
.admin-wrap { padding: 32px 20px; max-width: 1100px; margin: 0 auto; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 4px; background: var(--stone); color: var(--ivory); border: 1px solid var(--line); font-size: 0.9rem; }
.tab-btn.active { background: var(--brass); }
.admin-grid { display: grid; gap: 24px; }
@media (min-width: 800px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
.panel { padding: 16px; border-radius: 6px; background: var(--stone); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.panel h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; margin: 0; }
.uploader { border: 1px dashed var(--line); border-radius: 4px; background: var(--stone); aspect-ratio: 1/1; max-width: 160px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; position: relative; }
.uploader.wide { aspect-ratio: 16/9; max-width: none; }
.uploader img { width: 100%; height: 100%; object-fit: cover; }
.uploader-placeholder { color: var(--ivory-dim); font-size: 12px; text-align: center; }
.form-row { display: flex; gap: 12px; }
.product-list { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.product-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 4px; background: var(--stone); border: 1px solid var(--line); }
.product-row img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--ink-soft); }
.product-row .info { flex: 1; min-width: 0; }
.product-row .info p { margin: 0; }
.small-btn { font-size: 12px; padding: 6px 10px; border-radius: 4px; background: var(--stone-light); color: var(--ivory); }
.order-card { padding: 14px; border-radius: 4px; background: var(--stone); border: 1px solid var(--line); }
.order-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ivory-dim); }
.pill { font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 3px 8px; border-radius: 3px; background: var(--brass); color: var(--ivory); }
.label { font-size: 12px; color: var(--ivory-dim); margin-bottom: 2px; }
