/* ============================================================================
   HoneyStore — Components
   ========================================================================== */

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm);
  letter-spacing: 0.01em; line-height: 1;
  padding: 0.85rem 1.5rem; border-radius: var(--r-pill);
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t), background var(--t), color var(--t), border-color var(--t);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  color: #fff;
  background: var(--honey-800);
  box-shadow: none;
}
.btn-primary:hover:not(:disabled) { color: #fff; background: var(--honey-700); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.btn-secondary {
  color: var(--brown-900); background: transparent; border-color: rgba(58,42,24,0.28);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--honey-800); color: var(--honey-800); background: rgba(255,255,255,0.45); }

.btn-ghost { color: var(--brown-700); padding-inline: 0.75rem; }
.btn-ghost:hover:not(:disabled) { color: var(--honey-800); }

.btn-dark { color: var(--honey-100); background: var(--brown-800); }
.btn-dark:hover:not(:disabled) { color: #fff; background: var(--brown-900); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-lg { padding: 1.05rem 2rem; font-size: var(--text-base); }
.btn-sm { padding: 0.55rem 1rem; font-size: var(--text-xs); }
.btn-block { width: 100%; }
.btn-icon { padding: 0.7rem; border-radius: var(--r-pill); }

/* ── Badges & tags ── */
.badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-weight: 700; font-size: var(--text-xs); letter-spacing: 0.03em;
  padding: 0.3rem 0.7rem; border-radius: var(--r-pill);
  background: var(--brown-800); color: var(--honey-100);
}
.badge-sale { background: var(--danger); color: #fff; }
.badge-soft { background: var(--honey-100); color: var(--honey-800); }
.badge-low { background: #FBF0DA; color: var(--honey-800); }
.badge-out { background: #EFE7DA; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-weight: 600; font-size: var(--text-sm);
  padding: 0.5rem 1rem; border-radius: var(--r-pill);
  background: var(--paper); border: 1.5px solid var(--line); color: var(--brown-700);
  cursor: pointer; transition: all var(--t-fast);
}
.pill:hover { border-color: var(--honey-400); color: var(--honey-800); }
.pill[aria-pressed="true"], .pill.is-active {
  background: var(--brown-800); border-color: var(--brown-800); color: var(--honey-100);
}

/* ── Forms ── */
.field { margin-bottom: var(--sp-4); }
.label { display: block; font-weight: 700; font-size: var(--text-sm); color: var(--brown-800); margin-bottom: var(--sp-2); }
.input, .select, .textarea {
  width: 100%; padding: 0.85rem 1rem; font-size: var(--text-base);
  background: var(--paper); color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--honey-500);
  box-shadow: 0 0 0 4px rgba(224, 160, 60, 0.16); background: var(--paper-2);
}
.textarea { resize: vertical; min-height: 110px; line-height: var(--leading-normal); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A5C38' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem;
}
.field-error { color: var(--danger); font-size: var(--text-sm); margin-top: var(--sp-1); }
.input.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.hint { color: var(--muted); font-size: var(--text-sm); margin-top: var(--sp-1); }

/* ── Alerts ── */
.alert { padding: 0.85rem 1.1rem; border-radius: var(--r-md); font-size: var(--text-sm); border: 1.5px solid transparent; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #F2C9C6; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #C7E2C9; }
.alert-info { background: var(--info-bg); color: var(--honey-800); border-color: var(--honey-200); }

/* ── Cards ── */
.card {
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--sp-6); }

/* ── Product card ── */
.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow-xs);
  min-height: 420px;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line); }
.product-card__media {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 1 / 0.82; overflow: hidden; padding: var(--sp-8) var(--sp-6);
  background: #C69A6A;
}
.product-card__media img { width: 100%; height: 100%; max-width: 76%; max-height: 80%; object-fit: contain; transition: transform var(--t-slow) var(--ease); }
.product-card:hover .product-card__media img { transform: scale(1.06); }
.product-card__badges { position: absolute; top: var(--sp-3); left: var(--sp-3); right: var(--sp-3); display: flex; flex-direction: row; gap: var(--sp-2); align-items: flex-start; pointer-events: none; }
.product-card__body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4) var(--sp-4) var(--sp-5); flex: 1; min-height: 162px; }
.product-card__cat { min-height: 1rem; font-size: var(--text-xs); letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 600; }
.product-card__name { font-family: var(--font-display); font-size: var(--text-lg); color: var(--ink); line-height: var(--leading-snug); min-height: 2.45em; }
.product-card__name a:hover { color: var(--honey-800); }
.product-card__foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); padding-top: var(--sp-3); }
.product-card__action { display: inline-grid; place-items: center; width: 38px; height: 38px; color: var(--honey-800); }
.product-card__action:hover { color: var(--honey-600); }
.product-card__action svg { width: 22px; height: 22px; }

