:root {
  --bg: #f7f5ff;
  --bg-alt: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #7c3aed;
  --primary-soft: #f1eaff;
  --card: #ffffff;
  --border: #e7ddff;
  --shadow: 0 20px 60px rgba(91, 33, 182, 0.1);

  /* Fluid type scale. Each step interpolates between its small-screen and
     large-screen size across the viewport, so nothing snaps at a breakpoint. */
  --step--1: clamp(0.78rem, 0.74rem + 0.18vw, 0.88rem);
  --step-0: clamp(0.94rem, 0.90rem + 0.20vw, 1.05rem);
  --step-1: clamp(1.10rem, 1.02rem + 0.40vw, 1.35rem);
  --step-2: clamp(1.35rem, 1.18rem + 0.85vw, 1.85rem);
  --step-3: clamp(1.60rem, 1.28rem + 1.60vw, 2.40rem);
  --step-4: clamp(1.90rem, 1.45rem + 2.25vw, 3.00rem);

  /* Fluid spacing scale, used for gutters, gaps and section rhythm. */
  --space-2xs: clamp(0.25rem, 0.22rem + 0.15vw, 0.375rem);
  --space-xs: clamp(0.5rem, 0.45rem + 0.25vw, 0.75rem);
  --space-s: clamp(0.75rem, 0.65rem + 0.50vw, 1.125rem);
  --space-m: clamp(1rem, 0.85rem + 0.75vw, 1.5rem);
  --space-l: clamp(1.5rem, 1.15rem + 1.75vw, 2.75rem);
  --space-xl: clamp(2rem, 1.40rem + 3.00vw, 4.75rem);

  /* Shared page gutter and the widest a content column may ever get. */
  --gutter: clamp(0.75rem, 3vw, 1.5rem);
  --shell: 81.25rem;

  /* Narrowest a grid track may be before the grid drops a column. Wrapping
     the floor in min() means a track never demands more width than the
     container actually has, which is what stops these grids overflowing. */
  --col-narrow: min(100%, 15rem);
  --col-wide: min(100%, 20rem);

  /* Floor for a product card. At the shell's full width the grid has ~940px
     for cards, which fits exactly four 13rem tracks plus gaps -- a fifth
     would need the floor under ~11rem, a third over ~14rem. */
  --col-product: min(100%, 13rem);

  /* The full catalog has no eight-item budget to respect, so it may use
     narrower tracks and fit more per row on a wide screen. */
  --col-catalog: min(100%, 12rem);
}

* {
  box-sizing: border-box;
}

/* Grid and flex children default to min-width:auto, which refuses to shrink
   below their content -- the single most common cause of a layout that
   "breaks" when the viewport narrows. Opt every content child out of it. */
:where(.page, .panel, .card, .modal) :where(div, section, article, header, footer, form, ul, ol, li, p, h1, h2, h3, h4) {
  min-width: 0;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

/* Long product titles, URLs and codes wrap instead of widening the page. */
h1,
h2,
h3,
h4,
p,
li,
a,
span,
strong,
label,
td,
th {
  overflow-wrap: break-word;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #fbfaff 0%, #f3efff 100%);
  color: var(--text);
  overflow-x: hidden;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #a78bfa #eee9ff;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #eee9ff;
}

*::-webkit-scrollbar-thumb {
  background: #a78bfa;
  border: 2px solid #eee9ff;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #7c3aed;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
}

img {
  max-width: 100%;
}

#app {
  min-height: 100vh;
}

.page {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--gutter);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.header h1 {
  font-size: var(--step-3);
  margin: 0;
}

.header .lead {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.75rem), 1fr));
  margin-bottom: var(--space-m);
}

.stat-card,
.panel,
.card,
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 20px;
}

.stat-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.stat-card p {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.top-banner,
.cards-row {
  display: grid;
  gap: 16px;
}

.top-banner {
  grid-template-columns: repeat(auto-fit, minmax(var(--col-wide), 1fr));
  align-items: center;
  padding: var(--space-l);
}

.top-banner h2 {
  margin: 0 0 var(--space-xs);
  font-size: var(--step-2);
}

.top-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.cards-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.panel {
  padding: 24px;
}

.catalog-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}

