/* =========================================================
   MochiPaw Storefront — Design System & Shared Components
   Visual language aligned with the product DEMO (reference only)
   ========================================================= */

:root {
  /* Surfaces */
  --mp-paper: #faf7f2;
  --mp-surface: #ffffff;
  --mp-stone: #f3eee6;
  --mp-line: #e6dfd3;

  /* Ink */
  --mp-ink: #1e1c1a;
  --mp-muted: #665f57;
  --mp-muted-soft: #8a8278;

  /* Brand accents */
  --mp-terracotta: #b85d43;
  --mp-terracotta-dark: #994730;
  --mp-sage: #3e5c50;
  --mp-amber: #e9c46a;

  /* Elevation & interaction */
  --mp-shadow-sm: 0 1px 2px rgba(30, 28, 26, 0.05);
  --mp-shadow-md: 0 12px 28px -16px rgba(30, 28, 26, 0.22);
  --mp-shadow-drawer: -12px 0 40px -18px rgba(30, 28, 26, 0.28);
  --mp-radius-sm: 0.625rem;
  --mp-radius-md: 0.875rem;
  --mp-radius-lg: 1.25rem;
  --mp-radius-xl: 1.5rem;
  --mp-radius-full: 9999px;

  /* Type */
  --mp-font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --mp-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mp-font-tabular: "Inter", ui-monospace, "Segoe UI", sans-serif;

  /* Layout */
  --mp-max: 72rem;
  --mp-header-h: 4rem;
  --mp-z-header: 40;
  --mp-z-overlay: 50;
  --mp-z-toast: 60;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--mp-paper);
  color: var(--mp-ink);
  font-family: var(--mp-font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.mp-bag-open,
body.mp-search-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--mp-font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0;
}

.mp-price,
.mp-tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.mp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mp-container {
  width: 100%;
  max-width: var(--mp-max);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .mp-container {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .mp-container {
    padding-inline: 2rem;
  }
}

/* ---------- Shared controls ---------- */
.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--mp-radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.75rem 1.25rem;
  transition:
    transform 0.14s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.mp-btn:active {
  transform: scale(0.98);
}

.mp-btn:disabled,
.mp-btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.mp-btn--primary {
  background: var(--mp-terracotta);
  color: var(--mp-paper);
  box-shadow: var(--mp-shadow-sm);
}

.mp-btn--primary:hover {
  background: var(--mp-terracotta-dark);
}

.mp-btn--secondary {
  background: var(--mp-surface);
  color: var(--mp-ink);
  border: 1px solid var(--mp-line);
}

.mp-btn--secondary:hover {
  background: var(--mp-stone);
}

.mp-btn--ghost {
  background: transparent;
  color: var(--mp-ink);
  border: 1px solid transparent;
}

.mp-btn--ghost:hover {
  background: var(--mp-stone);
}

.mp-btn--icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--mp-radius-full);
  border: 1px solid var(--mp-line);
  background: var(--mp-surface);
}

.mp-btn--icon:hover {
  border-color: rgba(30, 28, 26, 0.28);
}

.mp-field {
  width: 100%;
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius-md);
  background: var(--mp-paper);
  padding: 0.7rem 0.9rem;
  font-size: 0.875rem;
  color: var(--mp-ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.mp-field::placeholder {
  color: var(--mp-muted-soft);
}

.mp-field:focus {
  outline: none;
  border-color: var(--mp-terracotta);
  box-shadow: 0 0 0 3px rgba(184, 93, 67, 0.12);
}

.mp-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mp-muted);
}

/* ---------- Announcement ---------- */
.mp-announce {
  background: var(--mp-ink);
  color: var(--mp-paper);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.65rem 1rem;
}

