/* ==========================================================================
   Kitgenix Custom Tabs For WooCommerce
   Plugin-specific admin CSS. Rebuilt to sit on top of the shared
   kitgenix-admin-ui.css component library (cards, settings rows, toggles,
   tables, empty states, notices, badges, stat tiles, modal, button groups).
   Only plugin-specific structural/functional classes live here.
   ========================================================================== */

/* ----------------------------------------------------------------
  Page app wrapper & scoped tokens
  (namespace prevents bleed into WC product meta box on same page)
----------------------------------------------------------------- */
#kitgenix-custom-tabs-for-woocommerce-admin-app {
  width: 100%;
  max-width: 1240px;
}

/* ----------------------------------------------------------------
  Manager toolbar (Add Tab button row / template picker row)
----------------------------------------------------------------- */
#kitgenix-custom-tabs-for-woocommerce-admin-app .kitgenix-custom-tabs-for-woocommerce-manager-actions {
  margin: 0 0 14px;
}

#kitgenix-custom-tabs-for-woocommerce-admin-app .kitgenix-custom-tabs-for-woocommerce-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

#kitgenix-custom-tabs-for-woocommerce-admin-app .kitgenix-custom-tabs-for-woocommerce-toolbar__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--kitgenix-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#kitgenix-custom-tabs-for-woocommerce-admin-app .kitgenix-custom-tabs-for-woocommerce-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#kitgenix-custom-tabs-for-woocommerce-admin-app .kitgenix-custom-tabs-for-woocommerce-toolbar__select {
  min-width: 220px;
  max-width: 320px;
}

#kitgenix-custom-tabs-for-woocommerce-admin-app .kitgenix-custom-tabs-for-woocommerce-manager-table {
  margin-top: 4px;
}

