/* ==========================================================================
   John Fehringer Gallery Exclusive Site
   Full replacement CSS — v1.40
   ========================================================================== */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: #3f403f;
  color: #f3efe8;
  line-height: 1.5;
}

a { color: #c98e2e; }

/* Login */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(520px, 100%);
  background: #2f3030;
  border: 1px solid rgba(255,255,255,.16);
  padding: 36px;
  box-shadow: 0 24px 80px rgba(0,0,0,.32);
}

.login-logo {
  width: 110px;
  height: 110px;
  object-fit: cover;
  display: block;
  margin-bottom: 22px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .34em;
  color: #c1b9b0;
  font-size: .76rem;
}

.login-card h1,
.site-header h1 {
  font-weight: 300;
  letter-spacing: .18em;
  color: #dfa33c;
  margin: .2rem 0 1rem;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.password-field input { min-width: 0; }

.password-toggle {
  border: 1px solid rgba(255,255,255,.2);
  background: #575857;
  color: #fff;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}

.login-form input,
.contact-grid input,
.contact-grid textarea,
.search-label input,
.subject-filter-label select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.2);
  background: #292a2a;
  color: #fff;
  padding: 12px;
  border-radius: 2px;
}

.login-form button,
.submit-button,
.filter-buttons button,
.link-button {
  border: 0;
  background: #c98e2e;
  color: #181818;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .03em;
}

.form-error,
.validation-messages p {
  background: #5c2b2b;
  color: #fff;
  padding: 10px 12px;
  border-left: 4px solid #e8b4a9;
}

/* Header */

.site-header {
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: #353635;
}

.header-inner {
  width: min(1560px, calc(100% - 44px));
  margin: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 0;
}

.brand-logo {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.2);
}

.deadline { color: #ded7ce; }

.logout {
  margin-left: auto;
  text-decoration: none;
  color: #bbb;
}

/* Page panels */

.page-shell {
  width: min(1560px, calc(100% - 44px));
  margin: auto;
  padding: 28px 0 80px;
}

.intro-panel,
.term-card,
.summary-panel,
.inventory-item,
.card-example,
.message-page,
.receipt-box {
  background: #f5f0e9;
  color: #232323;
  border: 1px solid rgba(0,0,0,.08);
}

.intro-panel {
  padding: 30px;
  margin-bottom: 22px;
}

.intro-panel h2 {
  margin-top: 0;
  font-weight: 400;
  letter-spacing: .08em;
  color: #654f44;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.term-card { padding: 18px; }

.term-card h3 {
  margin: 0 0 8px;
  color: #654f44;
}

.term-card p { margin-bottom: 0; }

.card-example {
  padding: 14px 18px;
  margin-bottom: 20px;
}

.link-button {
  background: transparent;
  color: #8a5a13;
  text-decoration: underline;
  padding: 0;
}

/* Toolbar */

.inventory-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(63,64,63,.96);
  backdrop-filter: blur(5px);
  padding: 14px 0;
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
}

.toolbar-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-buttons button {
  background: #575857;
  color: #f6f1eb;
  border: 1px solid rgba(255,255,255,.16);
  padding: 9px 10px;
}

.filter-buttons button.active {
  background: #c98e2e;
  color: #151515;
}

.subject-filter-label {
  display: grid;
  gap: 4px;
  color: #ddd;
  min-width: 180px;
  font-weight: 700;
  font-size: .86rem;
}

.subject-filter-label select { height: 43px; }

.subject-filter-label select option {
  color: #111;
  background: #fff;
}

.search-label {
  color: #ddd;
  min-width: 220px;
}

/* Main order layout */

#orderForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 32px;
  align-items: start;
}

#orderForm > * { min-width: 0; }

.inventory-list { min-width: 0; }

.section-heading {
  letter-spacing: .15em;
  text-transform: uppercase;
  font-size: 1rem;
  color: #d7c7b8;
  margin: 28px 0 12px;
}

.section-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

/* Inventory item card */

.inventory-item {
  display: grid;
  grid-template-columns: 170px 220px minmax(320px, 1fr) 280px;
  gap: 20px;
  align-items: start;
  padding: 24px 16px;
  max-width: 100%;
  min-height: 198px;
  overflow: visible;
}

.inventory-item.sold-out { opacity: .78; }
.inventory-item.sold-out .item-order { opacity: .65; }

.inventory-item.has-error {
  outline: 3px solid rgba(178,59,43,.55);
  background: #fff8f4;
}

