/* ===============================
   VATUNE Plate Frame module
=============================== */

body.vatune-frame-config [id^="wapf_"] .wapf-wrapper {
  border: 1.5px solid rgba(15, 143, 122, 0.55);
  border-radius: 14px;
  padding: 18px;
  background: transparent;
  box-shadow: 0 0 22px rgba(15, 143, 122, 0.1);
}

body.vatune-frame-config [id^="wapf_"] .wapf-field-label {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}

body.vatune-frame-config [id^="wapf_"] input.wapf-input,
body.vatune-frame-config [id^="wapf_"] select.wapf-input {
  border-radius: 10px;
  border: 1px solid #e3e6e8;
  background: rgba(255, 255, 255, 0.9);
  min-height: 44px;
  line-height: 1.25;
  padding: 10px 14px;
  font-size: 15px;
}

body.vatune-frame-config [id^="wapf_"] input.wapf-input:focus,
body.vatune-frame-config [id^="wapf_"] select.wapf-input:focus {
  border-color: var(--vatune-accent, #0f8f7a);
  box-shadow: 0 0 0 3px rgba(15, 143, 122, 0.14);
  outline: none;
}

.vatune-plate-preview {
  position: relative;
  margin: 12px 0 14px;
  display: block;
  width: 100%;
  max-width: 100%;
  clear: both;
}

.vatune-plate-preview-title {
  position: absolute;
  top: -10px;
  left: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4aa18f 0%, #0f8f7a 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(15, 143, 122, 0.22);
}

.vatune-plate-canvas {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(15, 143, 122, 0.22);
  background: #eceff1;
  overflow: hidden;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.vatune-plate-frame-wrap {
  position: relative;
  width: 100%;
}

.vatune-plate-frame-image {
  width: 100%;
  height: auto;
  display: block;
}

.vatune-plate-overlay {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  --vatune-glyph-size: 14px;
  --vatune-icon-size: var(--vatune-glyph-size);
  transform: translateY(2px);
}

.vatune-plate-text {
  display: inline-block;
  font-size: var(--vatune-glyph-size);
  font-weight: 400;
  line-height: 1.04;
  white-space: nowrap;
  color: #ff4b4b;
  letter-spacing: 0.02em;
  transform: translateY(1px);
  padding-top: 1px;
  padding-bottom: 1px;
}

.vatune-plate-text.is-premium {
  -webkit-background-clip: text;
  background-clip: text;
}

.vatune-plate-icon {
  width: calc(var(--vatune-icon-size) * var(--vatune-icon-ratio, 1));
  height: var(--vatune-icon-size);
  flex: 0 0 calc(var(--vatune-icon-size) * var(--vatune-icon-ratio, 1));
  display: inline-block;
  visibility: hidden;
  background-color: #ff4b4b;
  -webkit-mask-image: var(--vatune-icon-url);
  mask-image: var(--vatune-icon-url);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.vatune-plate-icon.is-visible {
  visibility: visible;
}

.vatune-hidden-by-preview {
  display: none !important;
}

.vatune-picker-row {
  margin: 8px auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
}

.vatune-picker-trigger {
  width: 168px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(15, 143, 122, 0.7);
  background: linear-gradient(180deg, #0f8f7a 0%, #0d7f6d 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(15, 143, 122, 0.18);
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}

.vatune-picker-trigger:hover {
  background: linear-gradient(180deg, #12a189 0%, #0f8f7a 100%);
  box-shadow: 0 8px 18px rgba(15, 143, 122, 0.24);
}

.vatune-picker-trigger:active {
  transform: scale(.985);
}

.vatune-picker-summary {
  display: none !important;
  width: 0;
  font-size: 13px;
  color: #5b656d;
  min-height: 0;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.vatune-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
}

.vatune-picker-modal.is-open {
  display: block;
}

.vatune-picker-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.vatune-picker-modal__content {
  position: relative;
  z-index: 2;
  max-width: 920px;
  width: calc(100vw - 18px);
  height: min(78dvh, 760px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin: 14px auto;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(15, 143, 122, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.vatune-picker-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.vatune-picker-modal__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
}

.vatune-picker-modal__preview {
  margin: 0 0 10px;
}

.vatune-picker-modal__preview .vatune-plate-canvas {
  padding: 6px;
  border-radius: 10px;
  max-width: none;
  margin: 0 auto;
}

.vatune-picker-modal__preview .vatune-plate-preview-title {
  display: none !important;
}

.vatune-picker-modal__preview .vatune-plate-overlay {
  pointer-events: none;
}

.vatune-picker-modal__body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: 12px;
}

.vatune-picker-modal__footer {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  padding-top: 10px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  margin-top: 0;
  border-top: 1px solid rgba(15, 143, 122, 0.2);
}

.vatune-picker-confirm {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(180deg, #0f8f7a 0%, #0d7f6d 100%);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.vatune-picker-jump-color {
  width: 100%;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(15, 143, 122, 0.38);
  background: #f4fbf9;
  color: #0f8f7a;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  cursor: pointer;
}

.vatune-picker-confirm:hover {
  background: linear-gradient(180deg, #12a189 0%, #0f8f7a 100%);
}

body.vatune-picker-open {
  overflow: hidden;
  touch-action: none;
}

.vatune-picker-icon-field .wapf-swatch-label {
  display: none !important;
}

.vatune-picker-icon-field .wapf-image-swatch-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
}

.vatune-picker-icon-field .wapf-swatch--image label {
  position: relative;
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  margin: 0 auto;
}

.vatune-color-hint {
  position: absolute;
  z-index: 30;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #b9b9b9;
  background: #fff;
  color: #202124;
  font-size: 14px;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.vatune-color-hint::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #b9b9b9;
  border-bottom: 1px solid #b9b9b9;
  transform: rotate(-45deg);
}

.vatune-color-surcharge-line {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(15, 143, 122, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #2f3b45;
  gap: 10px;
}

.vatune-color-surcharge-line .vatune-color-surcharge-value {
  font-weight: 700;
  color: #0f8f7a;
}

.vatune-premium-waiver-line {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #2f3b45;
  gap: 10px;
}

.vatune-premium-waiver-line .vatune-premium-waiver-value {
  font-weight: 700;
  color: #0f8f7a;
}

@media (max-width: 767px) {
  .vatune-plate-preview {
    margin: 10px 0 12px;
  }

  .vatune-plate-canvas {
    padding: 8px;
    border-radius: 12px;
  }

  .vatune-plate-preview-title {
    font-size: 11px;
    padding: 4px 9px;
  }

  .vatune-picker-row {
    justify-content: center;
    margin: 6px auto 8px;
  }

  .vatune-picker-trigger {
    width: min(160px, calc(50vw - 24px));
    min-height: 36px;
    font-size: 13px;
  }

  .vatune-picker-modal__content {
    width: calc(100vw - 10px);
    margin: 6px auto;
    padding: 12px 10px;
    height: min(76dvh, 680px);
    max-height: calc(100dvh - 12px);
  }

  .vatune-picker-modal__title {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .vatune-picker-modal__preview {
    margin-bottom: 8px;
  }

  .vatune-picker-icon-field .wapf-image-swatch-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 5px;
  }

  .vatune-picker-icon-field .wapf-swatch--image label,
  .vatune-picker-icon-field .apf-pick-box {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  .vatune-picker-confirm {
    width: 100%;
    min-height: 38px;
    font-size: 14px;
  }

  .vatune-picker-jump-color {
    min-height: 34px;
    font-size: 13px;
    margin-bottom: 7px;
  }
}

