/* ---------- v2 activation checkbox (sits left of #toCart) ---------- */
.cf-v2-toggle-wrap {
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.cf-v2-toggle-wrap:hover { opacity: 1; }
.cf-v2-toggle { width: 14px; height: 14px; cursor: pointer; vertical-align: middle; }

/* ---------- full-screen dark modal ---------- */
#cf-v2-modal {
  position: fixed;
  inset: 0;
  background: #0e1116;
  color: #e6e8ec;
  z-index: 100000;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
}
#cf-v2-modal[hidden] { display: none !important; }

#cf-v2-viewport {
  position: absolute;
  inset: 0;
  cursor: grab;
}
#cf-v2-viewport:active { cursor: grabbing; }
#cf-v2-viewport canvas { display: block; width: 100% !important; height: 100% !important; }

/* ---------- right-side settings panel ---------- */
#cf-v2-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  bottom: 20px;
  width: 340px;
  max-width: 90vw;
  background: rgba(20, 23, 28, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.cf-v2-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.cf-v2-title { font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }
/* ---------- defensive reset for ALL buttons inside the modal --------------
   The active theme's style.css applies bare `button { ... }` normalize rules
   and `-webkit-appearance: button`, which leak native styling onto our custom
   buttons. We neutralise that here and scope our designs under #cf-v2-modal
   so specificity always beats any theme element-selector rule.
---------------------------------------------------------------------------- */
#cf-v2-modal button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: border-box;
  font: inherit;
  margin: 0;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  background-image: none;
  outline: none;
}

/* The theme's WooCommerce-style selector applies `background-color: #ed1c24
   !important` and `color: #fff !important` to every <button> on the page.
   `!important` defeats specificity, so we must match it with `!important` on
   our own background and colour declarations to keep our designs intact. */
#cf-v2-modal .cf-v2-collapse {
  background: rgba(28, 63, 176, 0.35) !important;
  border: none !important;
  color: #b3c4ff !important;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 26px;
  height: 26px;
  padding: 0 !important;
  border-radius: 50% !important;
  outline: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
#cf-v2-modal .cf-v2-collapse:hover { background: rgba(28, 63, 176, 0.6) !important; color: #fff !important; }
.cf-v2-collapse-icon {
  display: inline-block;
  font-weight: 700;
  transition: transform 0.18s ease;
}

/* ---------- collapsed panel: shrinks to just the toggle button ---------- */
#cf-v2-panel.cf-v2-collapsed {
  bottom: auto;
  width: auto;
  padding: 8px;
  gap: 0;
  overflow: visible;
}
#cf-v2-panel.cf-v2-collapsed .cf-v2-panel-header { margin-bottom: 0; }
#cf-v2-panel.cf-v2-collapsed .cf-v2-title,
#cf-v2-panel.cf-v2-collapsed .cf-v2-block,
#cf-v2-panel.cf-v2-collapsed .cf-v2-actions {
  display: none;
}
#cf-v2-panel.cf-v2-collapsed .cf-v2-collapse-icon { transform: rotate(180deg); }

.cf-v2-block { display: flex; flex-direction: column; gap: 8px; }
.cf-v2-block h4 {
  margin: 0 0 4px 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.75;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cf-v2-block h4 small { font-size: 10px; opacity: 0.7; font-weight: 400; text-transform: none; letter-spacing: 0; }

.cf-v2-field {
  display: grid;
  grid-template-columns: 1fr 130px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.cf-v2-field > span { opacity: 0.8; }
.cf-v2-field input,
.cf-v2-field select,
.cf-v2-section-row input,
.cf-v2-section-row select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e6e8ec;
  border-radius: 5px;
  padding: 3px !important;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
#cf-v2-notes {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e6e8ec;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.cf-v2-field input:focus,
.cf-v2-field select:focus,
#cf-v2-notes:focus,
.cf-v2-section-row input:focus,
.cf-v2-section-row select:focus {
  outline: none;
  border-color: #6aa9ff;
  background: rgba(255, 255, 255, 0.1);
}

/* The native <option> popup inherits text color from the parent <select>
   but uses the OS default white background, so dark text-on-dark would be
   invisible. Force a dark surface + light text so options are readable. */
#cf-v2-modal select option,
#cf-v2-modal select optgroup {
  background: #1a1d23;
  color: #e6e8ec;
}

/* ---------- sections list ---------- */
.cf-v2-section-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 6px;
  font-size: 12px;
}
.cf-v2-section-row.active {
  background: rgba(106, 169, 255, 0.18);
  outline: 1px solid rgba(106, 169, 255, 0.5);
}
.cf-v2-section-row .cf-v2-sec-label { opacity: 0.7; padding: 0 4px; }
#cf-v2-modal .cf-v2-section-row .cf-v2-sec-remove {
  background: rgba(28, 63, 176, 0.32) !important;
  border: none !important;
  color: #b3c4ff !important;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  width: 22px;
  height: 22px;
  padding: 0 !important;
  border-radius: 50% !important;
  outline: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
#cf-v2-modal .cf-v2-section-row .cf-v2-sec-remove:hover { background: rgba(28, 63, 176, 0.55) !important; color: #fff !important; }
.cf-v2-section-row .cf-v2-sec-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cf-v2-section-row .cf-v2-sec-input-wrap > small {
  font-size: 9px;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#cf-v2-modal .cf-v2-section-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
#cf-v2-modal #cf-v2-add-section,
#cf-v2-modal #cf-v2-rotate {
  flex: 1;
  background: rgba(28, 63, 176, 0.32) !important;
  border: none !important;
  color: #b3c4ff !important;
  padding: 7px 12px !important;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px !important;
  outline: none !important;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
#cf-v2-modal #cf-v2-add-section:hover,
#cf-v2-modal #cf-v2-rotate:hover { background: rgba(28, 63, 176, 0.55) !important; color: #fff !important; }

/* ---------- notes auto-grow ---------- */
#cf-v2-notes {
  resize: none;
  overflow: hidden;
  min-height: 36px;
  line-height: 1.4;
}

