/* Commande d'un tirage : panneau de la visionneuse et page de commande
   partagent la même liste de formats, les mêmes encres et le même bouton.
   Chargé après artist-edition.css. */

/* --- Arrivée des photographies -------------------------------------------- */
/* La planche garde son papier gris jusqu'à ce que la photo soit décodée, puis
   le papier s'efface en fondu. Le pseudo-élément n'est jamais animé par GSAP. */
.artist-edition .plate > a[data-photo] {position: relative}
.artist-edition .plate > a[data-photo].is-arriving::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: #eae7e1; opacity: 1; transition: opacity .6s ease;
}
.artist-edition[data-view=index] .plate > a[data-photo].is-arriving::after {background: var(--paper)}
.artist-edition .plate > a[data-photo].is-loaded::after {opacity: 0}
.artist-edition .plate > a[data-photo] img {transition: filter .4s ease}
.artist-edition[data-view=overview] .plate > a:hover,
.artist-edition[data-view=chapter] .plate > a:hover {opacity: 1}
@media (hover: hover) and (pointer: fine) {
  .artist-edition .plate > a[data-photo]:hover img {filter: brightness(.92)}
}

/* --- Liste de formats partagée -------------------------------------------- */
.order-formats {margin: 0; padding: 0; border: 0; min-width: 0}
.order-formats legend {padding: 0; margin-bottom: 6px; font-size: 12px; color: var(--muted)}
.order-format {
  position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-areas: 'radio name price' 'radio dim price';
  align-items: center; column-gap: 14px; row-gap: 2px; padding: 13px 8px 13px 0; margin: 0;
  border-top: 1px solid var(--rule); cursor: pointer; font-size: 15px; line-height: 1.3; color: var(--ink);
  transition: background-color .2s ease;
}
.order-format:last-child {border-bottom: 1px solid var(--rule)}
.order-format input {position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none}
.order-radio {grid-area: radio; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 50%; box-sizing: border-box; display: block; transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease}
.order-name {grid-area: name; font-weight: 600; transition: color .2s ease}
.order-dim {grid-area: dim; font-size: 11px; color: var(--muted)}
.order-price {grid-area: price; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500}
.order-format input:checked ~ .order-radio {background: var(--accent-surface); border-color: var(--accent-surface); box-shadow: inset 0 0 0 3px var(--paper)}
.order-format input:checked ~ .order-name {color: var(--accent)}
.order-format:has(input:checked) {background: #ecece6}
.order-format:has(input:checked) .order-radio {box-shadow: inset 0 0 0 3px #ecece6}
@media (hover: hover) {.order-format:hover {background: #ecece6}}
.order-format:has(input:focus-visible) {outline: 2px solid var(--accent); outline-offset: 2px; z-index: 1}
.order-notes {list-style: none; margin: 20px 0 0; padding: 0; font-size: 12px; line-height: 1.6; color: var(--muted)}
.order-notes li {padding-left: 14px; position: relative}
.order-notes li::before {content: ''; position: absolute; left: 0; top: .72em; width: 6px; height: 1px; background: currentColor}
.order-submit, .pay-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 56px;
  padding: 12px 20px; margin: 0; border: 0; border-radius: 0; background: var(--accent-surface); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color .2s ease, transform .2s ease;
}
.order-submit:hover, .pay-btn:hover {background: #ed4400}
.order-submit:active, .pay-btn:active {transform: translateY(1px)}
.order-submit:disabled, .pay-btn:disabled {opacity: .45; cursor: default; transform: none}
.order-submit .icon-arrow, .pay-btn .icon-arrow {width: 22px; height: 22px; transition: transform .25s ease}
.order-submit:hover .icon-arrow, .pay-btn:hover .icon-arrow {transform: translateX(4px)}
.order-total {font-variant-numeric: tabular-nums}

/* --- Bouton de la visionneuse --------------------------------------------- */
.photo-viewer .viewer-buy {
  appearance: none; border: 0; border-radius: 0; margin: 0; padding: 10px 18px; min-height: 44px; display: flex; align-items: center; gap: 12px;
  background: var(--accent-surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s ease;
}
.photo-viewer .viewer-buy:hover {background: #ed4400}
.photo-viewer .viewer-buy .icon-arrow {width: 20px; height: 20px; transition: transform .25s ease}
.photo-viewer .viewer-buy:hover .icon-arrow {transform: translateX(3px)}
.photo-viewer .viewer-buy[aria-expanded=true] {background: var(--ink); color: var(--paper)}

/* --- Panneau de commande dans la visionneuse ------------------------------ */
.photo-viewer {--order-width: min(440px, 44vw)}
.order-scrim {position: fixed; inset: 0; z-index: 6; background: rgba(16, 16, 16, .32); opacity: 0; pointer-events: none; transition: opacity .4s ease; border: 0; padding: 0; margin: 0; display: none}
.viewer-order {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 7; width: var(--order-width); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 22px; padding: 22px 32px max(28px, env(safe-area-inset-bottom));
  background: var(--paper); color: var(--ink); border-left: 1px solid var(--rule); overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(100%); visibility: hidden; transition: transform .55s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .55s;
}
.photo-viewer.is-ordering .viewer-order {transform: none; visibility: visible; transition-delay: 0s}
.photo-viewer > header, .photo-viewer > footer, .photo-viewer > .viewer-stage {transition: margin-right .55s cubic-bezier(.16, 1, .3, 1)}
.photo-viewer.is-ordering > header, .photo-viewer.is-ordering > footer, .photo-viewer.is-ordering > .viewer-stage {margin-right: var(--order-width)}
.order-head {display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px}
.order-kicker {font-size: 11px; line-height: 1.4; text-transform: uppercase; letter-spacing: .04em; color: var(--muted)}
.order-close {padding: 8px 0; min-height: 44px; font-size: 12px; color: var(--ink)}
.order-close:hover {color: var(--accent)}
.order-identity {display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px}
.order-preview {display: none}
.order-title {margin: 0; font-family: var(--edition-display); font-stretch: 70%; font-weight: 800; text-transform: uppercase; letter-spacing: -.015em; line-height: .94; font-size: clamp(34px, 3.4vw, 52px); overflow-wrap: anywhere}
.order-location {margin: 0; font-size: 13px; color: var(--muted)}
.order-form {display: flex; flex-direction: column; gap: 18px; margin-top: 6px}
.order-form .order-submit {margin-top: 4px}
.order-form .order-notes {margin-top: 0}
.order-more {font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; width: fit-content; padding: 6px 0}
.order-more:hover {color: var(--accent)}
@media (max-width: 850px) {
  .photo-viewer {--order-width: 0px}
  .order-scrim {display: block}
  .photo-viewer.is-ordering .order-scrim {opacity: 1; pointer-events: auto}
  .viewer-order {
    top: auto; left: 0; right: 0; width: auto; max-height: min(84svh, 720px); gap: 16px;
    padding: 14px 20px max(20px, env(safe-area-inset-bottom)); border-left: 0; border-top: 1px solid var(--rule);
    transform: translateY(100%);
  }
  .viewer-order::before {content: ''; display: block; width: 44px; height: 3px; margin: 0 auto -6px; background: var(--rule); border-radius: 2px}
  .order-identity {grid-template-columns: 56px minmax(0, 1fr); column-gap: 14px; align-items: center}
  .order-preview {display: block; grid-row: span 2; width: 56px; height: 72px; object-fit: contain; object-position: left center; background: transparent}
  .order-title {font-size: 30px}
  .order-format {padding-block: 11px}
  .order-notes {display: none}
  .order-form {gap: 14px}
}
@media (max-width: 600px) {
  .photo-viewer footer {gap: 0 12px}
  .photo-viewer .viewer-buy {padding: 8px 14px; font-size: 12px; margin-left: auto}
}
@media (prefers-reduced-motion: reduce) {
  .viewer-order, .order-scrim, .photo-viewer > header, .photo-viewer > footer, .photo-viewer > .viewer-stage, .artist-edition .plate > a[data-photo].is-arriving::after {transition: none}
}

/* --- Page de commande ------------------------------------------------------- */
.checkout-page {--rule: #c9c9c1}
.checkout-page #main {display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(32px, 6vw, 96px); row-gap: 0; max-width: 1240px; width: auto; margin: 0 auto; padding: 100px var(--edition-gutter) 70px}
.checkout-page nav.breadcrumbs {grid-column: 1 / -1; margin: 0 0 28px}
.checkout-page .co-left, .checkout-page .co-right {position: static; padding: 0; border: 0; gap: 0}
.checkout-page .co-left {display: flex; flex-direction: column; gap: 26px}
.checkout-page .photo-frame {aspect-ratio: auto; background: transparent; border: 0; display: block; overflow: visible}
.checkout-page .photo-frame img {display: block; width: auto; max-width: 100%; height: auto; max-height: 62svh; object-fit: contain; object-position: left top}
.checkout-page .photo-meta {gap: 6px}
.checkout-page .photo-title {font-family: var(--edition-display); font-stretch: 70%; font-weight: 800; text-transform: uppercase; letter-spacing: -.015em; line-height: .94; font-size: clamp(44px, 5vw, 76px); color: var(--ink); font-style: normal; overflow-wrap: anywhere}
.checkout-page .photo-loc {font-size: 13px; color: var(--muted); letter-spacing: 0; text-transform: none; font-family: inherit}
.checkout-page .section-label {font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0; text-transform: none; font-family: inherit}
.checkout-page .fmt-list {display: block}
.checkout-page .co-right {display: flex; flex-direction: column; gap: 26px; padding-top: 6px}
.checkout-page .form-title {font-family: var(--edition-display); font-stretch: 70%; font-weight: 800; text-transform: uppercase; letter-spacing: -.015em; line-height: .94; font-size: clamp(34px, 3.6vw, 52px); font-style: normal; color: var(--ink)}
.checkout-page .fields-grid {gap: 18px 24px}
.checkout-page .field {gap: 6px}
.checkout-page .field label {font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; font-family: inherit}
.checkout-page .field input, .checkout-page .field select, .checkout-page .field textarea {
  background: transparent; border: 0; border-bottom: 1px solid #a39e96; border-radius: 0; padding: 12px 0; color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.4; transition: border-color .2s ease;
}
.checkout-page .field select {background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23101010' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 2px center; padding-right: 28px; cursor: pointer}
.checkout-page .field input:focus, .checkout-page .field select:focus, .checkout-page .field textarea:focus {border-bottom-color: var(--ink); outline: none}
.checkout-page .field input:focus-visible, .checkout-page .field select:focus-visible, .checkout-page .field textarea:focus-visible {outline: 2px solid var(--accent); outline-offset: 4px}
.checkout-page .field input.err, .checkout-page .field select.err, .checkout-page .field textarea.err {border-bottom-color: var(--accent); border-bottom-width: 2px}
.checkout-page .field textarea {min-height: 72px}
.checkout-page .addr-dropdown {background: var(--paper); border: 1px solid #a39e96; box-shadow: 0 14px 30px rgba(16, 16, 16, .12)}
.checkout-page .addr-item {color: var(--ink); border-bottom-color: var(--rule)}
.checkout-page .addr-item:hover, .checkout-page .addr-item.addr-active {background: #ffeadf}
.checkout-page .addr-item-main {color: var(--ink)}
.checkout-page .order-recap {background: transparent; border: 0; border-top: 1px solid var(--ink); padding: 18px 0 0; gap: 10px}
.checkout-page .or-title {font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; font-family: inherit; margin: 0}
.checkout-page .or-item, .checkout-page .or-ship {font-size: 15px; color: var(--ink)}
.checkout-page .or-item-label {color: var(--ink); white-space: normal}
.checkout-page .or-item-val, .checkout-page .or-total-val {font-family: inherit; color: var(--ink); font-variant-numeric: tabular-nums}
.checkout-page .or-ship {color: var(--muted)}
.checkout-page .or-ship-free {font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--ink); font-family: inherit}
.checkout-page .or-sep {border-top-color: var(--rule)}
.checkout-page .or-total-label {font-size: 15px; font-weight: 600}
.checkout-page .or-total-val {font-size: 26px; font-weight: 600; letter-spacing: -.02em}
.checkout-page .pay-section {gap: 12px}
.checkout-page .pay-btn {font-size: 16px; letter-spacing: 0; text-transform: none; font-family: inherit; border-radius: 0}
.checkout-page .pay-btn.loading {pointer-events: none}
.checkout-page .pay-spinner {border-color: rgba(16, 16, 16, .2); border-top-color: var(--ink)}
.checkout-page .error-msg {font-size: 13px; color: var(--accent); text-align: left; letter-spacing: 0; font-family: inherit}
.checkout-page .trust-list {list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule)}
.checkout-page .trust-list li {display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 13px; line-height: 1.5}
.checkout-page .trust-list li span:last-child {color: var(--muted); text-align: right}
.checkout-page .legal-note {font-size: 12px; color: var(--muted); text-align: left; line-height: 1.6}
.checkout-page .legal-note a {color: var(--ink); text-decoration: underline; text-underline-offset: 3px}
.checkout-page .reading-footer {margin-top: 30px}
@media (max-width: 800px) {
  .checkout-page #main {grid-template-columns: 1fr; padding-top: 92px; row-gap: 34px}
  .checkout-page nav.breadcrumbs {margin-bottom: 0}
  .checkout-page .co-left {gap: 20px}
  .checkout-page .photo-frame img {max-height: 52svh}
  .checkout-page .photo-title {font-size: clamp(40px, 12vw, 60px)}
  .checkout-page .co-right {padding-top: 0}
  .checkout-page .or-total-val {font-size: 22px}
}
@media (max-width: 600px) {
  .checkout-page #main {padding-top: 84px; padding-bottom: 40px}
  .checkout-page .fields-grid {gap: 16px}
}