/* ── Price ── */
.price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0.1rem 0.55rem; font-family: var(--font-display); min-width: 0; }
.price__now { font-weight: 600; font-size: var(--text-xl); color: var(--brown-900); }
.price__was { font-family: var(--font-body); font-size: var(--text-sm); color: var(--muted); text-decoration: line-through; }
.price__from { font-family: var(--font-body); font-size: var(--text-xs); color: var(--muted); font-weight: 700; }
.price__now, .price__was, .price__from { white-space: nowrap; }

@media (max-width: 520px) {
  .product-card { min-height: 398px; }
  .product-card__media { padding: var(--sp-6) var(--sp-4); }
  .product-card__body { min-height: 158px; padding-inline: var(--sp-3); }
  .product-card__name { font-size: var(--text-base); }
}

/* ── Rating stars ── */
.stars { display: inline-flex; gap: 1px; color: var(--star); line-height: 1; }
.stars svg { width: 1em; height: 1em; }
.stars--sm { font-size: 0.9rem; }
.rating-row { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--text-sm); color: var(--muted); }

/* ── Quantity stepper ── */
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--paper); overflow: hidden; }
.qty button { width: 40px; height: 42px; font-size: 1.2rem; color: var(--brown-700); transition: background var(--t-fast), color var(--t-fast); }
.qty button:hover:not(:disabled) { background: var(--honey-100); color: var(--honey-800); }
.qty button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty input { width: 44px; height: 42px; text-align: center; border: none; background: transparent; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Header ── */
.announcement {
  background: linear-gradient(90deg, var(--brown-900), var(--brown-800));
  color: var(--honey-100); text-align: center; font-size: var(--text-sm); font-weight: 600;
  padding: 0.55rem var(--sp-4); position: relative; z-index: 60;
}
.announcement a { color: var(--honey-300); text-decoration: underline; text-underline-offset: 2px; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 248, 244, 0.96); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(58,42,24,0.08); transition: box-shadow var(--t); }
.site-header.is-scrolled { box-shadow: 0 8px 24px rgba(42,29,16,0.06); }
.topbar { position: relative; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; height: 56px; padding-inline: clamp(1rem, 4vw, 3rem); }
.brand { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-width: 0; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; color: var(--honey-800); letter-spacing: 0; }

.main-nav { display: none; align-items: center; justify-content: center; gap: clamp(var(--sp-5), 4vw, var(--sp-12)); min-height: 38px; padding: 0.35rem var(--sp-5); border-top: 1px solid rgba(58,42,24,0.06); background: rgba(255,253,248,0.9); }
.main-nav a { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: var(--text-xs); letter-spacing: 0.08em; color: var(--brown-900); position: relative; padding: 0.25rem 0; text-transform: none; }
.main-nav a svg { width: 13px; height: 13px; color: var(--honey-800); }
.main-nav a::after { content: ""; position: absolute; left: 0; bottom: -8px; width: 0; height: 1px; background: var(--honey-800); transition: width var(--t) var(--ease); }
.main-nav a:hover { color: var(--honey-800); }
.main-nav a:hover::after, .main-nav a.is-active::after { width: 100%; }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 0; color: var(--honey-800); transition: color var(--t-fast), background var(--t-fast); }
.icon-btn:hover { background: transparent; color: var(--honey-600); }
.icon-btn svg { width: 22px; height: 22px; }
.cart-count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--honey-600); color: #fff; font-size: 0.68rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.cart-count:empty, .cart-count[data-count="0"] { display: none; }

.nav-toggle { display: inline-flex; }
@media (min-width: 1024px) { .main-nav { display: flex; } }
@media (max-width: 420px) {
  .topbar { padding-inline: var(--sp-3); }
  .header-actions { gap: 0; }
  .icon-btn { width: 40px; height: 40px; }
}