.catalog-row .panel {
  width: 100%;
  max-width: none;
}

/* On products.html the grid is a direct flex child of .catalog-row, so
   without this it shrinks to its content instead of filling the row. */
.catalog-row>.product-grid {
  flex: 1;
  width: 100%;
}

.catalog-layout {
  display: grid;
  width: 100%;
  grid-template-columns: clamp(8.5rem, 14vw, 11.25rem) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.category-sidebar {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.category-sidebar h3 {
  margin: 0 10px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.category-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  min-height: 54px;
  flex: 1;
  transition: none;
}

.category-link svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.category-link:hover,
.category-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.product-grid {
  display: grid;
  gap: 16px;
  /* The home preview always holds eight products, so the column count is
     pinned per breakpoint rather than derived from a track floor. An
     auto-fill floor depends on the exact viewport width, which is why the
     same page landed on four columns locally and three once hosted; a fixed
     count gives the same 4 x 2 block on every desktop width. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  padding-inline: var(--space-xs);
}

@media (min-width: 700px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Set by fitGridToFullRows on the home preview grid to drop a ragged last
   row. Those products are still reachable on products.html. */
.product-card.is-row-overflow {
  display: none;
}

/* The full catalog is allowed a ragged last row -- it is the whole list, so
   gaps read as "that is everything" rather than as a broken layout. */
.product-grid.is-full-catalog {
  grid-template-columns: repeat(auto-fill, minmax(var(--col-catalog), 1fr));
  justify-content: start;
  padding-inline: 0;
  align-content: start;
}

.product-card {
  background: var(--bg-alt);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: clamp(17rem, 30vw, 23.75rem);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.product-card-image {
  height: clamp(6.5rem, 16vw, 9.375rem);
  flex: 0 0 clamp(6.5rem, 16vw, 9.375rem);
  background: linear-gradient(135deg, #e0efff 0%, #eef2ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.product-card-body h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-description {
  flex: 1;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.product-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.product-card-actions button {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.8rem;
  border-radius: 10px;
}

button.primary.small,
button.secondary.small {
  font-size: 0.85rem;
  padding: 8px 10px;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.notification-group {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(22.5rem, calc(100vw - 2rem));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  z-index: 20;
  overflow: hidden;
}

.notification-dropdown.hidden {
  display: none;
}

.notification-panel {
  padding: 16px;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.notification-list.dropdown {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(20rem, 60vh);
  overflow-y: auto;
}

.notification-item {
  padding: 14px 12px;
  border-radius: 18px;
  border: 1px solid transparent;
  margin-bottom: 10px;
}

.notification-item.unread {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.notification-item.read {
  background: #f9fafb;
}

.notification-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.notification-time {
  color: var(--muted);
  font-size: 0.8rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 14px 18px;
  border-radius: 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 50;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #dc2626;
}

.toast.success {
  background: #16a34a;
}

.panel h2 {
  margin-top: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.badge-pending {
  background: #f59e0b;
}

.badge-completed {
  background: #10b981;
}

button.primary {
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  border-radius: 14px;
}

.more-products-wrapper {
  display: flex;
  justify-content: center;
  margin: 36px 0 48px 0;
  width: 100%;
}

.more-products-btn {
  background: var(--primary);
  color: white;
  padding: 18px 48px;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.more-products-btn:hover {
  background: #6d28d9;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.35);
}

button.secondary {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 14px;
}

.store-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 0;
}

.store-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.store-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 min(17.5rem, 100%);
  min-width: 0;
  justify-content: flex-end;
}

.store-brand {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
}

.icon-button.logo-button {
  width: auto;
  height: auto;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}

.logo-button img {
  width: clamp(2.75rem, 7vw, 4.75rem);
  height: clamp(2.75rem, 7vw, 4.75rem);
  object-fit: contain;
}

.store-brand:hover {
  color: var(--primary);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.header-links a {
  color: var(--text);
  font-size: 0.96rem;
  text-decoration: none;
}

.header-links a:hover {
  color: var(--primary);
}

/* Kept right-aligned by letting the flex row push it, not by a hardcoded
   pixel offset -- the old `left: 264px` overflowed on any narrow viewport. */
.store-search {
  position: relative;
  flex: 1 1 min(11.25rem, 100%);
  min-width: 0;
  max-width: min(28rem, 100%);
  margin-inline-start: auto;
}

.store-search input {
  position: relative;
  left: auto;
  width: 100%;
  margin: 0;
  display: block;
  padding: 12px 18px 12px 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  font-size: 0.95rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  /* Brings icon to the front layer */
  color: var(--muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-search .search-icon svg {
  width: 18px;
  height: 18px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 1.1rem;
}

.icon-button svg {
  display: block;
  width: 20px;
  height: 20px;
}

.hero-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--col-wide), 1fr));
  gap: var(--space-m);
  padding: var(--space-l);
  margin-bottom: var(--space-m);
  border-radius: 24px;
  background: linear-gradient(135deg, #eee7ff 0%, #ffffff 72%);
  overflow: hidden;
}

.hero-card .eyebrow {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.hero-card h1 {
  margin: 0 0 var(--space-s);
  font-size: var(--step-4);
  line-height: 1.05;
}

.hero-card .hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.hero-graphic {
  align-self: stretch;
  height: auto;
  margin: calc(var(--space-l) * -1) calc(var(--space-l) * -1) calc(var(--space-l) * -1) 0;
  padding: var(--space-xs);
  border-radius: 22px 0 0 22px;
  background: #efe8ff;
  /* Set outer container to light purple */
  overflow: hidden;
}

.hero-card-visual {
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(180deg, #8b5cf6 0%, #c084fc 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  padding: 0 16px;
  box-shadow: none;
  /* Keeps ridges completely removed */
}

@media (max-width: 980px) {
  .store-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .store-search {
    order: 3;
    width: 100%;
  }

  .header-links {
    order: 2;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-graphic {
    margin: var(--space-m) 0 0 0;
    border-radius: 16px;
    min-height: 180px;
  }
}

.card {
  overflow: hidden;
}

.card-body {
  padding: 20px;
}

.card h3 {
  margin: 0 0 12px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-alt);
  color: var(--text);
}

.role-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.25rem), 1fr));
  gap: var(--space-xs);
}

.role-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-alt);
}

.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.notification-item.unread {
  background: #f8fafc;
}

.notification-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

button.small {
  padding: 8px 12px;
  border-radius: 12px;
}

.form-grid textarea {
  min-height: 120px;
  resize: vertical;
}

.chart-grid {
  display: grid;
  gap: 16px;
}

.chart-bar-group {
  display: grid;
  gap: 8px;
}

.chart-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
}

.chart-bar-outer {
  width: 100%;
  background: #eef2ff;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.chart-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 999px;
}

label {
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  width: min(760px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(16px, 4vw, 24px);
}

.modal h3 {
  margin-top: 0;
}

.close-button {
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
}

input[type=file] {
  padding: 10px;
}

.login-panel {
  width: 100%;
  max-width: min(26.25rem, 100%);
  margin: clamp(1.5rem, 8vh, 5rem) auto;
  padding: var(--space-l);
}

.login-panel h2 {
  margin-top: 0;
}

.login-panel .form-grid {
  margin-top: 24px;
}

.text-muted {
  color: var(--muted);
}

@media (max-width: 900px) {

  .top-banner,
  .cards-row {
    grid-template-columns: 1fr;
  }
}

/* Animations and Transitions */
button,
.product-card,
.notification-dropdown,
.shop-dropdown,
.profile-dropdown,
.toast,
.modal,
.order-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Google Button & Divider Styling */
.divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 12px 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.divider-text:not(:empty)::before {
  margin-right: .5em;
}

.divider-text:not(:empty)::after {
  margin-left: .5em;
}

.google-btn {
  border: 1px solid var(--border) !important;
  background: white !important;
  color: var(--text) !important;
}

.google-btn:hover {
  background: #f9fafb !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

/* Dropdown Menu Container Styling */
.shop-group,
.profile-group {
  position: relative;
}

.shop-dropdown,
.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(18.75rem, calc(100vw - 2rem));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  z-index: 100;
  overflow: hidden;
  animation: slideDownFade 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-dropdown.hidden,
.profile-dropdown.hidden {
  display: none;
}

.profile-dropdown-divider {
  height: 1px;
  background-color: var(--border);
  margin: 8px 0;
}

/* Checkout Page Layout Styling */
.checkout-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--col-wide), 1fr));
  gap: var(--space-m);
  margin-top: var(--space-m);
}

@media (max-width: 768px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

.checkout-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 700;
}

.checkout-summary-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.inline-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stripe-button {
  width: 100%;
  margin-top: 8px;
  padding: 13px 18px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.stripe-button:hover:not(:disabled) {
  background: #1d4ed8;
}

.stripe-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.catalog-discount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-m);
  width: 100%;
  min-height: clamp(0rem, 26vw, 15.25rem);
  margin: var(--space-m) auto 0;
  padding: var(--space-l);
}

.discount-code-panel {
  background: linear-gradient(120deg, #4c1d95, #7e22ce);
  border-radius: 24px;
  color: #fff;
}

.discount-code-panel h2,
.discount-code-panel h3 {
  margin: 0 0 10px;
  color: #fff;
}

.discount-code-panel p {
  margin: 0;
  max-width: 600px;
  color: #fff;
  line-height: 1.6;
}

.discount-code-panel .eyebrow {
  margin-bottom: 10px;
  color: #f3e8ff;
}

.discount-code-panel .discount-entry {
  flex: 0 0 auto;
}

.discount-code-panel .discount-entry input {
  flex: 1 1 min(17.5rem, 100%);
  min-width: 0;
  min-height: 3rem;
}

.discount-code-panel .discount-entry button {
  min-height: 48px;
  background: #fff;
  color: #4c1d95;
  font-weight: 700;
}

.discount-code-panel .discount-entry button:hover {
  background: #f3e8ff;
}

.checkout-discount-panel {
  margin-top: 22px;
  padding: 22px;
  min-height: 0;
}

.checkout-discount-panel h3 {
  font-size: 1.15rem;
}

.catalog-discount p {
  margin: 5px 0 0;
}

.discount-entry {
  display: flex;
  gap: 8px;
  align-items: center;
}

.discount-entry input {
  flex: 1 1 min(11.25rem, 100%);
  min-width: 0;
}

.curated-intro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--col-wide), 1fr));
  gap: var(--space-l);
  align-items: end;
  padding: var(--space-l) var(--space-xs) var(--space-m);
  max-width: min(57.5rem, 100%);
}

