/* ==========================================================================
   Kumaas — components.css
   Shared UI: buttons, announcement bar, header, navigation, search panel,
   mobile drawer, footer, empty states and skeletons.
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-6);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; transition: transform var(--t-fast) var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn--primary { background: var(--c-burgundy); color: var(--c-ivory); }
.btn--primary:hover { background: var(--c-wine); }

.btn--light { background: var(--c-ivory); color: var(--c-wine); }
.btn--light:hover { background: var(--c-white); }

.btn--outline { border-color: var(--c-burgundy); color: var(--c-burgundy); }
.btn--outline:hover { background: var(--c-burgundy); color: var(--c-ivory); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--c-burgundy);
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.text-link:hover { color: var(--c-wine); }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--c-wine);
  transition: background var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--c-blush-soft); }
.icon-btn svg { width: 22px; height: 22px; }

.badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--c-burgundy);
  color: var(--c-ivory);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.badge[hidden] { display: none; }

/* ---------- Announcement bar ---------- */
.announce {
  background: var(--c-wine);
  color: var(--c-cream);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: var(--sp-2) var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 247, 0.94);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-5);
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-burgundy);
}
.logo__mark { width: 38px; height: 38px; flex-shrink: 0; }
.logo__word {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

/* Primary navigation */
.nav { justify-self: center; }
.nav__list { display: flex; align-items: center; gap: var(--sp-1); list-style: none; }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav__link:hover { color: var(--c-burgundy); background: var(--c-blush-soft); }
.nav__link[aria-current="page"] { background: var(--c-burgundy); color: var(--c-ivory); }
.nav__link svg { width: 14px; height: 14px; transition: transform var(--t-fast) var(--ease); }

.nav__item--has-menu { position: relative; }
.nav__item--has-menu[data-open="true"] .nav__link svg { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  translate: -50% 0;
  min-width: 240px;
  padding: var(--sp-3);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease),
    visibility var(--t-fast);
}
.nav__item--has-menu[data-open="true"] .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.dropdown a:hover { background: var(--c-blush-soft); color: var(--c-burgundy); }
.dropdown a.is-sale { color: var(--c-burgundy); font-weight: 500; }

.header-actions { display: flex; align-items: center; gap: var(--sp-1); }
.menu-toggle { display: none; }

/* Search panel */
.search-panel {
  border-top: 1px solid var(--c-line);
  background: var(--c-ivory);
  padding-block: var(--sp-5);
}
.search-panel[hidden] { display: none; }
.search-form {
  display: flex;
  gap: var(--sp-3);
  max-width: 720px;
  margin-inline: auto;
}
.search-form input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 var(--sp-5);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-white);
}
.search-form input:focus-visible { border-color: var(--c-burgundy); }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
}
.drawer[data-open="true"] { visibility: visible; }
.drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(36, 25, 28, 0.45);
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}
.drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 360px);
  display: flex;
  flex-direction: column;
  background: var(--c-ivory);
  transform: translateX(-100%);
  transition: transform var(--t) var(--ease);
  overflow-y: auto;
}
.drawer[data-open="true"] .drawer__scrim { opacity: 1; }
.drawer[data-open="true"] .drawer__panel { transform: translateX(0); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-line);
}
.drawer__body { padding: var(--sp-4) var(--sp-5) var(--sp-7); }
.drawer__group + .drawer__group { margin-top: var(--sp-5); }
.drawer__label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.drawer__body ul { list-style: none; }
.drawer__body a {
  display: block;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-line);
  font-size: var(--fs-md);
}
.drawer__body a[aria-current="page"] { color: var(--c-burgundy); font-weight: 500; }

