/* ── Design Tokens — Gallery White ── */
:root {
  /* Color */
  --paper:       #ffffff;
  --ink:         #171413;
  --accent:      #8a3520;
  --soft:        #f3efe8;
  --rule:        rgb(23 20 19 / 0.13);
  --muted:       rgb(23 20 19 / 0.55);
  --scrim-paper: rgb(255 255 255 / 0.75);

  /* Type families */
  --font-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-body:    "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-ui:      "Inter", "Helvetica Neue", system-ui, sans-serif;

  /* Type Scale */
  --size-nav:           9px;   /* Shop / About / Contact / Cart */
  --size-filter:        13px;  /* Ceramics / Paintings etc */
  --size-product-title: 28px;  /* Product name in detail panel */
  --size-product-price: 15px;  /* Price in detail panel */
  --size-body:          18px;  /* Description text */
  --size-card-label:    11px;  /* Name/price on product cards */
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: clip; /* clip doesn't break position:sticky unlike overflow:hidden */
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
  padding: 50px 48px 0;
  text-align: center;
}

.site-title {
  display: block;
  margin-bottom: 10px;
}

.site-title img {
  height: 67px;
  width: auto;
}

nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 8px 16px 40px;
  flex-wrap: nowrap;
}

nav a {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #999;
  transition: color 0.15s;
  white-space: nowrap;
}

nav a:hover,
nav a.active {
  color: #111;
}

/* ── Filters ── */
.filters {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  cursor: pointer;
  color: #808285;
  padding: 0;
  transition: color 0.15s;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}

.filter-btn:not(:last-child)::after {
  content: '|';
  margin-left: 4px;
  color: #ccc;
  font-weight: 300;
  pointer-events: none;
}

.filter-btn:hover {
  color: #222;
}

.filter-btn.active {
  color: #333;
}

.filters--hidden {
  display: none;
}

/* ── Product Grid ── */
main {
  min-height: 80vh;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 24px;
  padding-bottom: 80px;
}

@media (max-width: 960px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; margin-top: 24px; }
  .product-image { margin-bottom: 0; }
  .product-caption { padding: 0 2px 4px; }
  header { padding: 30px 24px 0; position: relative; }
  main { padding: 0 12px; }
  nav { gap: 16px; }
  nav a {
    font-size: 12px;
    letter-spacing: 0.12em;
  }
  .filters {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 16px 0 8px;
  }
  .filter-btn {
    font-size: 22px;
    letter-spacing: 0.01em;
  }
}

/* On touch/mobile: hide overlay, show text below image instead */
@media (hover: none) {
  .product-overlay { display: none; }
  .product-card { cursor: pointer; }
  .product-card::after { display: none; }
}

/* ── Product Card ── */
.product-card {
  cursor: pointer;
  position: relative;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f4f4f4;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.product-card:hover .product-image img {
  opacity: 1;
}

.product-card.sold-out .product-image img {
  filter: none;
  opacity: 1;
}

/* Hover overlay — Gallery White scrim */
.product-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--scrim-paper);
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
  padding: 22px;
  text-align: center;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

/* Slide-up container */
.product-overlay-meta {
  transform: translateY(8px);
  transition: transform 320ms ease 60ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.product-card:hover .product-overlay-meta {
  transform: translateY(0);
}

.product-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  font-style: normal;
  line-height: 1.15;
  color: rgba(0 0 0 / 0.8);
  letter-spacing: normal;
}

.product-price {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(0 0 0 / 0.8);
  white-space: nowrap;
}

/* Caption — mobile only, below image */
.product-caption {
  display: none;
  padding: 0 2px 4px;
}

.product-caption .product-name {
  color: #222;
}

.product-caption .product-price {
  color: #888;
}

@media (hover: none) {
  .product-caption { display: block; }
}

/* ── Inline Product Detail Panel ── */
.product-detail-panel {
  display: grid;
  grid-template-columns: max-content 300px;
  gap: 64px;
  align-items: start;
  width: fit-content;
  margin: 40px auto 48px;
}