.curated-intro h2 {
  margin: 0;
  font-size: var(--step-3);
  line-height: 1.05;
}

.curated-intro p {
  max-width: 560px;
  line-height: 1.7;
}

.store-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--col-narrow), 1fr));
  gap: var(--space-m);
  margin: var(--space-l) 0 var(--space-xs);
}

.store-note {
  padding: 24px;
  border-top: 2px solid #c4b5fd;
  background: linear-gradient(180deg, #b89aff 0%, #ca95ff 100%);
  border: 0;
  border-radius: 24px;
  color: #fff;
  min-height: 180px;
}

.store-note svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.store-note h3 {
  margin: 16px 0 8px;
  color: #fff;
}

.store-note p {
  margin: 0;
  color: #fff;
  line-height: 1.6;
}

.collection-story {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--col-wide), 1fr));
  gap: var(--space-xl);
  margin: var(--space-xl) 0 0;
  padding: var(--space-xl) var(--space-xs);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.story-copy h2 {
  max-width: min(26.25rem, 100%);
  margin: 0 0 var(--space-s);
  font-size: var(--step-3);
  line-height: 1.05;
}

.story-copy>p:last-child {
  max-width: min(31.25rem, 100%);
  color: var(--muted);
  line-height: 1.8;
}

.story-list {
  display: grid;
  gap: 20px;
}