.thumb-button {
  grid-column: 1;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  justify-self: start;
  align-self: start;
}

.thumb-button img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #ddd;
  border: 1px solid #111;
}

.item-main {
  grid-column: 2;
  min-width: 0;
  min-height: 150px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  align-self: start;
}

.item-title {
  margin: 0 0 26px 0;
  font-size: 17pt;
  line-height: 1.12;
  color: #1f1f1f;
  font-weight: 800;
  letter-spacing: .01em;
}

.item-specs {
  display: block;
  margin: 0;
  color: #222;
  font-size: 11pt;
  line-height: 1.32;
}

.item-specs div { display: block; }

.item-code {
  align-self: end;
  margin-top: 30px;
  color: #444;
  font-size: 8pt;
  line-height: 1.2;
}

.item-description {
  grid-column: 3;
  min-width: 0;
  width: min(100%, 540px);
  justify-self: start;
  align-self: center;
  margin-left: -6px;
  padding: 0;
  font-size: 10pt;
  color: #2b2b2b;
  line-height: 1.38;
}

.item-description.empty { display: none; }

.item-description p { margin: 0; }
.item-description p + p { margin-top: 8px; }

.item-description:not(.empty) {
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.22);
  padding: 12px 16px;
  min-height: 102px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-notes {
  font-size: 10pt;
  color: #333;
  margin: 0;
}

.status-pill {
  white-space: nowrap;
  font-size: .8rem;
  padding: 4px 8px;
  border-radius: 999px;
}

.status-available {
  background: #ffd08e;
  color: #2b2b2b;
}

.status-sold {
  background: #f4d6d6;
  color: #7b1f1f;
  font-weight: 700;
}

.item-order {
  grid-column: 4;
  min-width: 280px;
  width: 280px;
  max-width: 280px;
  justify-self: end;
  align-self: start;
  display: grid;
  gap: 14px;
  justify-items: stretch;
  margin: 0;
  transform: none;
}

.item-order .price-line {
  font-size: 15pt;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 42px 0;
  color: #1f1f1f;
  letter-spacing: .01em;
  transform: translateY(12px);
}

.inventory-pill,
.status-pill.status-available {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 280px;
  max-width: 280px;
  min-width: 280px;
  background: #ffd08e;
  border: 1px solid #e5bd68;
  color: #2b2b2b;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 10pt;
  line-height: 1.2;
  white-space: nowrap;
}

.inventory-pill strong {
  font-weight: 400;
  min-width: 34px;
  text-align: right;
}

.item-order label,
.item-order .quantity-row,
.item-order .qty-row {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  width: 280px;
  max-width: 280px;
  color: #2b2b2b;
  font-size: 10pt;
}

.item-order .qty-input {
  width: 58px;
  max-width: 58px;
  height: 34px;
  text-align: right;
  padding: 6px 8px;
  border: 1px solid #9f9f9f;
  border-radius: 7px;
  background: #fff;
  color: #111;
}

.qty-input.field-error,
.qty-input:invalid {
  border-color: #b23b2b !important;
  box-shadow: 0 0 0 3px rgba(178,59,43,.22) !important;
  background: #fff8f4 !important;
}

.item-error { grid-column: 1 / -1; }

.item-error p {
  margin: .35rem 0 0;
  background: #6a2d2d;
  color: #fff;
  padding: 7px 9px;
  border-left: 4px solid #e1a29b;
}

/* Order summary */