.mp-announce__inner {
  max-width: var(--mp-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-announce a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mp-announce a:hover {
  color: #f6e7cb;
}

.mp-announce__dot {
  opacity: 0.45;
}

@media (min-width: 640px) {
  .mp-announce {
    font-size: 0.8125rem;
  }
}

/* ---------- Header ---------- */
.mp-header {
  position: sticky;
  top: 0;
  z-index: var(--mp-z-header);
  background: color-mix(in srgb, var(--mp-paper) 95%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--mp-line);
}

.mp-header__bar {
  height: var(--mp-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mp-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.mp-brand__mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--mp-radius-md);
  background: var(--mp-terracotta);
  color: var(--mp-paper);
  display: grid;
  place-items: center;
  box-shadow: var(--mp-shadow-sm);
  transition: background-color 0.18s ease;
}

.mp-brand:hover .mp-brand__mark {
  background: var(--mp-terracotta-dark);
}

.mp-brand__text {
  line-height: 1.15;
}

.mp-brand__name {
  display: block;
  font-family: var(--mp-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--mp-ink);
}

.mp-brand__badge {
  display: none;
  margin-top: 0.1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--mp-muted);
}

@media (min-width: 640px) {
  .mp-brand__badge {
    display: block;
  }
}

.mp-nav {
  display: none;
  align-items: center;
  gap: 1.6rem;
}

.mp-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mp-muted);
  padding: 0.5rem 0;
  transition: color 0.15s ease;
}

.mp-nav a:hover,
.mp-nav a[aria-current="page"] {
  color: var(--mp-ink);
}

@media (min-width: 900px) {
  .mp-nav {
    display: flex;
  }
}

.mp-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mp-bag-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--mp-radius-full);
  border: 1px solid var(--mp-line);
  background: var(--mp-surface);
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mp-ink);
  box-shadow: var(--mp-shadow-sm);
  transition: border-color 0.18s ease, transform 0.14s ease;
}

.mp-bag-trigger:hover {
  border-color: rgba(30, 28, 26, 0.35);
}

.mp-bag-trigger:active {
  transform: scale(0.98);
}

.mp-bag-trigger__icon {
  color: var(--mp-terracotta);
}

.mp-bag-trigger__count {
  min-width: 1.25rem;
  height: 1.25rem;
  padding-inline: 0.35rem;
  border-radius: var(--mp-radius-full);
  background: var(--mp-terracotta);
  color: var(--mp-paper);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.mp-menu-toggle {
  display: inline-flex;
}

@media (min-width: 900px) {
  .mp-menu-toggle {
    display: none;
  }
}

.mp-mobile-nav {
  display: none;
  border-top: 1px solid var(--mp-line);
  background: var(--mp-paper);
  padding: 0.85rem 1rem 1rem;
}

.mp-mobile-nav.is-open {
  display: block;
}

.mp-mobile-nav a {
  display: block;
  border-radius: var(--mp-radius-md);
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mp-ink);
}

.mp-mobile-nav a:hover,
.mp-mobile-nav a[aria-current="page"] {
  background: var(--mp-stone);
}

@media (min-width: 900px) {
  .mp-mobile-nav,
  .mp-mobile-nav.is-open {
    display: none;
  }
}

/* ---------- Search overlay ---------- */
.mp-search {
  position: fixed;
  inset: 0;
  z-index: var(--mp-z-overlay);
  display: none;
}

.mp-search.is-open {
  display: block;
}

.mp-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 28, 26, 0.45);
  backdrop-filter: blur(1px);
}

.mp-search__panel {
  position: relative;
  max-width: 36rem;
  margin: 4.5rem auto 0;
  padding: 0 1rem;
}

.mp-search__card {
  background: var(--mp-surface);
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius-xl);
  box-shadow: var(--mp-shadow-md);
  padding: 1rem;
}

.mp-search__row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mp-search__hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--mp-muted);
}

/* ---------- Cart / Bag drawer ---------- */
.mp-bag {
  position: fixed;
  inset: 0;
  z-index: var(--mp-z-overlay);
  display: none;
}