.story-list>div {
  display: grid;
  grid-template-columns: 2.625rem minmax(0, 1fr);
  column-gap: var(--space-xs);
  align-items: start;
}

.story-list span {
  grid-row: span 2;
  color: var(--primary);
  font-weight: 800;
}

.story-list p {
  grid-column: 2;
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.collection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 260px;
  margin: 52px 0 20px;
  padding: 42px 48px;
  border-radius: 24px;
  background: linear-gradient(120deg, #4c1d95, #7e22ce);
  color: #fff;
}

.collection-banner h2 {
  max-width: 600px;
  margin: 0 0 12px;
  font-size: 2rem;
}

.collection-banner p:last-child {
  max-width: 560px;
  margin: 0;
  color: #ede9fe;
  line-height: 1.7;
}

.collection-banner svg {
  width: 58px;
  height: 58px;
  color: #e9d5ff;
  flex: 0 0 auto;
}

/* Profile Tab Navigation & Content styling */
.tab-button {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.tab-button.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.tab-button:hover {
  background: rgba(15, 23, 42, 0.04);
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--bg-alt);
}

.order-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.order-card.expanded {
  border-color: var(--primary);
}

.order-card-details.hidden {
  display: none;
}

.toast.clickable {
  cursor: pointer;
}

.toast.clickable:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  transform: translateY(-2px);
}

