/* ── Brand fonts ─────────────────────────────────────────────────────────── */
.brand-max-and-lily {
  font-family: 'Sofia Pro', sans-serif;
}
.brand-max-and-lily h3,
.brand-max-and-lily h4,
.brand-max-and-lily .form-label,
.brand-max-and-lily .selected-item-label,
.brand-max-and-lily .button {
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 700;
}

.brand-plank-and-beam {
  font-family: 'Greycliff CF', sans-serif;
}
.brand-plank-and-beam h3,
.brand-plank-and-beam h4,
.brand-plank-and-beam .form-label,
.brand-plank-and-beam .selected-item-label,
.brand-plank-and-beam .button {
  font-family: 'Greycliff CF', sans-serif;
  font-weight: 700;
}

.brand-maxtrix {
  font-family: 'Rethink Sans', sans-serif;
}
.brand-maxtrix h3,
.brand-maxtrix h4,
.brand-maxtrix .form-label,
.brand-maxtrix .selected-item-label,
.brand-maxtrix .button {
  font-family: 'Rethink Sans', sans-serif;
  font-weight: 700;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

.hidden {
  display: none;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* ── Form layout ─────────────────────────────────────────────────────────── */
form .form-row {
  display: flex;
  flex-direction: column;
  margin: 16px 0 32px 0;
}

form .form-row .input-data {
  width: 100%;
  height: auto;
  margin-top: 20px;
  position: relative;
}

.form-group {
  height: 48px;
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid rgb(221, 221, 221);
  color: rgb(22, 22, 22);
  line-height: 20px;
  margin-bottom: 12px;
  box-sizing: border-box;
  position: relative;
}

.form-input {
  height: 48px;
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid rgb(221, 221, 221);
  color: rgb(22, 22, 22);
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

select, .form-select {
  height: 48px;
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid rgb(221, 221, 221);
  color: rgb(22, 22, 22);
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 12px;
  box-sizing: border-box;
  background-color: #fff;
  cursor: pointer;
}

.form-label {
  display: inline-block;
  margin-bottom: 4px;
  color: rgb(22, 22, 22);
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
}

.ast {
  color: rgb(242, 79, 102);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.button {
  display: flex;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 4px;
  justify-content: center;
  align-items: center;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  transition: background-color 350ms;
  background-color: rgb(22, 22, 22);
  color: rgb(255, 255, 255);
  margin-top: 16px;
}

.button:hover {
  background-color: #333;
}

.order-input-group {
  display: flex;
  gap: 8px;
}

.order-input-group input {
  flex: 1;
}

.order-input-group button {
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  background-color: rgb(22, 22, 22);
  color: white;
  font-weight: 500;
  cursor: pointer;
  height: 48px;
  transition: background-color 350ms;
}

.order-input-group button:hover {
  background-color: #333;
}

/* ── Items list ──────────────────────────────────────────────────────────── */
.items-container {
  margin-top: 32px;
}

.items-list {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.item-row:last-child {
  border-bottom: none;
}

.item-image {
  flex-shrink: 0;
}

.item-image img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background-color: #f5f5f5;
}

.item-image.placeholder {
  width: 60px;
  height: 60px;
  background-color: #f5f5f5;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.item-details {
  flex: 1;
}

.item-title {
  font-weight: 500;
  color: rgb(22, 22, 22);
  margin-bottom: 4px;
}

.item-sku {
  font-size: 12px;
  color: #666;
}

.item-price {
  font-size: 14px;
  font-weight: 500;
  color: rgb(22, 22, 22);
  margin-top: 4px;
}

.item-checkbox {
  flex-shrink: 0;
}

.item-checkbox input {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.loading {
  color: #666;
  font-style: italic;
}

/* ── Max and Lily theme ──────────────────────────────────────────────────── */
.max-and-lily-theme .items-list {
  border: none;
  border-radius: 0;
  padding: 0;
  background-color: #fff;
}

.max-and-lily-theme .item-row {
  padding: 16px 0;
  border-bottom: 1px solid #e5e5e5;
  align-items: flex-start;
  gap: 20px;
}

.max-and-lily-theme .item-row:last-child {
  border-bottom: 1px solid #e5e5e5;
}

.max-and-lily-theme .item-image img {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
}

.max-and-lily-theme .item-image.placeholder {
  width: 100px;
  height: 100px;
  border-radius: 8px;
}

.max-and-lily-theme .item-details {
  padding-top: 4px;
}

.max-and-lily-theme .item-title {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
  margin-bottom: 6px;
  line-height: 1.4;
}

.max-and-lily-theme .item-sku {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}

.max-and-lily-theme .item-price {
  font-size: 16px;
  font-weight: 600;
  color: #c41d7f;
}

.max-and-lily-theme .item-checkbox {
  padding-top: 40px;
}

.max-and-lily-theme .item-checkbox input {
  width: 22px;
  height: 22px;
  accent-color: #c41d7f;
}

/* ── Plank and Beam theme ────────────────────────────────────────────────── */
.plank-and-beam-theme .items-list {
  border: none;
  border-radius: 0;
  padding: 0;
  background-color: #fff;
}

.plank-and-beam-theme .item-row {
  padding: 16px 0;
  border-bottom: 1px solid #e5e5e5;
  align-items: flex-start;
  gap: 20px;
}

.plank-and-beam-theme .item-row:last-child {
  border-bottom: 1px solid #e5e5e5;
}

.plank-and-beam-theme .item-image img {
  width: 100px;
  height: 100px;
  border-radius: 4px;
  object-fit: cover;
}

.plank-and-beam-theme .item-image.placeholder {
  width: 100px;
  height: 100px;
  border-radius: 4px;
}

.plank-and-beam-theme .item-details {
  padding-top: 4px;
}

.plank-and-beam-theme .item-title {
  font-weight: 500;
  font-size: 15px;
  color: #1a1a1a;
  margin-bottom: 6px;
  line-height: 1.4;
}

.plank-and-beam-theme .item-sku {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}

.plank-and-beam-theme .item-price {
  font-size: 16px;
  font-weight: 600;
  color: #2d6a6a;
}

.plank-and-beam-theme .item-checkbox {
  padding-top: 40px;
}

.plank-and-beam-theme .item-checkbox input {
  width: 22px;
  height: 22px;
  accent-color: #2d6a6a;
}

/* ── Selected items & issue fields ───────────────────────────────────────── */
.selected-item-field {
  margin-bottom: 12px;
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.selected-item-label {
  display: block;
  margin-bottom: 4px;
  color: rgb(22, 22, 22);
  font-weight: 500;
  font-size: 14px;
}

/* ── Wayfair notice ──────────────────────────────────────────────────────── */
.wayfair-notice {
  padding: 20px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  text-align: center;
}

.wayfair-notice h4 {
  margin-bottom: 12px;
  color: #856404;
}

.wayfair-notice a {
  color: #0056b3;
  text-decoration: underline;
}

/* ── Manual order fallback ───────────────────────────────────────────────── */
.manual-fallback {
  padding: 16px 12px;
}

.manual-fallback-msg {
  font-size: 14px;
  color: #444;
  margin-bottom: 6px;
}

.manual-fallback-sub {
  font-size: 13px;
  color: #888;
  margin-bottom: 14px;
}

.manual-fallback-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.manual-fallback-input-row .form-input {
  flex: 1;
  margin-bottom: 0;
}

.manual-fallback-input-row button {
  flex-shrink: 0;
  padding: 0 20px;
  height: 48px;
  border: none;
  border-radius: 4px;
  background-color: rgb(22, 22, 22);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 350ms;
}

.manual-fallback-input-row button:hover {
  background-color: #333;
}

/* ── Parts picker ────────────────────────────────────────────────────────── */
.parts-picker {
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  font-size: 13px;
}

.parts-picker-loading {
  padding: 10px 12px;
  color: #888;
  font-style: italic;
}

.parts-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.parts-picker-label {
  font-weight: 600;
  font-size: 13px;
  color: #161616;
}

.parts-picker-clear {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
}

.parts-picker-clear:hover {
  color: #444;
}

.parts-picker-list {
  max-height: 220px;
  overflow-y: auto;
}

.parts-group-label {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  background-color: #fafafa;
  border-bottom: 1px solid #eee;
}

.parts-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.parts-picker-item:last-child {
  border-bottom: none;
}

.parts-picker-item:hover {
  background-color: #f7f7f7;
}

.parts-picker-checkbox {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.parts-picker-sku {
  font-weight: 600;
  color: #161616;
  min-width: 90px;
  flex-shrink: 0;
}

.parts-picker-desc {
  flex: 1;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parts-picker-qty {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
}

.parts-picker-other-row {
  border-top: 1px solid #ddd;
}

.parts-picker-other-item {
  color: #555;
}

.parts-picker-other-text {
  font-size: 13px;
  font-style: italic;
  color: #666;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
  .button {
    margin-top: 64px;
  }

  form .form-row .input-data {
    margin: 19px 0;
  }

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