.product-detail-panel h2 {
  font-family: var(--font-display);
  font-size: var(--size-product-title);
  font-weight: 500;
  font-style: normal;
  line-height: 1.15;
  letter-spacing: normal;
  margin: 0 0 12px;
  color: var(--ink);
}

.detail-divider {
  display: none;
}

@media (max-width: 700px) {
  main {
    overflow: hidden;
    max-width: 100vw;
  }
  .product-detail-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    padding: 0 0 36px;
    margin-top: 0;
  }
  .carousel-column {
    min-height: unset;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .carousel-row { gap: 0; width: 100%; }
  .product-detail-image {
    width: 100%;
    max-width: 100%;
    aspect-ratio: unset;
    height: auto;
    margin: 0;
    overflow: hidden;
  }
  /* Break the height:100% chain so images size from their natural dimensions */
  .product-detail-image .carousel,
  .product-detail-image .carousel-track {
    height: auto;
    width: 100%;
  }
  .product-detail-image .carousel-track img {
    height: auto;
    width: 100%;
    object-fit: contain;
  }
  .product-detail-info {
    padding: 0 4px;
  }
}

/* ── Product Detail Page ── */
.product-detail-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.back-link {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 36px;
  transition: color 0.15s;
}

.back-link:hover { color: #222; }

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

@media (max-width: 700px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .product-detail-wrap { padding: 32px 20px 60px; }
}

/* ── Carousel column (left side of detail panel) ── */
.carousel-column {
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.carousel-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-detail-image {
  width: 500px;   /* desktop */
  aspect-ratio: 1 / 1;
  background: #f4f4f4;
  overflow: hidden;
}

@media (max-width: 1000px) {
  .product-detail-image { width: 380px; } /* tablet */
  .product-detail-panel { gap: 40px; max-width: 860px; }
}

/* ── Carousel ── */
.carousel {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.carousel-btn {
  flex-shrink: 0;
  align-self: center;
  background: none;
  border: none;
  width: 20px;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #bbb;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.carousel-btn:hover { color: #333; }
.carousel-btn.hidden { visibility: hidden; }

@media (max-width: 700px) {
  /* Hide side arrows on mobile — swipe handles navigation */
  .carousel-btn { display: none; }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 0;
  min-height: 20px;
}

.carousel-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.carousel-dot.active { background: #555; }

.product-detail-info h1 {
  font-size: var(--size-product-title);
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.product-detail-price {
  font-family: var(--font-ui);
  font-size: var(--size-product-price);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 28px;
}

.product-detail-description {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 36px;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
}

.product-detail-description p {
  margin: 0 0 18px 0;
}

.product-detail-description p:last-child {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .product-detail-description {
    font-size: 22px;
    font-weight: 500;
  }
}

/* ── Print variants: size selector + quantity stepper ── */
.detail-variants {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 40px;
  margin-bottom: 20px;
}

.size-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-btn {
  background: none;
  border: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #808285;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 20px;
  white-space: nowrap;
  transition: all 0.15s;
}

.size-btn.active {
  background: #a7a9ac;
  border-color: #a7a9ac;
  color: #fff;
}

.size-btn:hover:not(.active) {
  border-color: #aaa;
  color: #333;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}

.qty-btn {
  background: none;
  border: 1px solid var(--rule);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 16px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}

.qty-btn:hover:not(:disabled) {
  border-color: var(--ink);
}

.qty-btn:disabled {
  color: #ccc;
  cursor: default;
}

.qty-value {
  font-family: var(--font-ui);
  font-size: 14px;
  min-width: 16px;
  text-align: center;
}

.btn-add-to-cart {
  display: block;
  width: 100%;
  background: #ca6755;
  color: #fff;
  border: none;
  padding: 13px 24px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add-to-cart:hover {
  background: #b05644;
}

.btn-sold-out {
  display: block;
  width: 100%;
  background: none;
  color: #bbb;
  border: 1px solid #ddd;
  padding: 13px 24px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: inherit;
  text-align: center;
}

/* ── Cart Page ── */
.cart-page {
  max-width: 720px;
  margin: 56px auto;
  padding: 0 32px 80px;
}

.cart-page h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 40px;
  color: var(--ink);
}

.cart-empty {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--muted);
}

.cart-empty a {
  text-decoration: underline;
  color: var(--muted);
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.cart-item-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: var(--soft);
  display: block;
}

.cart-item-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--ink);
}

.cart-item-price {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--muted);
}

.cart-item-qty {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.cart-item-remove {
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bbb;
  cursor: pointer;
  display: block;
  margin-top: 6px;
  padding: 0;
  transition: color 0.15s;
}

.cart-item-remove:hover { color: var(--ink); }

.cart-right {
  text-align: right;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.cart-shipping-note {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.btn-checkout {
  display: block;
  width: 100%;
  background: #ca6755;
  color: #fff;
  border: none;
  padding: 13px 24px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-checkout:hover { background: #b05644; }

/* ── Text Pages (About, Contact) ── */
.text-page {
  max-width: 720px;
  margin: 10px auto;
  padding: 0 32px 80px;
}

.text-section {
  margin-bottom: 40px;
}

.text-section h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  margin-bottom: 16px;
}

.text-section p {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 14px;
}

.text-section a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-section a:hover {
  color: var(--muted);
}

@media (max-width: 560px) {
  .text-page { margin: 36px auto; padding: 0 20px 60px; }
}

/* ── Footer ── */
footer {
  border-top: 1px solid #e8e8e8;
  padding: 32px 32px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #ccc;
  margin-top: 20px;
}

/* ── Footer signup ── */
/* ── Mailing list popup ── */
.signup-overlay {
  position: fixed;
  inset: 0;
  background: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.signup-popup {
  pointer-events: all;
}

.signup-overlay.hidden {
  display: none;
}

.signup-popup {
  position: relative;
  background: #fff;
  padding: 48px 56px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  border: 1px solid #222;
}

.signup-popup-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 22px;
  color: #222;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.signup-popup-close:hover {
  color: #000;
}

.signup-popup .footer-signup-label {
  color: #222;
  font-size: 13px;
  margin-bottom: 20px;
  display: block;
}

.signup-popup .footer-signup {
  align-items: center;
}

.signup-popup .signup-input {
  border-color: #222;
  color: #222;
}

.signup-popup .signup-input::placeholder {
  color: #aaa;
}

.signup-popup .signup-input:focus {
  border-color: #000;
}

/* ── Footer ── */
.footer-copyright {
  text-transform: none;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #ccc;
  margin-bottom: 16px;
}

.footer-signup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-signup-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #aaa;
  margin: 0;
}

.footer-signup-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signup-input {
  border: 1px solid #ddd;
  padding: 7px 12px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #444;
  background: #fff;
  outline: none;
  width: 200px;
  transition: border-color 0.15s;
}

.signup-input:focus {
  border-color: #999;
}

.signup-btn {
  background: #222;
  color: #fff;
  border: none;
  padding: 7px 16px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.signup-btn:hover {
  background: #444;
}

/* ── Contact page signup ── */
.contact-signup-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.contact-signup-row .signup-input {
  width: 240px;
  font-size: 13px;
  padding: 9px 14px;
}

.contact-signup-row .signup-btn {
  font-size: 12px;
  padding: 9px 20px;
}

@media (max-width: 560px) {
  .footer-signup { flex-direction: column; align-items: center; gap: 12px; }
  .footer-signup-form { flex-direction: column; width: 100%; }
  .signup-input { width: 100%; }
  .signup-btn { width: 100%; }
  .contact-signup-row { flex-direction: column; }
  .contact-signup-row .signup-input { width: 100%; }
  .contact-signup-row .signup-btn { width: 100%; }
  .signup-popup .signup-input { border-color: #222; color: #222; }
  .signup-popup .signup-input::placeholder { color: #aaa; }
  .signup-popup-close { color: #222; }
  .signup-popup .footer-signup-label { color: #222; }
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #222;
  color: #fff;
  padding: 11px 22px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 700px) {
  .site-title img {
    height: 52px;
    display: block;
    margin: 0 auto;
  }
  .detail-variants {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: nowrap;
  }
  .size-btn {
    font-size: 14px;
  }
  .qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
  }
}
