/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border: 1px solid var(--c-ink); border-radius: var(--radius-sm);
  background: transparent; color: var(--c-ink);
  font-size: 0.8rem; font-weight: 500; text-decoration: none; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--c-ink); color: #fff; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-primary-ink); }
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { background: var(--c-surface); color: var(--c-ink); }
.btn-danger { border-color: var(--c-danger); color: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 0.72rem; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--c-ink); text-decoration: none;
}
.icon-btn:hover { opacity: 0.55; }
.icon-btn svg { width: 20px; height: 20px; }
.badge-count {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--c-accent); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.badge-count:empty { display: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .field-label { font-size: 0.875rem; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-bg);
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-ink); outline: none; }
.input[aria-invalid='true'], .select[aria-invalid='true'] { border-color: var(--c-danger); }
.field-error { color: var(--c-danger); font-size: 0.8125rem; min-height: 1em; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--c-primary); }

/* ---------- Alerts / notices ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; }
.alert-info { background: var(--c-surface); border-color: var(--c-line); color: var(--c-ink); }
.alert-success { background: var(--c-success-bg); border-color: #bfdfca; color: var(--c-success); }
.alert-warning { background: var(--c-warning-bg); border-color: #f0d9ab; color: #7a4f10; }
.alert-danger { background: var(--c-danger-bg); border-color: #efc3c0; color: var(--c-danger); }
.alert:empty { display: none; }

.demo-bar { background: var(--c-surface); color: var(--c-muted); font-size: 0.75rem; text-align: center; padding: 6px var(--gutter); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--c-bg); border-bottom: 1px solid var(--c-line); }
/* Menu on the left, logo centred, actions on the right. */
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; height: var(--header-h); }
.header-left { display: flex; align-items: center; min-width: 0; }
.logo { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.logo-lockup { display: inline-flex; align-items: center; gap: 8px; }
.logo-mark { width: 46px; height: 46px; flex-shrink: 0; }
.logo-word { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 300; font-size: 1.6rem; color: var(--c-brand); letter-spacing: 0.05em; line-height: 1; }
.logo-footer .logo-full { width: 128px; height: 128px; }
.main-nav { display: none; }
.main-nav a { white-space: nowrap; text-decoration: none; padding: 8px 0; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current='page'] { border-bottom-color: var(--c-ink); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; }
.lang-switch { display: inline-flex; margin-right: 8px; }
.lang-switch button { border: 0; background: transparent; padding: 4px 6px; font-size: 0.75rem; letter-spacing: 0.1em; min-height: 32px; color: var(--c-muted); }
.lang-switch button[aria-pressed='true'] { color: var(--c-ink); text-decoration: underline; text-underline-offset: 4px; }
.menu-toggle { display: inline-grid; }
.header-search { display: none; }
@media (max-width: 599px) {
  .hide-mobile { display: none !important; }
  .logo-mark { width: 40px; height: 40px; }
  .logo-word { font-size: 1.35rem; }
  .header-inner { gap: 4px; }
}
.header-search.open { display: block; padding: 0 0 12px; }
@media (min-width: 960px) {
  .main-nav { display: flex; gap: 28px; }
  .menu-toggle { display: none; }
}

/* ---------- Mobile drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.35); z-index: 60; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 85vw); z-index: 61;
  background: var(--c-bg); padding: 16px; overflow-y: auto; box-shadow: var(--shadow);
}
.drawer nav { display: flex; flex-direction: column; margin-top: 16px; }
.drawer nav a { padding: 14px 0; border-bottom: 1px solid var(--c-line); text-decoration: none; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--c-line); padding: 56px 0 24px; font-size: 0.875rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h4 { font-family: var(--font-body); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.16em; color: var(--c-muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { text-decoration: none; color: var(--c-ink); }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: 0.8125rem; }

/* ---------- Product grid & cards ---------- */
.product-grid { display: grid; gap: 32px 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card { position: relative; display: flex; flex-direction: column; }
.card-media { position: relative; aspect-ratio: 2 / 3; background: var(--c-surface); border-radius: var(--radius); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-media img { transform: scale(1.03); }
/* One centred line under the photo: NAME — price. */
.card-body { padding: 12px 4px 0; text-align: center; font-size: 0.75rem; letter-spacing: 0.08em; }
.card-brand { margin: 0 0 3px; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-muted); }
.card-title { text-transform: uppercase; text-decoration: none; }
.card-title + .price::before { content: '—'; margin: 0 4px 0 2px; color: var(--c-muted); font-weight: 400; }
.card-body .price { font-weight: 400; color: var(--c-muted); gap: 6px; }
.card-note { margin: 4px 0 0; font-size: 0.7rem; color: var(--c-muted); }
.card-title::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.card-desc { display: none; margin: 8px 0 0; color: var(--c-muted); font-size: 0.85rem; letter-spacing: 0; }
.card .wish-btn { position: absolute; top: 4px; right: 4px; z-index: 2; opacity: 0; transition: opacity 0.2s; }
/* The heart appears on hover/focus, and stays visible once saved or on touch screens. */
.card:hover .wish-btn, .card .wish-btn:focus-visible, .card .wish-btn[aria-pressed='true'] { opacity: 1; }
@media (hover: none) { .card .wish-btn { opacity: 1; } }
.card .card-flags { position: absolute; top: 8px; left: 8px; z-index: 1; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.card-flags .tag { background: var(--c-ink); color: #fff; }

.product-grid.list { grid-template-columns: 1fr; gap: 16px; }
.product-grid.list .card { flex-direction: row; gap: 16px; border-bottom: 1px solid var(--c-line); padding-bottom: 16px; }
.product-grid.list .card-body { text-align: left; padding-top: 0; }
.product-grid.list .card-media { width: 140px; flex-shrink: 0; }
.product-grid.list .card-desc { display: block; }
@media (min-width: 720px) { .product-grid.list .card-media { width: 180px; } }

.price { display: inline-flex; gap: 8px; align-items: baseline; font-weight: 600; }
.price .old { color: var(--c-muted); text-decoration: line-through; font-weight: 400; font-size: 0.9em; }
.price .sale { color: var(--c-ink); }

/* ---------- Badges ---------- */
.tag { display: inline-block; padding: 3px 8px; font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.tag-success { background: var(--c-success-bg); color: var(--c-success); }
.tag-warning { background: var(--c-warning-bg); color: #8a5a12; }
.tag-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.tag-neutral { background: var(--c-surface); color: var(--c-muted); border: 1px solid var(--c-line); }
.tag-accent { background: var(--c-accent); color: #fff; }
.tag-primary { background: var(--c-surface); color: var(--c-ink); }

/* ---------- Swatches, sizes, qty ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgb(0 0 0 / 0.2); padding: 0; background: var(--sw); }
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c-ink); }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
/* Sizes are plain letters; the chosen one gets a thin box. */
.size-btn { min-width: 42px; min-height: 40px; padding: 0 10px; border: 1px solid transparent; background: none; font-size: 0.8rem; letter-spacing: 0.06em; }
.size-btn:hover { border-color: var(--c-line); }
.size-btn[aria-pressed='true'] { border-color: var(--c-ink); }
.size-btn:disabled { color: #b5aea5; border-color: transparent; cursor: not-allowed; text-decoration: line-through; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--c-line); border-radius: var(--radius-sm); }
.qty button { width: 38px; height: 40px; border: 0; background: transparent; font-size: 1.1rem; }
.qty button:disabled { opacity: 0.35; cursor: not-allowed; }
.qty input { width: 44px; height: 40px; border: 0; text-align: center; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--c-ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; animation: toast-in 0.2s ease-out; }
.toast a { color: #fff; font-weight: 600; margin-left: auto; white-space: nowrap; }
.toast.error { background: var(--c-danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-line); margin-bottom: 24px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 16px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected='true'] { border-bottom-color: var(--c-ink); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table th { background: var(--c-surface); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table img { width: 44px; height: 56px; object-fit: cover; border-radius: 4px; background: var(--c-surface); }

/* ---------- Misc ---------- */
.panel { border: 1px solid var(--c-line); border-radius: var(--radius); padding: 20px; background: var(--c-bg); }
.panel-muted { background: var(--c-surface); border-color: transparent; }
.empty { text-align: center; padding: 48px 16px; color: var(--c-muted); }
.empty h2 { color: var(--c-ink); }
.spinner { width: 28px; height: 28px; margin: 48px auto; border: 3px solid var(--c-line); border-top-color: var(--c-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.breadcrumb { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted); margin: 24px 0; }
.breadcrumb a { color: var(--c-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-ink); }
dialog.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgb(0 0 0 / 0.4); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--c-line); position: sticky; top: 0; background: var(--c-bg); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.3rem; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--c-line); position: sticky; bottom: 0; background: var(--c-bg); }