.summary-panel {
  position: sticky;
  top: 96px;
  padding: 22px;
  margin-top: 64px;
  max-height: calc(100vh - 118px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.summary-panel.has-error {
  box-shadow: 0 0 0 3px rgba(178,59,43,.35);
}

.summary-panel h2 {
  margin-top: 0;
  color: #654f44;
}

.summary-section {
  border-bottom: 2px solid #3b342e;
  margin-bottom: 16px;
  padding-bottom: 10px;
}

.summary-header {
  font-weight: 800;
  letter-spacing: .08em;
  color: #2c2824;
  border-bottom: 1px solid #d8d0c8;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.summary-row,
.summary-header,
.summary-total-row {
  display: grid;
  gap: 12px;
  align-items: baseline;
}

.two-col { grid-template-columns: minmax(0, 1fr) auto; }
.three-col { grid-template-columns: minmax(0, 1fr) 70px 100px; }

.summary-row {
  padding: 4px 0;
  border-bottom: 1px solid #e1d9d1;
}

.summary-row span { min-width: 0; }

.summary-row strong,
.summary-total-row strong {
  text-align: right;
  white-space: nowrap;
}

.subtotal-row {
  margin-top: 6px;
  font-weight: 700;
}

.section-total {
  font-weight: 800;
  border-bottom: 0;
  margin-top: 4px;
}

.summary-total-row {
  grid-template-columns: minmax(0, 1fr) auto;
  font-size: 1.12rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-top: 3px solid #3b342e;
  border-bottom: 3px solid #3b342e;
  padding: 10px 0;
  margin: 10px 0 18px;
}

.validation-messages { margin: 12px 0; }
.validation-messages p:first-child { font-weight: 700; }

/* Payment/contact */

.payment-options {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.payment-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #ddd5cd;
  padding: 10px;
  background: #fff;
}

.payment-option input { margin-right: 8px; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.contact-grid label {
  display: grid;
  gap: 5px;
  color: #433b35;
  font-weight: 700;
  font-size: .86rem;
}

.contact-grid .span-two { grid-column: 1 / -1; }

.form-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.form-heading-row h3 { margin: 0; }

.form-heading-row span {
  font-weight: 700;
  color: #111;
  letter-spacing: .04em;
}

.fine-print {
  font-size: .85rem;
  color: #665e57;
}

.submit-button {
  width: 100%;
  font-size: 1rem;
  margin-top: 8px;
}

/* Cards */

.art-card-note {
  background: #f5f0e9;
  color: #2b2b2b;
  border-left: 4px solid #c98e2e;
  padding: 12px 14px;
  margin: 0 0 12px;
}

.card-bonus-status {
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 4px solid #c98e2e;
  background: #fff;
  color: #2a2521;
  font-weight: 700;
}

.card-bonus-status.status-ok {
  border-left-color: #4d8a50;
  background: #eef6ed;
  color: #1f4d25;
}

.card-bonus-status.status-error {
  border-left-color: #b23b2b;
  background: #fff0ec;
  color: #5c2b2b;
}

.no-bonus-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #ddd5cd;
  color: #2a2521;
  font-weight: 700;
}

.no-bonus-option span { line-height: 1.35; }

.auto-bonus-note {
  margin: 0;
  color: #6f665f;
  font-size: .78rem;
  line-height: 1.35;
}

/* Modals */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.78);
  padding: 22px;
  overflow: auto;
}

.modal-open { overflow: hidden; }

.image-modal-card {
  position: relative;
  width: min(92vw, 1100px);
  margin: 28px auto;
  background: #111;
  color: #fff;
}

.image-modal-card img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: auto;
}

.image-modal-card p {
  margin: 0;
  padding: 12px 16px;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  background: rgba(255,255,255,.88);
  cursor: pointer;
}

/* Review / receipt */

.message-page {
  width: min(760px, calc(100% - 32px));
  margin: 40px auto;
  padding: 32px;
}

.message-page h1 { color: #654f44; }

.receipt-box {
  padding: 18px;
  background: #fff;
  margin: 20px 0;
}

.review-card {
  width: min(860px, 100%);
  margin: 30px auto;
  background: #f5f0e9;
  color: #232323;
  padding: 26px;
  border: 1px solid rgba(0,0,0,.15);
  box-shadow: 0 20px 80px rgba(0,0,0,.35);
}

.review-card h2 {
  margin-top: 0;
  color: #654f44;
}

.review-lines,
.review-totals {
  display: grid;
  gap: 8px;
  margin: 12px 0 20px;
}

.review-lines div,
.review-totals div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #ddd5cd;
  padding-bottom: 6px;
}

.review-lines em {
  font-style: normal;
  color: #746b63;
  margin-left: 6px;
}

.review-grand {
  font-size: 1.18rem;
  font-weight: 700;
  border-bottom: 2px solid #3b342e !important;
}

.review-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.edit-button {
  border: 1px solid #8a5a13 !important;
  background: transparent !important;
  color: #8a5a13 !important;
  text-decoration: none !important;
}

.place-button {
  width: auto !important;
  margin-top: 0 !important;
}

.review-note {
  background: #fff;
  border-left: 4px solid #c98e2e;
  padding: 10px 12px;
}

.review-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 20px;
}

.review-contact > div {
  background: #fff;
  border: 1px solid #ddd5cd;
  padding: 10px;
}

.review-contact .span-two { grid-column: 1 / -1; }

.review-totals.invoice-style .review-heading {
  font-weight: 800;
  letter-spacing: .08em;
  background: #f5f0e9;
  border-bottom: 2px solid #3b342e;
}

