/* TY Order Forms - frontend styles (matches the LCS order form look) */
.tyof-card {
  --tyof-ink: #1f2a44;
  --tyof-muted: #5b6478;
  --tyof-line: #e2e6ee;
  --tyof-bg-soft: #f7f9fc;
  --tyof-green: #43a066;
  --tyof-green-dark: #38915a;
  --tyof-radius: 10px;

  background: #ffffff;
  border: 1px solid var(--tyof-line);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(23, 34, 59, 0.06);
  padding: 34px 36px;
  max-width: 920px;
  margin: 0 auto;
  font-family: inherit;
  color: var(--tyof-ink);
  box-sizing: border-box;
}
.tyof-card *, .tyof-card *::before, .tyof-card *::after { box-sizing: border-box; }

.tyof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 18px;
}
.tyof-full { grid-column: 1 / -1; min-width: 0; }
.tyof-half { grid-column: auto / span 1; min-width: 0; }
.tyof-field { min-width: 0; }

.tyof-label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--tyof-ink);
}
.tyof-req { color: #c43b3b; }

.tyof-input, .tyof-select, .tyof-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--tyof-line);
  border-radius: var(--tyof-radius);
  padding: 13px 15px;
  font-size: 15px;
  font-family: inherit;
  color: var(--tyof-ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.tyof-input:focus, .tyof-select:focus, .tyof-textarea:focus {
  outline: none;
  border-color: #1e56c8;
  box-shadow: 0 0 0 3px rgba(30, 86, 200, 0.12);
}
/* invalid required field after a submit attempt */
.tyof-invalid, .tyof-invalid:focus {
  border-color: #c43b3b;
  box-shadow: 0 0 0 3px rgba(196, 59, 59, 0.12);
}
.tyof-input::placeholder, .tyof-textarea::placeholder { color: #9aa3b5; }
.tyof-textarea { min-height: 92px; resize: vertical; }
.tyof-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231f2a44' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 40px;
}

/* Quantity stepper */
.tyof-qty { display: flex; gap: 10px; align-items: stretch; }
.tyof-qty-btn {
  width: 46px;
  min-width: 46px;
  border: 1px solid var(--tyof-line);
  border-radius: var(--tyof-radius);
  background: #fff;
  color: var(--tyof-ink);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: background .15s, border-color .15s;
}
.tyof-qty-btn:hover { background: var(--tyof-bg-soft); border-color: #c8d0dd; }
.tyof-qty-input {
  flex: 1;
  width: 100%;
  text-align: center;
  border: 1px solid var(--tyof-line);
  border-radius: var(--tyof-radius);
  padding: 13px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--tyof-ink);
  -moz-appearance: textfield;
}
.tyof-qty-input::-webkit-outer-spin-button,
.tyof-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tyof-qty-input:focus { outline: none; border-color: #1e56c8; box-shadow: 0 0 0 3px rgba(30, 86, 200, 0.12); }

/* Total display */
.tyof-total {
  background: var(--tyof-bg-soft);
  border: 1px solid var(--tyof-line);
  border-radius: var(--tyof-radius);
  padding: 13px 15px;
  font-size: 16px;
  font-weight: 700;
  color: var(--tyof-ink);
}

/* Heading + note */
.tyof-heading { margin: 4px 0 0; font-size: 20px; font-weight: 800; }
.tyof-note { margin: 0; color: var(--tyof-muted); font-size: 14px; }

/* Submit */
.tyof-card .tyof-submit {
  display: block;
  width: 100%;
  margin-top: 26px;
  background: var(--tyof-green);
  color: #fff;
  border: 0;
  outline: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: var(--tyof-radius);
  padding: 17px 20px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.tyof-card .tyof-submit:focus,
.tyof-card .tyof-submit:focus-visible,
.tyof-card .tyof-submit:active,
.tyof-card .tyof-submit:hover {
  border: 0;
  outline: 0;
}
.tyof-submit:hover { background: var(--tyof-green-dark); }
.tyof-submit:active { transform: translateY(1px); }
.tyof-submit:disabled { opacity: .65; cursor: wait; }
.tyof-arrow { display: inline-block; margin-left: 6px; }
.tyof-loading .tyof-arrow { animation: tyof-pulse 1s infinite; }
@keyframes tyof-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* Footer note */
.tyof-footer-note {
  text-align: center;
  color: var(--tyof-muted);
  font-size: 14px;
  margin: 16px 0 0;
}
.tyof-footer-note p { margin: 0 0 6px; }
.tyof-footer-note p:last-child { margin-bottom: 0; }
.tyof-footer-note a, .tyof-note a { color: #1e56c8; text-decoration: underline; text-underline-offset: 2px; }
.tyof-footer-note a:hover, .tyof-note a:hover { text-decoration: none; }

/* Messages */
.tyof-msg { margin-top: 14px; font-size: 14.5px; font-weight: 600; text-align: center; }
.tyof-msg-ok { color: #128a5c; }
.tyof-msg-err { color: #c43b3b; }

/* Honeypot */
.tyof-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------------- Countries multi-select ---------------- */
.tyof-cselect { position: relative; }
.tyof-cselect-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: inherit;
  background-image: none;
  padding-right: 15px;
}
.tyof-cselect-btn .tyof-cselect-label { color: #9aa3b5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tyof-cselect-filled .tyof-cselect-btn .tyof-cselect-label { color: var(--tyof-ink); }
.tyof-cselect-caret { color: var(--tyof-muted); }
.tyof-cselect-req {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  border: 0;
  padding: 0;
}
.tyof-cselect-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--tyof-line);
  border-radius: var(--tyof-radius);
  box-shadow: 0 12px 34px rgba(23, 34, 59, .14);
  padding: 10px;
}
.tyof-cselect-search {
  width: 100%;
  border: 1px solid var(--tyof-line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 8px;
}
.tyof-cselect-search:focus { outline: none; border-color: #1e56c8; }
.tyof-cselect-all {
  display: block;
  padding: 6px 4px;
  border-bottom: 1px solid var(--tyof-line);
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--tyof-ink);
  cursor: pointer;
}
.tyof-cselect-list { max-height: 230px; overflow-y: auto; }
.tyof-cselect-item {
  display: block;
  padding: 6px 4px;
  font-size: 14px;
  color: var(--tyof-ink);
  cursor: pointer;
  border-radius: 6px;
}
.tyof-cselect-item:hover { background: var(--tyof-bg-soft); }
.tyof-cselect-item input, .tyof-cselect-all input { margin-right: 8px; }

/* ---------------- Image upload field ---------------- */
.tyof-upload {
  --tyof-up-accent: #1e56c8;
  position: relative;
  border: 2px dashed var(--tyof-line);
  border-radius: var(--tyof-radius);
  background: #fff;
  padding: 22px 16px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.tyof-upload:hover, .tyof-upload-drag { border-color: var(--tyof-up-accent); background: #f7f9fe; }
.tyof-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.tyof-upload-ui { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.tyof-upload-icon { color: var(--tyof-up-accent); display: inline-flex; }
.tyof-upload-text { font-size: 14.5px; font-weight: 700; color: var(--tyof-ink); }
.tyof-upload-btn {
  display: none;
  background: var(--tyof-up-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
}
.tyof-upload-hint { font-size: 12px; color: var(--tyof-muted); }
.tyof-upload-has-file .tyof-upload-ui { display: none; }

.tyof-upload-preview {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.tyof-upload-preview[hidden] { display: none; }
.tyof-upload-preview img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--tyof-line);
  display: block;
}
.tyof-upload-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tyof-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tyof-upload-remove {
  border: 1px solid var(--tyof-line);
  background: #fff;
  color: #c43b3b;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.tyof-upload-remove:hover { border-color: #c43b3b; background: #fdf0f0; }

/* Design 2: Button */
.tyof-upstyle-button .tyof-upload { border: 0; background: transparent; padding: 0; text-align: left; }
.tyof-upstyle-button .tyof-upload:hover { background: transparent; }
.tyof-upstyle-button .tyof-upload-ui { flex-direction: row; align-items: center; gap: 12px; }
.tyof-upstyle-button .tyof-upload-icon, .tyof-upstyle-button .tyof-upload-text { display: none; }
.tyof-upstyle-button .tyof-upload-btn { display: inline-block; }

/* Design 3: Compact card */
.tyof-upstyle-compact .tyof-upload { border-style: solid; border-width: 1px; padding: 13px 15px; }
.tyof-upstyle-compact .tyof-upload-ui { flex-direction: row; justify-content: flex-start; gap: 10px; }
.tyof-upstyle-compact .tyof-upload-icon svg { width: 20px; height: 20px; }
.tyof-upstyle-compact .tyof-upload-text { font-size: 14px; }
.tyof-upstyle-compact .tyof-upload-hint { margin-left: auto; }
.tyof-upstyle-compact .tyof-upload-preview img { width: 38px; height: 38px; }

/* Design 4: Square tile with full image preview */
.tyof-upstyle-tile .tyof-upload { min-height: 160px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tyof-upstyle-tile .tyof-upload.tyof-upload-has-file { padding: 0; border-style: solid; }
.tyof-upstyle-tile .tyof-upload-preview { position: absolute; inset: 0; display: block; }
.tyof-upstyle-tile .tyof-upload-preview[hidden] { display: none; }
.tyof-upstyle-tile .tyof-upload-preview img { width: 100%; height: 100%; border: 0; border-radius: 0; }
.tyof-upstyle-tile .tyof-upload-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, .62);
  color: #fff;
  padding: 7px 44px 7px 12px;
  font-size: 12.5px;
}
.tyof-upstyle-tile .tyof-upload-remove { position: absolute; right: 7px; bottom: 5px; background: rgba(255,255,255,.92); }

@media (max-width: 640px) {
  .tyof-upstyle-compact .tyof-upload-hint { display: none; }
}

/* ---------------- Responsive ---------------- */
/* Default: half fields stack into one column on mobile */
@media (max-width: 640px) {
  .tyof-card { padding: 22px 16px; }
  .tyof-half { grid-column: 1 / -1; }
  .tyof-grid { column-gap: 14px; }
  /* 16px prevents iOS Safari from zooming into inputs */
  .tyof-input, .tyof-select, .tyof-textarea, .tyof-qty-input { font-size: 16px; }
  .tyof-submit { font-size: 16px; padding: 15px 16px; }
}

/* Widget option: stack on tablet and mobile */
@media (max-width: 1024px) {
  .tyof-stack-tablet .tyof-half { grid-column: 1 / -1; }
}

/* Widget option: never stack, keep 2 columns on every screen */
.tyof-stack-never .tyof-half { grid-column: auto / span 1 !important; }

/* Long words and URLs never overflow the card */
.tyof-card { max-width: 100%; }
.tyof-label, .tyof-note, .tyof-footer-note, .tyof-msg { overflow-wrap: break-word; }