.site-footer {
  margin-top: var(--space-xl);
  padding: var(--space-l) var(--gutter);
  background: #1b102f;
  color: #f9fafb;
}

.footer-inner {
  width: min(78.25rem, 100%);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "brand company policies settings"
    "brand media   media    settings";
  gap: var(--space-l);
  /* Adjust gap to fine-tune spacing between columns */
  justify-content: space-between;
  align-items: start;
}

.footer-grid> :nth-child(1) {
  grid-area: brand;
}

.footer-grid> :nth-child(2) {
  grid-area: company;
}

.footer-grid> :nth-child(3) {
  grid-area: policies;
}

.footer-grid> :nth-child(5) {
  grid-area: settings;
}

.footer-media-column {
  grid-area: media;
  margin-top: 6px;
}

.footer-logo {
  display: block;
  width: min(190px, 100%);
  height: auto;
  margin: 0 0 14px;
}

.footer-muted {
  color: #fff;
  line-height: 1.6;
  max-width: min(17.5rem, 100%);
}

.site-footer h3 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: #c4b5fd;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-footer a,
.footer-link {
  display: block;
  margin: 0 0 10px;
  color: #f9fafb;
  text-decoration: none;
  background: none;
  padding: 0;
  text-align: left;
}

.site-footer a:hover,
.footer-link:hover {
  color: #d8b4fe;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 1px solid #6d4bb7;
  margin-top: 32px;
  padding-top: 20px;
  color: #fff;
  font-size: 1rem;
}

.footer-media {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 0;
  color: #c4b5fd;
}

.footer-media-column h3 {
  margin-bottom: 12px;
}

.footer-media a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid #7654b4;
  border-radius: 50%;
  background: #2b164b;
  color: #fff;
}

.footer-media a:hover {
  background: #7c3aed;
  color: #fff;
}

.footer-media svg {
  width: 14px;
  height: 14px;
}

.footer-media img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  border-radius: 50%;
}

.payment-methods {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #111827;
  font-size: 0.56rem;
  font-weight: 800;
}

/* Same 36px circle as every other badge -- this used to be 44px with a
   border, which made Apple Pay read as the odd one out in the footer row. */
.apple-pay {
  background-color: #ffffff;
}

.apple-pay svg {
  display: block;
}

