/* Layout shared by every theme; each theme sets its fonts, colors and shapes on top. */
*,
*::before,
*::after {
  box-sizing: border-box;
}
:root {
  --bg: #ffffff;
  --text: #1f1f1f;
  --muted: #666666;
  --line: #e4e4e4;
  --surface: #f6f6f6;
  --radius: 6px;
  --heading-font: inherit;
  --max-width: 1120px;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
  padding-top: 32px;
  padding-bottom: 56px;
}
h1,
h2,
h3 {
  font-family: var(--heading-font);
  line-height: 1.2;
}
h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 24px;
}
a {
  color: var(--primary);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.announcement {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.95rem;
}
.site-header {
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--heading-font);
  font-size: 1.6rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--primary);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
  flex-wrap: wrap;
}
.header-centered {
  text-align: center;
  padding-top: 28px;
  padding-bottom: 16px;
}
.tagline {
  color: var(--muted);
  margin: 6px 0 0;
}
.nav {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.header-centered .nav {
  justify-content: center;
  margin-top: 16px;
}
.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.nav a:hover,
.nav a:focus-visible {
  color: var(--primary);
}
.badge {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
}
.card a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.card-image {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.card a:hover img {
  transform: scale(1.03);
}
.card h3 {
  font-size: 1.05rem;
  margin: 12px 0 4px;
}
.price {
  margin: 0;
  font-weight: 600;
}
.price s {
  color: var(--muted);
  font-weight: 400;
  margin-right: 6px;
}
.price.large {
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.sold-out {
  color: #b42318;
  font-weight: 600;
  margin-left: 8px;
}
.no-image {
  width: 100%;
  height: 100%;
  min-height: 200px;
  background: linear-gradient(135deg, var(--surface), var(--line));
}
.no-image.large {
  aspect-ratio: 1;
  border-radius: var(--radius);
}
.empty,
.muted {
  color: var(--muted);
}

.back {
  margin: 0 0 16px;
}
.back a {
  text-decoration: none;
}
.product {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.main-image {
  width: 100%;
  border-radius: var(--radius);
}
.thumbnails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.thumbnails img {
  border-radius: var(--radius);
  aspect-ratio: 1;
  object-fit: cover;
}
.description {
  white-space: pre-line;
  margin-top: 24px;
}
.stock-note {
  color: #b54708;
  font-weight: 600;
}
.add-to-cart {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.add-to-cart label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 4px;
}
.add-to-cart input {
  width: 80px;
}

input,
select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #c7c7c7;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}
input:focus,
select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}
.button.primary {
  background: var(--primary);
  color: #fff;
}
.button:hover {
  filter: brightness(1.08);
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
  padding: 0;
}
.notice {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  padding: 12px 16px;
  border-radius: var(--radius);
}
.error {
  background: #fef3f2;
  border: 1px solid #fecdca;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: #b42318;
}

.cart table,
.order-summary {
  width: 100%;
  border-collapse: collapse;
}
.cart th,
.cart td,
.order-summary td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.cart input {
  width: 72px;
}
.amount {
  text-align: right !important;
  white-space: nowrap;
}
.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.subtotal {
  font-size: 1.15rem;
  margin: 0;
}
.actions {
  text-align: right;
}
.order-summary .total td {
  font-weight: 700;
  font-size: 1.1rem;
}

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.address-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95rem;
  flex: 1;
}
.field.invalid input,
.field.invalid select {
  border-color: #d92d20;
}
.row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.secure {
  color: var(--muted);
  font-size: 0.9rem;
}
.summary {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
}
.summary h2 {
  margin-top: 0;
  font-size: 1.2rem;
}
.summary ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.summary li,
.total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  margin: 0;
}
.success,
.error-page {
  max-width: 640px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p {
  margin: 4px 0;
}
.powered {
  font-size: 0.8rem;
}

@media (max-width: 760px) {
  .product,
  .checkout {
    grid-template-columns: 1fr;
  }
  .cart th:nth-child(2),
  .cart td:nth-child(2) {
    display: none;
  }
}
