@import url("./tokens.css");

/* ── Utilities ──────────────────────────────────────────── */

.storefront-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Header ─────────────────────────────────────────────── */

.storefront-header {
  /* Soften the navbar's near-black text site-wide — account name, expanded
     mega-menu titles and mobile drawer labels — without touching muted links. */
  --color-text: #333;
  color: var(--color-text);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.storefront-header__bar {
  border-bottom: 1px solid var(--color-border);
}

.storefront-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: 56px;
}

.storefront-header__logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  width: 150px;
  height: 48px;
}

.storefront-header__logo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.storefront-header__search {
  flex: 1;
  display: flex;
  max-width: 480px;
  margin-inline: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.storefront-header__search:focus-within {
  border-color: var(--color-border-strong);
  box-shadow: 0 0 0 3px rgb(42 157 143 / 12%);
}

.storefront-header__search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
}

.storefront-header__search-input::placeholder {
  color: var(--color-text-subtle);
}

.storefront-header__search-btn {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.storefront-header__search-btn:hover {
  color: var(--color-text);
}

.storefront-header__user-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.storefront-header__nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.storefront-header__nav-link:hover {
  color: var(--color-text);
}

.storefront-header__account-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 140px;
  color: var(--color-text);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}

.storefront-header__account-link svg {
  flex: none;
}

.storefront-header__account-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.storefront-header__cart {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.storefront-header__cart:hover {
  color: var(--color-brand-hover);
}

.storefront-header__cart-count {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: var(--radius-full);
  background: var(--color-brand);
  color: var(--color-text-inverse);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: var(--weight-bold);
  line-height: 16px;
  text-align: center;
}

.storefront-header__icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.storefront-header__icon-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-muted);
}

/* Mobile-only controls: hidden on desktop, revealed in the mobile media query */
.storefront-header__mobile-toggle,
.storefront-header__account-icon {
  display: none;
}

.storefront-header__cat-nav {
  position: relative;
  overflow: visible;
}

.storefront-header__cat-inner {
  padding-block: 0;
}

/* ── Category Nav ───────────────────────────────────────── */

.storefront-cat-nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  white-space: nowrap;
}

.storefront-cat-nav__item {
  position: static;
  flex: 1;
  display: flex;
  justify-content: center;
}

.storefront-cat-nav__link {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.storefront-cat-nav__link:hover {
  color: var(--color-brand);
  font-weight: var(--weight-bold);
}

.storefront-cat-nav__link--active {
  color: var(--color-brand-hover);
  font-weight: var(--weight-bold);
}

.storefront-cat-nav__link--flagship:hover,
.storefront-cat-nav__link--flagship.storefront-cat-nav__link--active {
  color: var(--color-brand-hover);
  font-weight: var(--weight-bold);
}

.storefront-cat-nav__item--has-children {
  cursor: default;
}

/* Mega-menu panel: full-width under the category bar */
.storefront-cat-nav__mega {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 16px 28px rgb(33 37 41 / 8%);
  z-index: var(--z-dropdown);
  white-space: normal;
}

.storefront-cat-nav__item--has-children:hover .storefront-cat-nav__mega {
  display: block;
}

.storefront-cat-nav__mega-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding-block: var(--space-8);
}

/* Left fixed-shortcut column */
.storefront-cat-nav__mega-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-shrink: 0;
  min-width: 150px;
  padding-right: var(--space-8);
  border-right: 1px solid var(--color-border);
}

.storefront-cat-nav__side-link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-block: var(--space-1);
  transition: color var(--transition-fast);
}

.storefront-cat-nav__side-link:hover {
  color: var(--color-brand-hover);
}

.storefront-cat-nav__side-link--all {
  color: var(--color-text);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-1);
}

/* Category columns: L2 bold header + L3 gray links */
.storefront-cat-nav__mega-cols {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-6) var(--space-8);
}

.storefront-cat-nav__group-title {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-3);
  transition: color var(--transition-fast);
}

.storefront-cat-nav__group-title:hover {
  color: var(--color-brand-hover);
}

.storefront-cat-nav__group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.storefront-cat-nav__group-link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.storefront-cat-nav__group-link:hover {
  color: var(--color-brand-hover);
}

/* ── Mobile Drawer (search + categories) ─────────────────── */

.storefront-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
}

.storefront-mobile-drawer[hidden] {
  display: none;
}

.storefront-mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(33 37 41 / 45%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.storefront-mobile-drawer.is-open .storefront-mobile-drawer__backdrop {
  opacity: 1;
}

.storefront-mobile-drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(86%, 360px);
  background: var(--color-surface);
  box-shadow: 0 0 40px rgb(33 37 41 / 20%);
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.storefront-mobile-drawer.is-open .storefront-mobile-drawer__panel {
  transform: translateX(0);
}

.storefront-mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.storefront-mobile-drawer__title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.storefront-mobile-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: calc(var(--space-2) * -1);
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
}