/* ── Mobile drawer ── */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(42, 29, 16, 0.5); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity var(--t), visibility var(--t); z-index: 90; }
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(86vw, 360px); background: var(--paper); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform var(--t-slow) var(--ease); z-index: 91; display: flex; flex-direction: column; padding: var(--sp-5); }
.drawer.open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-6); }
.drawer__links { display: flex; flex-direction: column; gap: var(--sp-1); }
.drawer__links a { display: inline-flex; align-items: center; gap: var(--sp-3); font-family: var(--font-display); font-size: var(--text-xl); color: var(--brown-900); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-2); }
.drawer__links svg { width: 18px; height: 18px; color: var(--honey-800); }
.drawer__links a:hover { color: var(--honey-700); }

/* ── Footer ── */
.site-footer { margin-top: var(--sp-24); background: #FAF8F4; color: var(--brown-900); position: relative; border-top: 1px solid var(--line); }
.site-footer::before { display: none; }
.footer-grid { position: relative; display: grid; grid-template-columns: 1fr; gap: var(--sp-8); padding: var(--sp-16) 0 var(--sp-10); }
.footer-brand .brand { justify-content: flex-start; }
.footer-brand .brand__name { color: var(--honey-800); }
.footer-brand p { color: var(--brown-700); font-size: var(--text-base); margin-top: var(--sp-4); max-width: 34ch; }
.footer-col h4 { color: var(--brown-900); font-size: var(--text-xs); margin-bottom: var(--sp-4); font-family: var(--font-body); font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.footer-col ul { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-col a { color: var(--brown-900); font-size: var(--text-sm); }
.footer-col a:hover { color: var(--honey-800); }
.newsletter-form { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.newsletter-form .input { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); color: #fff; }
.newsletter-form .input::placeholder { color: var(--honey-200); }
.footer-bottom { position: relative; border-top: 1px solid var(--line-2); padding: var(--sp-5) 0; display: flex; flex-direction: column; gap: var(--sp-2); align-items: center; text-align: center; font-size: var(--text-sm); color: var(--muted); }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: var(--sp-10); }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

/* ── Toast ── */
.toast-wrap { position: fixed; left: 50%; bottom: var(--sp-6); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: var(--sp-2); width: calc(100% - 2rem); max-width: 380px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--sp-3);
  padding: 0.9rem 1.1rem; border-radius: var(--r-md); background: var(--brown-900); color: var(--honey-100);
  box-shadow: var(--shadow-lg); font-size: var(--text-sm); font-weight: 600;
  animation: toast-in var(--t-slow) var(--ease);
}
.toast.success { background: #1F5C23; }
.toast.error { background: #8C1D17; }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Skeleton ── */
.skeleton { position: relative; overflow: hidden; background: var(--line-2); border-radius: var(--r-md); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-card { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); background: var(--paper); }
.sk-img { aspect-ratio: 1/1; }
.sk-line { height: 12px; border-radius: 6px; margin: var(--sp-3) var(--sp-4); }

/* ── Spinner ── */
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-dark { border-color: rgba(120,70,8,0.25); border-top-color: var(--honey-700); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Breadcrumbs ── */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: var(--text-sm); color: var(--muted); padding: var(--sp-5) 0; }
.breadcrumbs a { color: var(--brown-700); font-weight: 600; }
.breadcrumbs .sep { opacity: 0.5; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; align-items: center; gap: var(--sp-2); margin-top: var(--sp-10); flex-wrap: wrap; }
.pagination button { min-width: 42px; height: 42px; padding: 0 0.75rem; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--paper); font-weight: 700; color: var(--brown-700); transition: all var(--t-fast); }
.pagination button:hover:not(:disabled) { border-color: var(--honey-400); color: var(--honey-800); }
.pagination button.is-active { background: var(--brown-800); border-color: var(--brown-800); color: var(--honey-100); }
.pagination button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Empty state ── */
.empty { text-align: center; padding: var(--sp-16) var(--sp-4); }
.empty img, .empty svg { width: 96px; height: 96px; margin: 0 auto var(--sp-5); opacity: 0.8; }
.empty h3 { margin-bottom: var(--sp-2); }
.empty p { color: var(--muted); margin-bottom: var(--sp-6); }

/* ── OTP inputs ── */
.otp-inputs { display: flex; gap: var(--sp-2); justify-content: center; }
.otp-inputs input { width: 48px; height: 56px; text-align: center; font-size: var(--text-2xl); font-family: var(--font-display); font-weight: 600; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.otp-inputs input:focus { outline: none; border-color: var(--honey-500); box-shadow: 0 0 0 4px rgba(224,160,60,0.16); }