@media (max-width: 960px) {
  .nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .site-header__inner { grid-template-columns: auto 1fr auto; gap: var(--sp-2); }
  .logo { justify-self: center; grid-column: 2; }
  .menu-toggle { grid-column: 1; grid-row: 1; }
  .header-actions { grid-column: 3; }
}
@media (max-width: 480px) {
  :root { --header-h: 64px; }
  .logo__word { font-size: 1.6rem; }
  .logo__mark { width: 30px; height: 30px; }
  .header-actions .icon-btn--account { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-wine);
  color: var(--c-cream);
}
.site-footer a:hover { color: var(--c-white); text-decoration: underline; text-underline-offset: 3px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--sp-7);
  padding-block: var(--sp-8) var(--sp-7);
}
.footer-brand .logo { color: var(--c-ivory); }
.footer-brand p { margin-top: var(--sp-4); max-width: 34ch; color: var(--c-blush); font-size: var(--fs-sm); }
.footer-col h2 {
  margin-bottom: var(--sp-4);
  font-family: var(--f-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-champagne);
}
.footer-col ul { list-style: none; display: grid; gap: var(--sp-2); font-size: var(--fs-sm); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: var(--sp-5);
  border-top: 1px solid rgba(232, 201, 199, 0.2);
  font-size: var(--fs-xs);
  color: var(--c-blush);
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Empty / status states ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-5);
  border: 1px dashed var(--c-blush);
  border-radius: var(--radius);
  background: var(--c-white);
  text-align: center;
}
.empty-state svg { width: 44px; height: 44px; color: var(--c-champagne); }
.empty-state h3 { font-size: var(--fs-lg); }
.empty-state p { color: var(--c-muted); max-width: 46ch; font-size: var(--fs-sm); }

.skeleton {
  background: linear-gradient(100deg, var(--c-cream) 30%, #fff3f6 50%, var(--c-cream) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- Notice (setup / dev information) ---------- */
.notice {
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--c-champagne);
  background: var(--c-cream);
  font-size: var(--fs-sm);
  color: var(--c-text);
}

/* ---------- Breadcrumbs ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; font-size: var(--fs-xs); color: var(--c-muted); }
.crumbs li + li::before { content: "/"; margin-right: var(--sp-2); color: var(--c-blush); }
.crumbs a:hover { color: var(--c-burgundy); }
.crumbs [aria-current] { color: var(--c-text); }

/* ---------- Page header ---------- */
.page-head {
  padding-block: var(--sp-6) var(--sp-5);
  background: linear-gradient(180deg, var(--c-blush-soft), var(--c-ivory));
  border-bottom: 1px solid var(--c-line);
}
.page-head h1 { margin-top: var(--sp-3); font-size: var(--fs-xl); }
.page-head p { margin-top: var(--sp-2); color: var(--c-muted); max-width: 60ch; }
.page-head--slim { padding-block: var(--sp-5) var(--sp-4); }

/* ---------- Quantity stepper (product page, cart) ---------- */
.qty {
  display: inline-flex;
  align-items: center;
  height: 52px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-white);
}
.qty button { width: 44px; height: 100%; display: grid; place-items: center; color: var(--c-wine); border-radius: var(--radius-pill); }
.qty button:disabled { color: var(--c-line); cursor: not-allowed; }
.qty button svg { width: 16px; height: 16px; }
.qty input {
  width: 40px;
  text-align: center;
  border: 0;
  background: transparent;
  font-weight: 500;
  -moz-appearance: textfield;
}
.qty input::-webkit-inner-spin-button,
.qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 500; color: var(--c-text); }
.field .opt-tag { font-weight: 400; color: var(--c-muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-white);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast);
}
.field textarea { min-height: 96px; padding: var(--sp-3) var(--sp-4); resize: vertical; }
.field select {
  appearance: none;
  padding-right: 40px;
  background: var(--c-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B0174F' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 14px;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--c-blush); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { border-color: var(--c-burgundy); }
.field [aria-invalid="true"] { border-color: var(--c-error); background: #fff8f8; }
.field__hint { font-size: var(--fs-xs); color: var(--c-muted); }
.field__error { font-size: var(--fs-xs); color: var(--c-error); }
.field__error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-4); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer contact (from Admin → Settings) */
.footer-contact p { margin-top: var(--sp-4); font-size: var(--fs-sm); color: var(--c-blush); line-height: 1.9; }
.footer-contact a { color: var(--c-cream); }
.footer-social a { color: var(--c-champagne-soft); }