/* ---------- action buttons ---------- */
#cf-v2-modal .cf-v2-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  justify-content: flex-end;
}
#cf-v2-modal .cf-v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px !important;
  border-radius: 6px !important;
  border: none !important;
  outline: none !important;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
#cf-v2-modal .cf-v2-btn:active { transform: translateY(1px); }
#cf-v2-modal .cf-v2-btn:focus-visible { outline: 2px solid rgba(106, 169, 255, 0.55) !important; outline-offset: 2px; }

#cf-v2-modal .cf-v2-btn-ghost {
  background: linear-gradient(180deg, #2a2f38 0%, #1a1f28 100%) !important;
  color: #b3bcc9 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.25);
}
#cf-v2-modal .cf-v2-btn-ghost:hover {
  background: linear-gradient(180deg, #353a44 0%, #24272e 100%) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

#cf-v2-modal .cf-v2-btn-primary {
  background: linear-gradient(180deg, #2956d9 0%, #1c3fb0 100%) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 4px 14px rgba(28, 63, 176, 0.45);
}
#cf-v2-modal .cf-v2-btn-primary:hover {
  background: linear-gradient(180deg, #3a66e8 0%, #2548c4 100%) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 6px 20px rgba(28, 63, 176, 0.6);
}

/* ---------- HUD readout ---------- */
#cf-v2-hud {
  position: absolute;
  background: rgba(15, 18, 24, 0.92);
  border: 1px solid rgba(106, 169, 255, 0.6);
  color: #6aa9ff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  transform: translate(8px, -28px);
  white-space: nowrap;
  z-index: 5;
  font-family: 'Nunito', system-ui, sans-serif;
}
#cf-v2-hud[hidden] { display: none; }

/* ---------- hint pill (top-left) ---------- */
#cf-v2-hint {
  position: absolute;
  left: 20px;
  top: 20px;
  background: rgba(20, 23, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  opacity: 0.7;
  pointer-events: none;
  font-family: 'Nunito', system-ui, sans-serif;
}

/* ---------- credit link (bottom-center) ---------- */
#cf-v2-credit {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #8a96a6;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
#cf-v2-credit:hover { opacity: 1; color: #b3c4ff; }

/* ---------- radio group (colour finishing) ---------- */
#cf-v2-modal .cf-v2-radio-group {
  display: flex;
  gap: 6px;
}
#cf-v2-modal .cf-v2-radio-group label {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #b3bcc9;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
#cf-v2-modal .cf-v2-radio-group label:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
#cf-v2-modal .cf-v2-radio-group input[type="radio"] { width: 12px; height: 12px; margin: 0; accent-color: #2956d9; }
#cf-v2-modal .cf-v2-radio-group label:has(input:checked) {
  background: rgba(28, 63, 176, 0.22);
  border-color: rgba(106, 169, 255, 0.5);
  color: #b3c4ff;
}

/* ---------- bottom-left info accordion ---------- */
#cf-v2-info {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 460px;
  max-width: 65vw;
  background: rgba(20, 23, 28, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: 'Nunito', system-ui, sans-serif;
  color: #e6e8ec;
}

.cf-v2-info-header {
  display: flex;
  align-items: stretch;
  gap: 0;
}

#cf-v2-modal .cf-v2-info-summary-btn {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #e6e8ec !important;
  padding: 10px 14px !important;
  cursor: pointer;
  font: inherit;
  border-radius: 0 !important;
  text-align: left;
}
#cf-v2-modal .cf-v2-info-summary-btn:hover { background: rgba(255, 255, 255, 0.04) !important; }

.cf-v2-info-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.cf-v2-info-mult {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.6;
  margin-left: 4px;
  letter-spacing: 0;
}

#cf-v2-modal .cf-v2-info-add {
  /* Override the base .cf-v2-btn padding so it fits the compact header row */
  padding: 7px 14px !important;
  margin: 8px 6px 8px 0;
  align-self: center;
  white-space: nowrap;
  font-size: 12px;
}

#cf-v2-modal .cf-v2-info-chevron-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #e6e8ec !important;
  padding: 0 12px !important;
  cursor: pointer;
  border-radius: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#cf-v2-modal .cf-v2-info-chevron-btn:hover { background: rgba(255, 255, 255, 0.04) !important; }

.cf-v2-info-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
}
.cf-v2-info-value { font-size: 18px; font-weight: 700; color: #b3c4ff; }
.cf-v2-info-chevron {
  font-size: 11px;
  opacity: 0.6;
  transition: transform 0.25s ease;
}
#cf-v2-info:not(.cf-v2-info-collapsed) .cf-v2-info-chevron { transform: rotate(180deg); }

.cf-v2-info-body {
  max-height: 320px;
  overflow: hidden;
  transition: max-height 0.28s ease, padding 0.28s ease, opacity 0.2s ease;
  padding: 0 14px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 1;
}
#cf-v2-info.cf-v2-info-collapsed .cf-v2-info-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-top-color: transparent;
}
.cf-v2-info-body dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  margin: 12px 0 0 0;
  font-size: 12px;
}
.cf-v2-info-body dt { opacity: 0.65; }
.cf-v2-info-body dd { margin: 0; text-align: right; font-weight: 600; color: #d8e2ff; }