.mp-bag.is-open {
  display: block;
}

.mp-bag__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 28, 26, 0.5);
  backdrop-filter: blur(1px);
}

.mp-bag__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(100%, 28rem);
  background: var(--mp-paper);
  color: var(--mp-ink);
  border-left: 1px solid var(--mp-line);
  box-shadow: var(--mp-shadow-drawer);
  display: flex;
  flex-direction: column;
}

.mp-bag__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--mp-line);
}

.mp-bag__title {
  font-family: var(--mp-font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.mp-bag__subtitle {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--mp-muted);
}

.mp-bag__items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mp-bag__empty {
  margin-top: 1rem;
  border: 1px dashed var(--mp-line);
  border-radius: var(--mp-radius-xl);
  padding: 2rem 1.25rem;
  text-align: center;
}

.mp-bag__empty h3 {
  font-size: 1.125rem;
}

.mp-bag__empty p {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--mp-muted);
}

.mp-bag-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: var(--mp-radius-xl);
  background: var(--mp-surface);
  border: 1px solid var(--mp-line);
}

.mp-bag-item__thumb {
  flex: 0 0 auto;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 0.7rem;
  overflow: hidden;
  background: #1a1d22;
  border: 1px solid var(--mp-line);
}

.mp-bag-item__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-bag-item__img--empty {
  background:
    linear-gradient(135deg, #2a3038 25%, transparent 25%) -0.4rem 0 / 0.8rem 0.8rem,
    linear-gradient(225deg, #2a3038 25%, transparent 25%) -0.4rem 0 / 0.8rem 0.8rem,
    #15181d;
}

.mp-bag-item__body {
  min-width: 0;
  flex: 1;
}

.mp-bag-item__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mp-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-bag-item__meta {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--mp-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-bag-item__note {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--mp-sage);
  background: color-mix(in srgb, var(--mp-sage) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--mp-sage) 22%, transparent);
  border-radius: var(--mp-radius-sm);
  padding: 0.35rem 0.5rem;
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}

.mp-bag-item__line {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mp-terracotta);
  font-variant-numeric: tabular-nums;
}

.mp-bag-item__controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

.mp-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.mp-qty__btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--mp-line);
  background: var(--mp-paper);
  font-size: 0.875rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.mp-qty__btn:hover {
  background: var(--mp-stone);
}

