/* ============================================================
   DANZFLO — Product Management (Merch)
   ============================================================ */

.products-page {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(37, 99, 235, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(236, 72, 153, 0.05), transparent 50%),
    var(--bg, #f8fafc);
}

.products-page > * { position: relative; z-index: 1; }

.products-page-header,
.products-form-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.products-form-header {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.products-form-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.products-form-badge {
  display: inline-flex;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 9999px;
}

.products-form-header-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.products-form-subtitle {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--muted, #64748b);
}

.products-page--form {
  padding-top: 0.875rem !important;
  padding-bottom: 1rem !important;
}

@media (min-width: 1024px) {
  .products-page--form {
    padding: 1rem 1.25rem 1.25rem !important;
  }
}

.products-page--form .products-form-title {
  margin-top: 0;
  font-size: 1.25rem;
}

.products-page--form .products-wizard {
  border-radius: 1rem;
}

.products-page--form .products-tabs {
  padding: 0.5rem;
  gap: 0.25rem;
}

.products-page--form .products-tab {
  padding: 0.5rem 0.625rem;
  gap: 0.5rem;
}

.products-page--form .products-tab-num {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.6875rem;
}

.products-page--form .products-tab-hint {
  display: none;
}

.products-page--form .products-form-card {
  padding: 0.875rem 1rem 1rem;
}

.products-page--form .products-step-head {
  margin-bottom: 0.75rem;
  padding-bottom: 0.625rem;
}

.products-page--form .products-step-title {
  font-size: 1rem;
}

.products-page--form .products-step-desc {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
}

.products-page--form .products-section-card {
  margin-bottom: 0.75rem;
  padding: 0.875rem 0.95rem 0.15rem;
}

.products-page--form .products-section-label {
  margin-bottom: 0.75rem;
}

.products-page--form .form-group {
  margin-bottom: 0.875rem;
}

.products-page--form .products-step-actions {
  padding-top: 0.875rem;
  margin-top: 0;
}

.products-form-progress {
  width: 100%;
  max-width: 100%;
  margin-top: 0.5rem;
}

.products-form-progress-bar {
  height: 0.375rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.products-form-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width 0.3s ease;
}

.products-page-badge {
  display: inline-flex;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #db2777;
  background: rgba(236, 72, 153, 0.1);
  border: 1px solid rgba(236, 72, 153, 0.18);
  border-radius: 9999px;
}

.products-page-title,
.products-form-title {
  margin-top: 0.5rem;
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #0f172a, #334155);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.products-page-subtitle {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted, #64748b);
}

.products-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted, #64748b);
  background: none;
  border: none;
  cursor: pointer;
}

.products-back-link svg { width: 1rem; height: 1rem; }
.products-back-link:hover { color: var(--primary, #2563eb); }

.products-create-btn,
.products-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.products-primary-btn svg {
  width: 1rem;
  height: 1rem;
}

.products-create-btn:hover,
.products-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
}

.products-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.products-text-btn svg {
  width: 1rem;
  height: 1rem;
}

.products-text-btn:hover {
  color: var(--primary, #2563eb);
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.04);
}

.products-link-btn {
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--primary, #2563eb);
  background: none;
  border: none;
  cursor: pointer;
}

.products-link-btn:hover { text-decoration: underline; }

/* Panel / table */
.products-panel {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.products-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.products-search { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.products-search-icon {
  position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; color: #94a3b8; pointer-events: none;
}
.products-search-input {
  width: 100%; height: 2.5rem; padding: 0 0.875rem 0 2.5rem;
  font-size: 0.875rem; background: #fff; border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem; outline: none;
}
.products-search-input:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.products-count { font-size: 0.8125rem; color: var(--muted, #64748b); }

.products-table-wrap { padding: 1rem; }
.products-table-inner {
  overflow-x: auto; background: #fff;
  border: 1px solid var(--border, #e2e8f0); border-radius: 0.875rem;
}
.products-table {
  width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0;
}
.products-table th {
  padding: 1rem 1.125rem; font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase; text-align: left;
  color: var(--muted, #64748b); background: rgba(241, 245, 249, 0.95);
  border-bottom: 1px solid var(--border, #e2e8f0); white-space: nowrap;
}
.products-table th.text-center,
.products-table td.text-center { text-align: center; }
.products-table th.text-right { text-align: right; }
.products-table td {
  padding: 0.9375rem 1.125rem; font-size: 0.875rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85); vertical-align: middle;
}
.products-table tbody tr:last-child td { border-bottom: none; }
.products-table tbody tr:hover { background: rgba(37, 99, 235, 0.025); }
.products-row.hidden-by-search { display: none; }
.products-name { font-weight: 600; white-space: nowrap; }

.products-thumb {
  width: 3rem; height: 3rem; border-radius: 0.5rem; overflow: hidden;
  background: #f1f5f9; border: 1px solid var(--border, #e2e8f0);
}
.products-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.products-active-yes {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a); border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}
.products-active-yes svg { width: 0.9375rem; height: 0.9375rem; }

.products-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.products-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.125rem; height: 2.125rem; background: #fff;
  border: 1px solid var(--border, #e2e8f0); border-radius: 0.5rem; cursor: pointer;
  transition: all 0.15s ease;
}
.products-action-btn svg { width: 1rem; height: 1rem; }
.products-action-btn--edit { color: #2563eb; }
.products-action-btn--edit:hover { background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.35); }
.products-action-btn--delete { color: #fff; background: #ef4444; border-color: #ef4444; }
.products-action-btn--delete:hover { background: #dc2626; }

/* Wizard */
.products-wizard {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.25rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px rgba(15, 23, 42, 0.06);
  overflow: visible;
}

.products-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.375rem;
  padding: 0.625rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border, #e2e8f0);
  overflow-x: auto;
  border-radius: 1.25rem 1.25rem 0 0;
}

.products-tab {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  padding: 0.75rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.products-tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.products-tab-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.products-tab-label {
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-tab-hint {
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-tab:hover:not(:disabled) {
  color: #334155;
  background: rgba(255, 255, 255, 0.7);
}

.products-tab.active {
  color: #0f172a;
  background: #fff;
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.products-tab.active .products-tab-num {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.products-tab.active .products-tab-hint { color: #64748b; }

.products-tab.is-complete .products-tab-num {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
}

.products-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.products-form-card {
  padding: 1.5rem 1.5rem 1.25rem;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  overflow: visible;
  border-radius: 0 0 1.25rem 1.25rem;
}

.products-step-head {
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.products-step-title {
  margin-bottom: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.products-step-title--sub {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.products-step-desc {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.products-section-card {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.2rem 0.35rem;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  overflow: visible;
}

.products-section-card--media { padding-bottom: 1.15rem; }

.products-section-label {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.products-section-hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.products-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1.25rem;
}

@media (min-width: 960px) {
  .products-form-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.products-form-col { min-width: 0; }

.form-group { margin-bottom: 1.125rem; }
.form-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.form-label-row .form-label { margin-bottom: 0; }
.req { color: #ef4444; }

.form-input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.95rem;
  font-size: 0.875rem;
  color: var(--text, #0f172a);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form-input:hover { background: #fff; border-color: #cbd5e1; }
.form-input:focus {
  background: #fff;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.form-textarea {
  height: auto;
  min-height: 8rem;
  padding: 0.85rem 0.95rem;
  resize: vertical;
}

.products-info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  background: #3b82f6;
  border-radius: 9999px;
  cursor: help;
}

.products-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
  line-height: 1.25;
}

.products-check--row {
  padding: 0.75rem 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.products-check--row:hover {
  background: #fff;
  border-color: #cbd5e1;
}

.products-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.products-check-box {
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.3125rem;
  background: #fff;
  position: relative;
  flex-shrink: 0;
  margin-top: 0;
}

.products-check input:checked + .products-check-box {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
}

.products-check input:checked + .products-check-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.products-check input:focus-visible + .products-check-box {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.products-check-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text, #0f172a);
}

.products-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  max-width: 12.5rem;
  min-height: 9.5rem;
  padding: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px dashed #cbd5e1;
  border-radius: 1rem;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.products-upload--lg {
  max-width: none;
  min-height: 12rem;
}
.products-upload:hover {
  border-color: #93c5fd;
  background: rgba(37, 99, 235, 0.03);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.products-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 0.75rem;
}
.products-upload-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}
.products-upload-hint {
  font-size: 0.75rem;
  color: #94a3b8;
}
.products-upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.products-upload-preview.hidden { display: none; }

.products-step-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}
.products-step-actions--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  .products-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .products-tabs::-webkit-scrollbar { display: none; }
  .products-tab {
    flex: 0 0 auto;
    min-width: 9.5rem;
  }
  .products-tab-hint { display: none; }
}

@media (max-width: 639px) {
  .products-form-card { padding: 1.15rem; }
  .products-section-card { padding: 1rem 1rem 0.25rem; }
}

/* Custom selects */
.products-select { position: relative; }
.products-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  width: 100%; height: 2.625rem; padding: 0 0.875rem; font-size: 0.875rem; text-align: left;
  color: #94a3b8; background: #f8fafc; border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.625rem; cursor: pointer;
}
.products-select-trigger span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.products-select-trigger svg { width: 1rem; height: 1rem; flex-shrink: 0; color: #94a3b8; }
.products-select.open .products-select-trigger,
.products-select-trigger[aria-expanded='true'] {
  color: var(--text, #0f172a); background: #fff; border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.products-select.has-value .products-select-trigger { color: var(--text, #0f172a); }

.products-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.375rem;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}
.products-select-menu[hidden] { display: none; }
.products-select-menu--fixed,
.products-select-menu--portal {
  position: fixed !important;
  left: auto;
  right: auto;
  top: auto;
  z-index: 9999;
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.products-select-option,
.products-select-check {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.5625rem 0.75rem; font-size: 0.8125rem; color: var(--text, #0f172a);
  background: transparent; border: none; border-radius: 0.5rem; cursor: pointer; text-align: left;
}
.products-select-option:hover,
.products-select-check:hover { background: #f1f5f9; }
.products-select-check input { accent-color: var(--primary, #2563eb); }

.products-tags {
  display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.625rem;
}
.products-tags:empty { display: none; }
.products-tag {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.3125rem 0.5rem 0.3125rem 0.625rem; font-size: 0.75rem; font-weight: 500;
  color: #334155; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 0.375rem;
}
.products-tag button {
  display: flex; width: 1rem; height: 1rem; align-items: center; justify-content: center;
  padding: 0; font-size: 0.875rem; color: #64748b; background: none; border: none;
  border-radius: 0.25rem; cursor: pointer;
}
.products-tag button:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.products-attr-list { display: flex; flex-direction: column; gap: 0.5rem; }
.products-attr-row { display: flex; align-items: center; gap: 0.5rem; }
.products-attr-row .form-input { flex: 1; }
.products-attr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; flex-shrink: 0; font-size: 1.25rem; font-weight: 600;
  color: var(--text, #0f172a); background: #f8fafc; border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.5rem; cursor: pointer;
}
.products-attr-btn:hover { background: #f1f5f9; }

/* Variants tab */
.products-variant-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.products-variant-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.products-add-variant-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.products-add-variant-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.products-variant-table-wrap {
  position: relative;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
}

.products-variant-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.products-variant-table thead th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.products-variant-th-expand {
  width: 2.5rem;
  padding-left: 0.75rem !important;
  padding-right: 0.25rem !important;
}

.products-variant-table tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #334155;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

.products-variant-row.is-expanded td {
  border-bottom-color: transparent;
}

.products-variant-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.products-variant-expand:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.products-variant-row.is-expanded .products-variant-expand {
  color: #fff;
  background: #2563eb;
}

.products-variant-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.products-variant-thumb {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.25rem;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
}

.products-variant-name {
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
}

.products-variant-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.products-variant-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.products-variant-action svg {
  width: 1.125rem;
  height: 1.125rem;
}

.products-variant-action--delete { color: #ef4444; }
.products-variant-action--delete:hover { background: rgba(239, 68, 68, 0.1); }
.products-variant-action--edit { color: #2563eb; }
.products-variant-action--edit:hover { background: rgba(37, 99, 235, 0.1); }

.products-variant-detail-row td {
  padding: 0 1rem 1rem 3.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.products-variant-detail-row[hidden] {
  display: none;
}

.products-variant-detail-img {
  display: block;
  width: 7.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.products-variant-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.products-variant-table-wrap:has(#variant-table-body:not(:empty)) .products-variant-empty,
.products-variant-empty.is-hidden {
  display: none;
}

.products-variant-empty-icon {
  width: 3rem;
  height: 3rem;
  color: #cbd5e1;
}

.products-variant-empty p {
  margin: 0;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.products-variant-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.25rem 0 1.25rem;
}

.products-variant-pagination[hidden] {
  display: none;
}

.products-variant-page-nav,
.products-variant-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.products-variant-page-nav svg {
  width: 1rem;
  height: 1rem;
}

.products-variant-page-nav:hover:not(:disabled),
.products-variant-page-btn:hover {
  color: #2563eb;
  border-color: #93c5fd;
}

.products-variant-page-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.products-variant-page-nums {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.products-variant-page-btn.active {
  color: #2563eb;
  border-color: #2563eb;
  background: #fff;
}

.products-variant-price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.products-variant-modal-body .form-group {
  margin-bottom: 1rem;
}

.products-variant-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #1e40af;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 0.625rem;
}

.products-variant-alert {
  margin-bottom: 0.875rem;
  padding: 0.75rem 0.875rem;
  font-size: 0.8125rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.625rem;
}

.products-variant-image-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}

.products-variant-image-item {
  position: relative;
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.products-variant-image-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.products-variant-image-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
}

.products-variant-image-remove:hover {
  background: rgba(239, 68, 68, 0.92);
}

.products-variant-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  width: 5.5rem;
  height: 5.5rem;
  background: #fafafa;
  border: 1px dashed #cbd5e1;
  border-radius: 0.375rem;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.products-variant-upload--tile:hover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.04);
}

.products-variant-upload-plus {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  color: #64748b;
}

.products-variant-upload-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.products-variant-detail-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.products-modal--variant {
  width: min(100%, 34rem);
  max-width: 34rem;
}

/* Product Specification rows */
.products-spec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.products-spec-head .products-section-label {
  margin-bottom: 0;
}

.products-spec-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding-bottom: 1rem;
}

.products-spec-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(160px, 1.4fr) 2.25rem;
  align-items: center;
  gap: 0.75rem;
}

.products-spec-name {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
}

.products-spec-select {
  min-width: 0;
}

.products-spec-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.products-spec-remove:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

@media (max-width: 639px) {
  .products-spec-row {
    grid-template-columns: 1fr 2.25rem;
    grid-template-areas:
      "name remove"
      "select select";
  }
  .products-spec-name { grid-area: name; }
  .products-spec-select { grid-area: select; }
  .products-spec-remove { grid-area: remove; justify-self: end; }
}

/* Modals */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 520px; max-height: min(90vh, 720px);
  display: flex; flex-direction: column; background: #fff; border-radius: 1rem;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25); overflow: hidden;
  animation: products-modal-in 0.25s ease;
}
@keyframes products-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.products-modal { max-width: 560px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.125rem 1.35rem; border-bottom: 1px solid var(--border, #e2e8f0);
}
.modal-title { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-close {
  display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  font-size: 1.5rem; line-height: 1; color: #94a3b8; background: transparent; border: none;
  border-radius: 0.5rem; cursor: pointer;
}
.modal-close:hover { color: #0f172a; background: #f1f5f9; }
.modal-body { padding: 1.25rem 1.35rem; overflow-y: auto; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem;
  padding: 1rem 1.35rem; border-top: 1px solid var(--border, #e2e8f0); background: #f8fafc;
}
.modal-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.625rem 1.125rem; font-size: 0.8125rem; font-weight: 600;
  border-radius: 0.625rem; border: none; cursor: pointer;
}
.modal-btn--text { color: #0f172a; background: transparent; }
.modal-btn--text:hover { background: #e2e8f0; }
.modal-btn--dark { color: #fff; background: #0f172a; }
.modal-btn--dark:hover { background: #1e293b; }
.modal-btn--primary {
  color: #fff; background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.products-help-body p { font-size: 0.875rem; color: #475569; line-height: 1.6; margin-bottom: 0.875rem; }
.products-help-body h3 { font-size: 0.9375rem; font-weight: 700; margin: 1rem 0 0.5rem; }
.products-help-grid {
  display: grid; grid-template-columns: 1fr; gap: 0.875rem; margin: 1rem 0;
}
@media (min-width: 560px) {
  .products-help-grid { grid-template-columns: 1fr 1fr; }
}
.products-help-card {
  padding: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem;
}
.products-help-card h4 { font-size: 0.8125rem; font-weight: 700; margin-bottom: 0.75rem; }
.products-help-card ul { list-style: none; padding: 0; margin: 0; }
.products-help-card li {
  display: flex; justify-content: space-between; gap: 0.75rem;
  padding: 0.375rem 0; font-size: 0.8125rem; color: #64748b;
}
.products-help-total {
  margin-top: 0.375rem; padding-top: 0.625rem !important;
  border-top: 1px dashed #cbd5e1; color: #0f172a !important; font-weight: 600;
}

.modal--delete { max-width: 320px; text-align: center; }
.delete-modal-body {
  padding: 2rem 1.5rem 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.delete-modal-icon {
  width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(245, 158, 11, 0.12); color: #f59e0b;
}
.delete-modal-title { font-size: 1.0625rem; font-weight: 700; }
.delete-modal-desc { font-size: 0.8125rem; color: var(--muted, #64748b); }
.delete-modal-footer {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  padding: 0.875rem 1.5rem 1.5rem;
}

.hidden { display: none !important; }

/* ============================================================
   TreeSelect Subcategory Styles
   ============================================================ */
.merch-add-subcategory-select.ant-select {
  width: 100%;
  min-height: 44px !important;
  border-radius: 0.625rem !important;
  font-size: 0.875rem;
}

.merch-add-subcategory-select .ant-select-selector {
  min-height: 44px !important;
  border-radius: 0.625rem !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  background: #f8fafc !important;
  color: var(--text, #0f172a) !important;
  font-size: 0.875rem;
  padding: 4px 12px !important;
  transition: all 0.2s ease !important;
}

.merch-add-subcategory-select.ant-select-focused .ant-select-selector,
.merch-add-subcategory-select .ant-select-selector:hover {
  border-color: var(--primary, #2563eb) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.merch-add-subcategory-select .ant-select-selection-placeholder {
  color: #94a3b8 !important;
  font-size: 0.875rem;
}

.merch-add-subcategory-select.ant-select-disabled .ant-select-selector {
  background: #f1f5f9 !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}

.merch-add-subcategory-select .ant-select-selection-item {
  background: rgba(37, 99, 235, 0.08) !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  color: #1d4ed8 !important;
  border-radius: 6px !important;
  font-size: 0.8125rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.merch-add-subcategory-select .ant-select-selection-item-remove {
  color: #64748b !important;
  margin-left: 4px;
}

.merch-add-subcategory-select .ant-select-selection-item-remove:hover {
  color: #ef4444 !important;
}

.merch-add-subcategory-dropdown.ant-select-dropdown {
  z-index: 9999 !important;
  background: #ffffff !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05) !important;
  padding: 8px !important;
}

.merch-add-subcategory-dropdown .ant-select-tree {
  background: transparent !important;
  color: var(--text, #0f172a) !important;
  font-size: 0.875rem !important;
}

.merch-add-subcategory-dropdown .ant-select-tree-node-content-wrapper {
  color: #334155 !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  transition: all 150ms ease !important;
}

.merch-add-subcategory-dropdown .ant-select-tree-node-content-wrapper:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.merch-add-subcategory-dropdown .ant-select-tree-node-selected .ant-select-tree-node-content-wrapper {
  background: rgba(37, 99, 235, 0.1) !important;
  color: #2563eb !important;
  font-weight: 500 !important;
}

.merch-add-subcategory-dropdown .ant-select-tree-checkbox .ant-select-tree-checkbox-inner {
  border-radius: 4px !important;
  border-color: #cbd5e1 !important;
}

.merch-add-subcategory-dropdown .ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner {
  background-color: var(--primary, #2563eb) !important;
  border-color: var(--primary, #2563eb) !important;
}
