/* Miravo Personalization v1.0.0 — GPO-style storefront personalization UI */
.mw-po-container {
  margin: 18px 0 22px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #111;
}
.mw-po-container * {
  box-sizing: border-box;
}
.mw-po-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cc9200;
  margin: 0 0 18px;
}
.mw-po-divider span {
  flex: 1;
  height: 1px;
  background: #e8e2d5;
}
.mw-po-field {
  margin-bottom: 18px;
}
.mw-po-field[hidden] {
  display: none !important;
}
.mw-po-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.mw-po-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.mw-po-req {
  color: #c81e1e;
  margin-left: 2px;
}
.mw-po-label-addon {
  font-weight: 400;
  color: #15803d;
  font-size: 13px;
  margin-left: 4px;
}
.mw-po-selected-note {
  font-size: 12px;
  color: #555;
  text-align: right;
}

/* Image swatches (60x60px like Lucy Engraving) */
.mw-po-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mw-po-swatch-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 68px;
  cursor: pointer;
  margin: 0;
  font-weight: 400;
}
.mw-po-swatch-item input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.mw-po-swatch-box {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  border: 1.5px solid #d4d4d4;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mw-po-swatch-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mw-po-swatch-fallback {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  padding: 4px;
  color: #333;
}
.mw-po-swatch-item:hover .mw-po-swatch-box {
  border-color: #888;
}
.mw-po-swatch-item input:checked + .mw-po-swatch-box {
  border-color: #111;
  box-shadow: 0 0 0 2px #111;
}
.mw-po-swatch-item input:focus-visible + .mw-po-swatch-box {
  outline: 2px solid #cc9200;
  outline-offset: 2px;
}
.mw-po-swatch-caption {
  font-size: 11px;
  line-height: 1.25;
  color: #555;
  text-align: center;
  margin-top: 5px;
  word-break: break-word;
}
.mw-po-swatch-caption em {
  font-style: normal;
  color: #15803d;
  font-weight: 600;
  display: block;
}

/* Visual Font Selector Cards (Font 1 / Font 2 / Font 3) */
.mw-po-font-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 288px;
  gap: 10px;
}
.mw-po-font-card {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.mw-po-font-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.mw-po-font-sample {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 62px;
  padding: 6px 10px;
  border: 1.5px solid #d4d4d4;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  color: #111;
  white-space: nowrap;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mw-po-font-card:hover .mw-po-font-sample {
  border-color: #777;
}
.mw-po-font-card input:checked + .mw-po-font-sample {
  border-color: #111;
  box-shadow: 0 0 0 2px #111;
  background: #fffaf0;
}
.mw-po-font-card input:focus-visible + .mw-po-font-sample {
  outline: 2px solid #cc9200;
  outline-offset: 2px;
}

/* Pill inputs & dropdowns matching --inputs-radius: 26px */
.mw-po-input,
.mw-po-select {
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(0, 0, 0, .4);
  border-radius: 26px !important;
  background: #fff;
  color: #111;
  font-size: 14px;
  box-shadow: none !important;
  outline: none;
  margin: 0;
}
.mw-po-textarea {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid rgba(0, 0, 0, .4);
  border-radius: 18px !important;
  background: #fff;
  color: #111;
  font-size: 14px;
  box-shadow: none !important;
  outline: none;
  resize: vertical;
  margin: 0;
}
.mw-po-input:focus,
.mw-po-select:focus,
.mw-po-textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 1px #111 !important;
}
.mw-po-helper {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(0, 0, 0, .62);
  margin: 6px 0 0;
}
.mw-po-charcount {
  display: block;
  text-align: right;
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}
.mw-po-field-error {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #dc2626;
}
.mw-po-field.has-error .mw-po-input,
.mw-po-field.has-error .mw-po-select,
.mw-po-field.has-error .mw-po-textarea,
.mw-po-field.has-error .mw-po-dropzone {
  border-color: #dc2626 !important;
}

/* File Upload Dropzone */
.mw-po-dropzone {
  position: relative;
  border: 1.5px dashed rgba(0, 0, 0, .32);
  border-radius: 18px;
  padding: 20px 16px;
  background: #fafafa;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.mw-po-dropzone.is-dragover {
  border-color: #cc9200;
  background: #fffaf0;
}
.mw-po-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.mw-po-drop-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #444;
}
.mw-po-drop-btn {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 40px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .25);
  font-size: 13px;
  font-weight: 600;
  color: #111;
}
.mw-po-drop-sub {
  font-size: 12px;
  color: #666;
}
.mw-po-drop-preview {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
}
.mw-po-drop-preview[hidden],
.mw-po-drop-prompt[hidden],
.mw-po-drop-preview img[hidden] {
  display: none !important;
}
.mw-po-drop-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.mw-po-drop-meta {
  flex: 1;
  min-width: 0;
}
.mw-po-drop-meta strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mw-po-drop-meta span {
  font-size: 12px;
  color: #666;
}
.mw-po-drop-remove {
  background: #f3f3f3 !important;
  color: #111 !important;
  border: 0 !important;
  border-radius: 50% !important;
  width: 28px;
  height: 28px;
  min-height: 0 !important;
  padding: 0 !important;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

/* Add-on total note */
.mw-po-total-note {
  margin: 12px 0 0;
  font-size: 14px;
  color: #222;
}
.mw-po-total-note strong {
  color: #15803d;
  font-weight: 600;
}
.mw-po-ajax-error {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
}

/* Legacy classic mode styles */
.mw-personalization {
  padding: 22px;
  margin: 20px 0;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  background: #fffaf0;
  color: #111;
  box-sizing: border-box;
}
.mw-personalization * {
  box-sizing: border-box;
}
.mw-personalization legend {
  font-size: 20px;
  padding: 0 8px;
  font-weight: 600;
}
.mw-personalization .mw-personal-note {
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  margin: 0 0 16px;
}
.mw-personalization > label:not(.mw-confirm) {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}
.mw-personalization input[type=text],
.mw-personalization select {
  width: 100%;
  margin: 0;
  border: 1px solid rgba(0, 0, 0, .4);
  border-radius: 26px;
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  color: #111;
  background: #fff;
}
.mw-personalization small {
  display: block;
  text-align: right;
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}
.mw-lettering-preview {
  margin-top: 18px;
  min-height: 120px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5dfd3;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.mw-lettering-preview span:first-child { font-size: 26px; }
.mw-lettering-preview span:last-child { font-size: 18px; }
.mw-lettering-preview[data-font=classic] { font-family: Georgia, serif; }
.mw-lettering-preview[data-font=modern] { font-family: Arial, sans-serif; }
.mw-lettering-preview[data-font=script] { font-family: 'Brush Script MT', 'Segoe Script', cursive; }
.mw-personalization .mw-preview-caption { font-size: 11px; color: #666; margin: 8px 0 14px; }
.mw-personalization .mw-confirm { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; cursor: pointer; }
.mw-confirm input[type=checkbox] { margin: 3px 0 0; width: 16px; height: 16px; }