.storefront-mobile-drawer__close:hover {
  color: var(--color-text);
  background: var(--color-surface-muted);
}

.storefront-mobile-drawer__search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}

.storefront-mobile-drawer__search:focus-within {
  border-color: var(--color-border-strong);
  box-shadow: 0 0 0 3px rgb(42 157 143 / 12%);
}

.storefront-mobile-drawer__search svg {
  flex-shrink: 0;
}

.storefront-mobile-drawer__search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: var(--text-base);
  outline: none;
}

.storefront-mobile-cats {
  padding: 0 var(--space-2) var(--space-8);
  border-top: 1px solid var(--color-border);
}

.storefront-mobile-cats__group {
  border-bottom: 1px solid var(--color-border);
}

.storefront-mobile-cats__link,
.storefront-mobile-cats__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4) var(--space-3);
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  text-align: left;
}

.storefront-mobile-cats__link {
  border-bottom: 1px solid var(--color-border);
}

.storefront-mobile-cats__chevron {
  flex-shrink: 0;
  color: var(--color-text-subtle);
  transition: transform var(--transition-fast);
}

.storefront-mobile-cats__toggle[aria-expanded="true"] .storefront-mobile-cats__chevron {
  transform: rotate(180deg);
}

.storefront-mobile-cats__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-base);
}

.storefront-mobile-cats__panel-inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 var(--space-3) var(--space-3);
}

.storefront-mobile-cats__toggle[aria-expanded="true"] + .storefront-mobile-cats__panel {
  grid-template-rows: 1fr;
}

.storefront-mobile-cats__sublink {
  display: block;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.storefront-mobile-cats__sublink:hover {
  color: var(--color-text);
}

.storefront-mobile-cats__sublink--all {
  color: var(--color-text);
  font-weight: var(--weight-medium);
}

/* Mobile header layout: icon controls replace the desktop search + name/logout */
@media (max-width: 768px) {
  .storefront-header__mobile-toggle {
    display: inline-flex;
    margin-left: calc(var(--space-2) * -1);
  }

  .storefront-header__account-icon {
    display: inline-flex;
  }

  .storefront-header__logo {
    margin-inline: auto;
  }

  .storefront-header__user-nav {
    gap: var(--space-1);
  }

  .storefront-header__search,
  .storefront-header__account-link,
  .storefront-header__user-nav > .storefront-header__nav-link {
    display: none;
  }

  .storefront-header__cat-nav {
    display: none;
  }
}

@media (min-width: 769px) {
  .storefront-mobile-drawer {
    display: none !important;
  }
}

body.storefront-drawer-open {
  overflow: hidden;
}

/* ── Footer ─────────────────────────────────────────────── */

.storefront-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-10);
  margin-top: auto;
}

.storefront-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.storefront-footer__logo {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
}

.storefront-footer__tagline {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  margin-top: var(--space-1);
}

.storefront-footer__links {
  display: flex;
  gap: var(--space-6);
}

.storefront-footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.storefront-footer__links a:hover {
  color: var(--color-text);
}

.storefront-footer__copy {
  width: 100%;
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* ── Origin Stamp ───────────────────────────────────────── */

.storefront-origin-stamp {
  display: inline-block;
  padding: 2px 6px;
  font-size: var(--text-xs);
  font-family: var(--font-ui);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  color: var(--color-brand);
  border: 1px solid var(--color-brand);
  border-radius: var(--radius-1);
  background: var(--color-surface);
  line-height: 1.4;
}

/* ── Product Card ───────────────────────────────────────── */

.storefront-product-card {
  display: flex;
  flex-direction: column;
  background: transparent;
}

.storefront-product-card__image-link {
  display: block;
}

.storefront-product-card__image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-surface-muted);
  overflow: hidden;
}

.storefront-product-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-5);
}

/* Secondary image revealed on hover */
.storefront-product-card__image--secondary {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.storefront-product-card:hover .storefront-product-card__image--secondary {
  opacity: 1;
}

.storefront-product-card__image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-surface-muted);
}

.storefront-product-card__origin-tag {
  float: left;
  margin-right: var(--space-1);
  padding: 1px 5px;
  font-size: var(--text-xs);
  line-height: 1.3;
  font-family: var(--font-ui);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  color: var(--color-text-inverse);
  background: var(--palette-teal-800);
  border-radius: var(--radius-1);
  white-space: nowrap;
}

.storefront-product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) 0 0;
  flex: 1;
}

.storefront-product-card__brand {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.storefront-product-card__brand:hover {
  color: var(--color-accent);
}

.storefront-product-card__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--color-text-muted);
  line-height: var(--leading-snug);
  display: block;
  overflow: hidden;
  height: calc(2 * var(--leading-snug) * 1em);
  transition: color var(--transition-fast);
}

.storefront-product-card__title:hover {
  color: var(--color-text);
}

.storefront-product-card__price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.storefront-product-card__price {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  font-family: var(--font-ui);
  color: var(--palette-red-800);
}

