/* ==========================================================================
   FrameX — Home Decor & Wall Art
   What is specific to wall art: the custom-photo block on home-decor.html
   (hd-*) and the photo customiser, wall-art-studio.html (was-*).
   Everything else on those pages (hero, sections, collection cards, chips,
   product grid and cards, toolbar) is the shared system in base.css,
   components.css and catalog.css: Home Decor is where that system came from.
   ========================================================================== */

/* Custom photo promo ---------------------------------------------------------------- */
.hd-custom {
  display: grid;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.hd-steps {
  display: grid;
  gap: 14px;
  margin: 22px 0 26px;
  counter-reset: step;
}

.hd-steps li {
  position: relative;
  display: grid;
  gap: 2px;
  padding-left: 48px;
  counter-increment: step;
}

.hd-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--champagne);
  color: var(--brown-deep);
  font-family: var(--font-display);
  font-weight: 700;
}

.hd-steps strong {
  font-weight: 700;
}

.hd-steps span {
  color: var(--taupe);
  font-size: var(--text-sm);
}

.hd-custom__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 900px) {
  .hd-custom {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }

  .hd-custom__grid {
    gap: 16px;
  }
}

/* Wall art note under a product title (product page) ---------------------------------- */
.pp-decor-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--ivory);
  color: var(--umber);
  font-size: var(--text-sm);
}

.pp-decor-note .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--gold-muted);
}

/* ==========================================================================
   Photo customiser (wall-art-studio.html)
   ========================================================================== */
.was {
  padding-top: calc(var(--header-h) + 16px);
  padding-bottom: clamp(40px, 6vw, 72px);
  background: var(--ivory);
  min-height: 100vh;
}

.was__crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.was__crumbs a:hover {
  text-decoration: underline;
}

.was__lead {
  max-width: 62ch;
  margin-top: 6px;
  color: var(--taupe);
}

.was__grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

/* The wall with the panels on it */
.was-stage {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #e9e3d8;
}

.was-stage__wall {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: 7%;
  background: linear-gradient(180deg, var(--wall-a, #efeae1), var(--wall-b, #e3dccf));
  transition: background var(--dur-base) var(--ease-out);
}

.was-stage__wall::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, 0.5), transparent 60%);
  pointer-events: none;
}

.was-stage[data-wall="warm"] .was-stage__wall {
  --wall-a: #eadfce;
  --wall-b: #dccdb7;
}

.was-stage[data-wall="sage"] .was-stage__wall {
  --wall-a: #d6ddd0;
  --wall-b: #c3cdbb;
}

.was-stage[data-wall="dark"] .was-stage__wall {
  --wall-a: #34373c;
  --wall-b: #26282c;
}

/* The set: its size is set in JS (it keeps the real proportions) */
.was-set {
  position: relative;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.was-set.is-dragging {
  cursor: grabbing;
}

.was-set.is-empty {
  cursor: pointer;
}

/* One framed panel: the frame is its border, the picture shows through the opening.
   The picture is placed against the whole set, so it lines up from panel to panel. */
.was-panel {
  position: absolute;
  box-sizing: border-box;
  border: var(--frame-w, 6px) solid var(--frame-c, #1c1c1c);
  background-color: #cfc7b8;
  background-repeat: no-repeat;
  background-origin: border-box;
  background-clip: padding-box;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.3),
    0 16px 26px -8px rgba(0, 0, 0, 0.45);
  transition: border-color var(--dur-base) var(--ease-out);
}

.was-panel::after {
  /* a soft sheen: matte is flat, glossy catches the light */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, var(--sheen, 0.05)) 0%, transparent 32%, transparent 64%, rgba(255, 255, 255, calc(var(--sheen, 0.05) * 0.6)) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.was-set.is-empty .was-panel {
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.04) 0 10px, transparent 10px 20px);
}

.was-stage__hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(5, 8, 22, 0.72);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.was-stage__hint[hidden] {
  display: none;
}

.was-stage__empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  pointer-events: none;
}

.was-stage__empty[hidden] {
  display: none;
}

.was-stage__empty > * {
  pointer-events: auto;
}