.mp-qty__value {
  width: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mp-bag-item__remove {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--mp-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mp-bag-item__remove:hover {
  color: var(--mp-terracotta);
}

.mp-bag__footer {
  border-top: 1px solid var(--mp-line);
  background: var(--mp-surface);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mp-bag__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.mp-bag__subtotal-label {
  color: var(--mp-muted);
}

.mp-bag__subtotal-value {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mp-bag__ship-note {
  font-size: 0.75rem;
  color: var(--mp-muted);
}

.mp-bag__checkout-msg {
  display: none;
  border-radius: var(--mp-radius-md);
  background: color-mix(in srgb, var(--mp-sage) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--mp-sage) 28%, transparent);
  color: var(--mp-sage);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.65rem 0.85rem;
}

.mp-bag__checkout-msg.is-visible {
  display: block;
}

.mp-bag__checkout {
  width: 100%;
}

/* ---------- Footer ---------- */
.mp-footer {
  background: var(--mp-ink);
  color: rgba(250, 247, 242, 0.85);
  border-top: 1px solid rgba(250, 247, 242, 0.1);
  margin-top: auto;
}

.mp-footer__grid {
  display: grid;
  gap: 2rem;
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid rgba(250, 247, 242, 0.15);
}

@media (min-width: 640px) {
  .mp-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .mp-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  }
}

.mp-footer__brand-name {
  font-family: var(--mp-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--mp-paper);
}

.mp-footer__brand-copy {
  margin-top: 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: rgba(250, 247, 242, 0.7);
  max-width: 18rem;
}

.mp-footer__highlights {
  margin-top: 1rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: rgba(250, 247, 242, 0.72);
}

.mp-footer__highlights span {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.mp-footer__highlights i {
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.35rem;
  border-radius: var(--mp-radius-full);
  background: var(--mp-amber);
  flex-shrink: 0;
}

.mp-footer__heading {
  margin-bottom: 0.85rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(233, 196, 106, 0.85);
}

.mp-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.mp-footer__links a,
.mp-footer__links button {
  font-size: 0.875rem;
  color: rgba(250, 247, 242, 0.75);
  text-align: left;
  transition: color 0.15s ease;
}

.mp-footer__links a:hover,
.mp-footer__links button:hover {
  color: var(--mp-paper);
}

.mp-footer__form {
  display: grid;
  gap: 0.5rem;
}

.mp-footer__form .mp-field {
  background: rgba(250, 247, 242, 0.1);
  border-color: rgba(250, 247, 242, 0.2);
  color: var(--mp-paper);
}

.mp-footer__form .mp-field::placeholder {
  color: rgba(250, 247, 242, 0.45);
}

.mp-footer__form .mp-field:focus {
  border-color: #f6e7cb;
  box-shadow: 0 0 0 3px rgba(246, 231, 203, 0.12);
}

.mp-footer__msg {
  min-height: 1rem;
  font-size: 0.75rem;
  color: #f6e7cb;
}

.mp-footer__bottom {
  padding: 1.35rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(250, 247, 242, 0.6);
  text-align: center;
}

@media (min-width: 640px) {
  .mp-footer__bottom {
    flex-direction: row;
    text-align: left;
  }
}

/* ---------- Page shell helpers ---------- */
.mp-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mp-main {
  flex: 1;
}

.mp-section {
  padding: 3rem 0;
}

@media (min-width: 640px) {
  .mp-section {
    padding: 4rem 0;
  }
}

.mp-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mp-terracotta);
}

.mp-lead {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: var(--mp-muted);
  max-width: 36rem;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .mp-lead {
    font-size: 1.0625rem;
  }
}

/* ---------- Customer auth modal ---------- */
body.mp-auth-open {
  overflow: hidden;
}

.mp-auth[hidden] {
  display: none !important;
}

.mp-auth {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.mp-auth__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(18, 20, 23, 0.62);
  cursor: pointer;
}

.mp-auth__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 22.5rem);
  background: var(--mp-paper);
  color: var(--mp-ink);
  border: 1px solid var(--mp-line);
  border-radius: 1rem;
  padding: 1.25rem 1.15rem 1.1rem;
  box-shadow: 0 24px 60px rgba(30, 28, 26, 0.28);
}

.mp-auth__x {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--mp-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.mp-auth__title {
  margin: 0 1.5rem 0 0;
  font-family: var(--mp-font-display, Fraunces, Georgia, serif);
  font-size: 1.45rem;
}

.mp-auth__lead {
  margin: 0.45rem 0 0.95rem;
  color: var(--mp-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.mp-auth__form {
  display: grid;
  gap: 0.7rem;
}

.mp-auth__field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.mp-auth__field input {
  width: 100%;
  border: 1px solid var(--mp-line);
  border-radius: 0.55rem;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
  color: var(--mp-ink);
}

.mp-auth__field input:focus {
  outline: 2px solid color-mix(in srgb, var(--mp-terracotta) 55%, transparent);
  outline-offset: 1px;
}

.mp-auth__msg {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.82rem;
  color: var(--mp-muted);
}

.mp-auth__msg.is-error {
  color: #b42318;
}

.mp-auth__submit {
  width: 100%;
  margin-top: 0.15rem;
}

.mp-auth__switch {
  margin: 0.85rem 0 0;
  text-align: center;
}

.mp-auth__link {
  border: 0;
  background: transparent;
  color: var(--mp-terracotta);
  font: inherit;
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