/* ----------------------------------------------------------------
  Tab / template list table extras
  (base table look now comes from the shared .kitgenix-table classes;
  these rules only add plugin-specific bits the shared table doesn't know.)
----------------------------------------------------------------- */
.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-empty-cell {
  padding: 0 !important;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-tabs-fields-wrap {
  display: none;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-code {
  display: inline-block;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--kitgenix-bg-light, var(--kitgenix-surface-alt));
  border: 1px solid var(--kitgenix-border-color);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--kitgenix-brand);
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-actions .button {
  margin: 0;
  font-size: 12px;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-tabs-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--kitgenix-text-muted);
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-tabs-subtitle:empty {
  display: none;
}

/* ----------------------------------------------------------------
  Modal field grid (content inside the shared .kitgenix-modal-body)
----------------------------------------------------------------- */
.kitgenix-custom-tabs-for-woocommerce-modal-scope {
  padding: 4px 0;
  color: var(--kitgenix-text-color) !important;
  -webkit-text-fill-color: currentColor !important;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-modal-grid,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-is-full,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-is-full {
  grid-column: 1 / -1;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-field,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-field {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-field__inline,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-field__inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-field__inline .regular-text,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-field__inline .regular-text {
  flex: 1;
  min-width: 160px;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-field label,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--kitgenix-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-field__error,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-field__error {
  min-height: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--kitgenix-danger, #EF4444);
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-field__hint,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-field__hint {
  font-size: 12px;
  color: var(--kitgenix-text-muted);
  line-height: 1.4;
}

/* Overrides the generic uppercase/muted .field label styling above for a
   plain checkbox + caption pairing (e.g. "Hide title inside tab content"). */
.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-field__checkbox,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-field__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--kitgenix-text-color, #1d2327);
  cursor: pointer;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-field__checkbox input[type="checkbox"],
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-field__checkbox input[type="checkbox"] {
  margin: 0;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-modal__help-link,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-modal__help-link {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--kitgenix-brand);
  white-space: nowrap;
}

.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-modal__help-link:hover,
.kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-modal__help-link:focus-visible,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-modal__help-link:hover,
.kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-modal__help-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

@media screen and (max-width: 640px) {
  .kitgenix-custom-tabs-for-woocommerce-scope .kitgenix-custom-tabs-for-woocommerce-modal-grid,
  .kitgenix-custom-tabs-for-woocommerce-modal-scope .kitgenix-custom-tabs-for-woocommerce-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------------
  "Advanced settings" disclosure in the Add/Edit Tab modal (product
  tabs) – Position, Nickname, Slug, Hide title, and Visibility
  conditions all collapse behind this so the modal opens on just
  Title + Content for the common case.
----------------------------------------------------------------- */
.kitgenix-custom-tabs-for-woocommerce-advanced {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--kitgenix-border-color, #E5E7EB);
}

.kitgenix-custom-tabs-for-woocommerce-advanced__summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--kitgenix-brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kitgenix-custom-tabs-for-woocommerce-advanced__summary::-webkit-details-marker {
  display: none;
}

.kitgenix-custom-tabs-for-woocommerce-advanced__summary::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.kitgenix-custom-tabs-for-woocommerce-advanced[open] > .kitgenix-custom-tabs-for-woocommerce-advanced__summary::before {
  transform: rotate(45deg);
}

.kitgenix-custom-tabs-for-woocommerce-advanced__summary:focus-visible {
  outline: none;
  box-shadow: var(--kitgenix-focus-ring);
  border-radius: var(--kitgenix-radius-sm);
}

.kitgenix-custom-tabs-for-woocommerce-advanced__body {
  margin-top: 14px;
}

/* ----------------------------------------------------------------
  Disabled tab rows (Enable/Disable action)
----------------------------------------------------------------- */
.kitgenix-custom-tabs-for-woocommerce-row-disabled {
  opacity: 0.55;
}

.kitgenix-custom-tabs-for-woocommerce-row-disabled td:first-child strong {
  text-decoration: line-through;
  text-decoration-color: var(--kitgenix-text-muted);
}

/* ----------------------------------------------------------------
  Visibility conditions / product targeting sections in the modal
----------------------------------------------------------------- */
.kitgenix-custom-tabs-for-woocommerce-scope [data-kitgenix-custom-tabs-for-woocommerce-visibility-section="1"],
.kitgenix-custom-tabs-for-woocommerce-modal-scope [data-kitgenix-custom-tabs-for-woocommerce-visibility-section="1"],
.kitgenix-custom-tabs-for-woocommerce-scope [data-kitgenix-custom-tabs-for-woocommerce-target-section="1"],
.kitgenix-custom-tabs-for-woocommerce-modal-scope [data-kitgenix-custom-tabs-for-woocommerce-target-section="1"] {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--kitgenix-border-color, #E5E7EB);
}

.kitgenix-custom-tabs-for-woocommerce-target-row {
  display: grid;
  grid-template-columns: 120px 140px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.kitgenix-custom-tabs-for-woocommerce-target-row__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--kitgenix-text-muted);
}

@media screen and (max-width: 640px) {
  .kitgenix-custom-tabs-for-woocommerce-target-row {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------------
  Quill editor slot inside the modal
----------------------------------------------------------------- */
.kitgenix-custom-tabs-for-woocommerce-quill-editor {
  width: 100%;
  min-height: 190px;
  border: 1px solid var(--kitgenix-border-color);
  border-radius: 0 0 var(--kitgenix-radius-lg) var(--kitgenix-radius-lg);
  box-sizing: border-box;
}

.kitgenix-custom-tabs-for-woocommerce-quill-toolbar {
  border-radius: var(--kitgenix-radius-lg) var(--kitgenix-radius-lg) 0 0;
}

/* ----------------------------------------------------------------
  Support tab
----------------------------------------------------------------- */
.kitgenix-support-chip-list {
  margin-top: 4px;
}

.kitgenix-support-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kitgenix-support-list {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}

.kitgenix-support-list li {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--kitgenix-text-color);
}

.kitgenix-support-list li:last-child {
  margin-bottom: 0;
}

.kitgenix-notice .kitgenix-support-list li {
  color: inherit;
}

/* ----------------------------------------------------------------
  Accessibility
----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #kitgenix-custom-tabs-for-woocommerce-admin-app * {
    transition: none !important;
  }
}