.was-stage__empty p {
  max-width: 32ch;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
  color: var(--umber);
  font-size: var(--text-sm);
}

.was-stage.is-drop .was-stage__wall {
  outline: 3px dashed var(--amber);
  outline-offset: -10px;
}

.was-stage__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 14px;
  background: var(--white);
  font-size: var(--text-sm);
}

.was-walls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.was-wall {
  width: 28px;
  height: 28px;
  border: 2px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.was-wall[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--ink);
}

.was-photo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
}

.was-photo strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 22ch;
}

.was-quality {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
}

/* Plain facts about the customer's file (its pixel size): no judgement of how it will print. */
.was-quality {
  background: var(--stone-soft);
  color: var(--umber);
}

.was-quality .icon {
  width: 14px;
  height: 14px;
}

/* Controls */
.was-controls {
  display: grid;
  gap: 14px;
  align-content: start;
}

.was-card {
  padding: 16px;
}

.was-card h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.was-card h2 span {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.was-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}

.was-option {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 48px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: center;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.was-option small {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
}

.was-option:hover {
  border-color: var(--ink);
}

.was-option[aria-checked="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.was-option[aria-checked="true"] small {
  color: var(--mist);
}

.was-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.was-swatch {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 52px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
}

.was-swatch i {
  width: 38px;
  height: 38px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
}

.was-swatch[aria-checked="true"] {
  color: var(--ink);
}

.was-swatch[aria-checked="true"] i {
  box-shadow: 0 0 0 2px var(--ink);
}

.was-range {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
}

.was-range input[type="range"] {
  width: 100%;
  accent-color: var(--amber-strong);
  min-height: 40px;
}

.was-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.was-upload {
  display: grid;
  gap: 10px;
}

.was-upload__meta {
  color: var(--muted);
  font-size: var(--text-xs);
}

.was-progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--stone);
  overflow: hidden;
}

.was-progress[hidden] {
  display: none;
}

.was-progress i {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  background: var(--amber-strong);
  transition: width var(--dur-fast) linear;
}

.was-error {
  color: var(--danger);
  font-size: var(--text-sm);
  font-weight: 600;
}

.was-error[hidden] {
  display: none;
}

/* Order box */
.was-order {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--white);
}

.was-order__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.was-order__price strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}

.was-order__price s {
  color: var(--mist);
}

.was-order__price em {
  color: var(--gold);
  font-size: var(--text-sm);
  font-style: normal;
  font-weight: 700;
}

.was-order__summary {
  color: var(--mist);
  font-size: var(--text-sm);
}

.was-order__buttons {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.was-order__buttons .qty {
  background: var(--white);
  color: var(--ink);
}

.was-order__buttons .btn--dark {
  grid-column: 1 / -1;
  border: 1px solid var(--line-on-dark);
}

.was-order__note {
  display: flex;
  gap: 8px;
  color: var(--mist);
  font-size: var(--text-xs);
}

.was-order__note .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

@media (min-width: 960px) {
  .was__grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    align-items: start;
  }

}

/* Hidden means hidden, also for buttons and flex rows inside the customiser */
.was [hidden] {
  display: none !important;
}

/* The preview stays in view while the options below (phone) or beside it (desktop) are changed. */
.was-stage-wrap {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 5;
  align-self: start;
}

@media (max-width: 959px) {
  .was-stage__wall {
    aspect-ratio: 16 / 10;
    padding: 5%;
  }

  .was-stage__bar {
    padding: 6px 12px;
  }
}

/* Narrow phones: nothing in the customiser may be wider than the screen */
.was__grid > * {
  min-width: 0;
}

@media (max-width: 959px) {
  .was-wall {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 379px) {
  .was-order__buttons {
    grid-template-columns: 1fr;
  }

  .was-order__buttons .qty {
    justify-self: start;
  }
}

/* The original on its way to FrameX when the set is ordered */
.was-status {
  color: var(--brown-deep);
  font-size: var(--text-sm);
  font-weight: 700;
}

.was-status[hidden] {
  display: none;
}

.was-upload__quality {
  margin-top: 2px;
}