.review-totals.invoice-style .review-heading.cards { margin-top: 12px; }

.review-totals.invoice-style .review-grand {
  font-weight: 800;
  border-top: 1px solid #3b342e;
}

.receipt-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 18px 0 22px;
}

.receipt-actions .submit-button {
  width: auto;
  margin-top: 0;
}

.receipt-invoice { margin-top: 18px; }

.receipt-invoice .invoice-document {
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}

/* Term detail popups */

.term-title {
  margin: 0 0 8px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #654f44;
  font: inherit;
  font-size: 1.18rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.term-title:hover,
.term-title:focus {
  color: #8a5a13;
  outline: none;
}

.terms-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
}

.terms-modal[hidden] { display: none; }

.terms-modal-card {
  position: relative;
  width: min(760px, calc(100vw - 38px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  background: #f5f0e9;
  color: #252525;
  padding: 30px;
  border: 1px solid #d7cec4;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}

.terms-modal-card h2 {
  margin-top: 0;
  color: #654f44;
  letter-spacing: .06em;
}

.terms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  background: #fff;
}

.terms-table th {
  background: #333735;
  color: #fff;
  text-align: left;
}

.terms-table th,
.terms-table td {
  padding: 10px;
  border: 1px solid #d6cfc7;
}

.terms-modal-card ul { margin-top: 8px; }
.terms-close { color: #222; }

.cards-posters-page .intro-panel h2 { margin-bottom: .65rem; }
.cards-posters-page .term-card:first-child { border-color: rgba(121,84,52,.28); }

/* Focus */

.filter-buttons button:focus,
.qty-input:focus,
.contact-grid input:focus,
.contact-grid textarea:focus,
.search-label input:focus,
.subject-filter-label select:focus {
  outline: 3px solid rgba(201,142,46,.35);
  outline-offset: 2px;
}

/* Responsive */

@media (max-width: 1180px) {
  #orderForm { grid-template-columns: 1fr; }

  .summary-panel {
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 28px;
  }
}

@media (max-width: 1100px) {
  .page-shell,
  .header-inner {
    width: min(100% - 32px, 100%);
  }

  .terms-grid { grid-template-columns: 1fr 1fr; }

  .inventory-item {
    grid-template-columns: 150px minmax(0, 1fr) 280px;
  }

  .thumb-button { grid-column: 1; }
  .item-main { grid-column: 2; }
  .item-order { grid-column: 3; }

  .item-description {
    grid-column: 2 / -1;
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 780px) {
  .header-inner { align-items: flex-start; }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .site-header h1 { font-size: 1.35rem; }

  .inventory-toolbar {
    position: static;
    display: block;
  }

  .toolbar-controls { display: block; }

  .subject-filter-label,
  .search-label {
    display: block;
    margin-top: 12px;
  }

  .subject-filter-label select { width: 100%; }

  .terms-grid { grid-template-columns: 1fr; }

  .inventory-item {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .thumb-button img {
    width: 100px;
    height: 100px;
  }

  .thumb-button { grid-column: 1; }
  .item-main { grid-column: 2; }

  .item-description,
  .item-order {
    grid-column: 1 / -1;
  }

  .item-order,
  .inventory-pill,
  .status-pill.status-available,
  .item-order label,
  .item-order .quantity-row,
  .item-order .qty-row {
    justify-self: stretch;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .contact-grid { grid-template-columns: 1fr; }
  .form-heading-row { display: block; }
  .three-col { grid-template-columns: minmax(0, 1fr) 54px 86px; }
  .summary-total-row { font-size: 1rem; }

  .review-actions { display: grid; }
  .place-button { width: 100% !important; }

  .review-lines div,
  .review-totals div {
    display: block;
  }

  .review-lines strong,
  .review-totals strong {
    display: block;
    margin-top: 2px;
  }

  .review-contact { grid-template-columns: 1fr; }
  .receipt-actions { display: grid; }
  .receipt-actions .submit-button { width: 100%; }

  .receipt-invoice { overflow-x: auto; }
  .receipt-invoice .invoice-document { min-width: 720px; }
}

/* Print */

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .site-header,
  .receipt-box,
  .receipt-actions,
  .message-page > h1,
  .message-page > p,
  .no-print {
    display: none !important;
  }

  .message-page {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 0;
  }

  .receipt-invoice { margin: 0; }

  .receipt-invoice .invoice-document {
    max-width: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .invoice-document { page-break-inside: auto; }
}