.storefront-product-card__compare-price {
  font-size: var(--text-xs);
  font-family: var(--font-ui);
  color: var(--color-text-subtle);
  text-decoration: line-through;
}

/* ── Product Grid ───────────────────────────────────────── */

.storefront-product-grid {
  transition: opacity var(--transition-base);
}

.storefront-product-grid.storefront-browse__loading {
  opacity: 0.5;
  pointer-events: none;
}

.storefront-product-grid__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  min-height: 24px;
}

.storefront-product-grid__count {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.storefront-product-grid__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  column-gap: var(--space-4);
  row-gap: var(--space-10);
}

@media (min-width: 1024px) {
  .storefront-product-grid__list {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .storefront-product-grid__list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .storefront-product-grid__list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
}

.storefront-product-grid__sentinel {
  grid-column: 1 / -1;
  block-size: 1px;
  pointer-events: none;
}

.storefront-product-grid__empty {
  padding: var(--space-16) 0;
  text-align: center;
}

.storefront-product-grid__empty p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.storefront-product-grid__empty a {
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: underline;
}

/* ── Filters ─────────────────────────────────────────────── */

.storefront-filters__group {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
}

.storefront-filters__group:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.storefront-filters__group-title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: 0.01em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.storefront-filters__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.storefront-filters__option-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.storefront-filters__option-label:hover {
  color: var(--color-text);
}

.storefront-filters__link {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.storefront-filters__link:hover {
  color: var(--color-text);
}

.storefront-filters__link.is-active {
  color: var(--color-text);
  font-weight: var(--weight-bold);
}

.storefront-filters__option-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.storefront-filters__option-label input[type="radio"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-brand);
  transform: scale(0);
  transition: transform var(--transition-fast);
}

.storefront-filters__option-label input[type="radio"]:checked {
  border-color: var(--color-brand);
}

.storefront-filters__option-label input[type="radio"]:checked::before {
  transform: scale(1);
}

.storefront-filters__option-label input[type="radio"]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}

.storefront-filters__count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  font-family: var(--font-ui);
}

.storefront-filters__clear {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.storefront-filters__clear:hover {
  color: var(--color-text);
}

/* ── Sort ───────────────────────────────────────────────── */

.storefront-sort {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.storefront-sort__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.storefront-sort__select {
  appearance: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  transition: border-color var(--transition-fast);
}

.storefront-sort__select:focus {
  outline: none;
  border-color: var(--color-focus);
}

/* ── Pagination ─────────────────────────────────────────── */

.storefront-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding-top: var(--space-8);
}

.storefront-pagination__info {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.storefront-pagination__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.storefront-pagination__link:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.storefront-pagination__show-all {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.storefront-pagination__show-all:hover {
  color: var(--color-text);
}

/* ── Availability Badges ────────────────────────────────── */

.storefront-badge--spot {
  color: var(--color-text-inverse);
  background: var(--color-success);
}

.storefront-badge--preorder {
  color: var(--color-text);
  background: var(--color-warning);
}

.storefront-badge--out {
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
}

/* ── Buttons ─────────────────────────────────────────────── */

.storefront-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 42px;
  padding: var(--space-2) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-2);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.storefront-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(42 157 143 / 25%);
}

.storefront-button--primary {
  color: var(--color-text-inverse);
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
}

.storefront-button--primary:hover {
  background: color-mix(in srgb, var(--color-brand-hover) 82%, black);
  border-color: color-mix(in srgb, var(--color-brand-hover) 82%, black);
  color: var(--color-text-inverse);
}

.storefront-button--secondary {
  color: var(--color-text-inverse);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.storefront-button--secondary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.storefront-button--ghost {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

.storefront-button--ghost:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-text-muted);
}

/* ── First-purchase Modal ────────────────────────────────── */

.storefront-first-purchase {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  background: rgb(33 37 41 / 50%);
  padding: var(--space-4);
}

.storefront-first-purchase.is-open {
  display: flex;
}

.storefront-first-purchase__panel {
  background: var(--color-surface);
  border-radius: var(--radius-2);
  padding: var(--space-10) var(--space-8);
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-card);
}

.storefront-first-purchase__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1;
  padding: var(--space-1);
}

.storefront-first-purchase__close:hover {
  color: var(--color-text);
}

.storefront-first-purchase__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.storefront-first-purchase__body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-6);
}

/* ── Brand Card ─────────────────────────────────────────── */

.storefront-brand-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.storefront-brand-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-card);
  color: inherit;
}

.storefront-brand-card__name {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--color-text);
}

.storefront-brand-card__count {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  font-family: var(--font-ui);
}

/* ── Toast ──────────────────────────────────────────────── */

.storefront-toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-8);
  transform: translate(-50%, 8px);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-2);
  /* 品牌綠 #8AB17D 的淺色調（18% / 45% 混白）；避免 color-mix 相容性問題用固定色碼 */
  background: #eaf1e7;
  border: 1px solid #cbddc4;
  color: var(--color-text);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: var(--z-modal);
}

.storefront-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