/* --apple-pay-logo is the knob for how much of the circle the logo fills.
   Lower it to shrink the mark, raise it to grow it. */
.payment-badge.apple-pay {
  --apple-pay-logo: 100%;
}

.payment-badge.apple-pay img {
  width: var(--apple-pay-logo);
  height: var(--apple-pay-logo);
  object-fit: contain;
}

.link-pay {
  background: #20d879;
  color: #062b19;
  text-transform: lowercase;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.visa {
  color: #1d4ed8;
  font-style: italic;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.payment-badge.master {
  padding: 0;
  overflow: hidden;
}

.payment-badge.master img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.cookie-banner {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

.cookie-banner p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.info-page .panel {
  max-width: 760px;
  margin: 32px auto 0;
}

.info-copy {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

.payment-complete .panel {
  max-width: min(38.75rem, 100%);
  margin: var(--space-xl) auto;
  text-align: center;
}

.download-link {
  display: inline-block;
  margin: 18px 0;
  text-decoration: none;
}

@media (max-width: 700px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .category-sidebar {
    position: static;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px;
  }

  .category-sidebar h3 {
    display: none;
  }

  .category-link {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .curated-intro {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 24px;
  }

  .store-notes {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .collection-story {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 52px;
    padding: 42px 0;
  }

  .collection-banner {
    align-items: flex-start;
    flex-direction: column;
    min-height: 220px;
    padding: 32px 26px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand    brand"
      "company  policies"
      "media    media"
      "settings settings";
    gap: 24px;
  }

  .footer-media {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .footer-media a {
    width: 32px;
    height: 32px;
  }

  .footer-bottom,
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .payment-methods {
    justify-content: flex-start;
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-actions button {
    flex: 1;
  }

  .catalog-discount {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-discount {
    min-height: 0;
    padding: 32px 26px;
  }

  .discount-entry input {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 480px) {
  .product-grid {
    padding-inline: 0;
  }

  .product-card {
    min-height: auto;
  }

  .hero-card {
    padding: 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "company"
      "policies"
      "media"
      "settings";
  }
}

/* Animation Keyframes */
@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes productMarquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* Page Transition Animations */
.page {
  animation: pageFadeIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page.page-exit {
  animation: pageFadeOut 0.22s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.99);
  }
}


/* ==========================================================================
   Responsive safety layer
   Everything above sizes itself fluidly; this layer catches the cases fluid
   units alone cannot express, and is deliberately last so it always wins.
   ========================================================================== */

/* Wide data tables cannot shrink past their content, so let their container
   scroll rather than letting the table push the whole page sideways. */
.panel:has(> .table),
.card:has(> .table),
.card-body:has(> .table) {
  overflow-x: auto;
}

.table {
  min-width: min(100%, 34rem);
}

@supports not selector(:has(*)) {
  .table {
    display: block;
    overflow-x: auto;
  }
}

/* Inputs and buttons never overflow their row, and stay thumb-sized. */
input,
select,
textarea,
button {
  max-width: 100%;
}

button,
.button,
input[type="submit"] {
  min-height: 2.75rem;
}

/* Flex rows that hold controls wrap instead of overflowing. */
.form-actions,
.nav-actions,
.header-links,
.discount-entry,
.footer-media,
.payment-methods,
.cookie-actions,
.hero-actions,
.checkout-summary-meta {
  flex-wrap: wrap;
}

.checkout-discount-note {
  margin: 0.5rem 0 0;
}

/* iOS zooms the page in when a focused input is under 16px. */
@media (max-width: 30rem) {
  input,
  select,
  textarea {
    font-size: max(1rem, var(--step-0));
  }
}

/* Short landscape viewports (phones turned sideways) need tighter rhythm
   than a width query alone can detect. */
@media (max-height: 30rem) and (orientation: landscape) {
  .login-panel {
    margin-block: var(--space-m);
  }

  .modal {
    max-height: 94vh;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .product-card:hover {
    transform: none;
  }
}
