/* Add Ad wizard — matches user-provided design */

body.add-ad-body {
  padding: 30px 20px;
  color: var(--text-primary);
}

body.add-ad-body .container {
  width: 1000px;
  max-width: 100%;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 38px;
  border: 1px solid rgba(0, 0, 0, 0.02);
  overflow: visible;
}

/* header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.add-ad-back {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(168, 77, 114, 0.2);
  background: var(--burgundy-pale);
  color: var(--burgundy-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.add-ad-back:hover {
  background: rgba(168, 77, 114, 0.18);
}

[dir='ltr'] .add-ad-back i {
  transform: scaleX(-1);
}

.brand-home {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
}

.page-header .brand i {
  font-size: 32px;
  color: var(--burgundy-mid);
}

.page-header .brand h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.page-header .brand h1 span {
  color: var(--burgundy-deep);
}

.brand-sub {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

.badge-step {
  background: var(--burgundy-pale);
  color: var(--burgundy-deep);
  padding: 6px 22px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 15px;
  border: 1px solid rgba(168, 77, 114, 0.15);
}

/* stepper */
.stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  position: relative;
  padding: 0 10px;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  inset-inline-start: 30px;
  inset-inline-end: 30px;
  height: 3px;
  background: var(--border-light);
  z-index: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 3px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--text-muted);
  transition: var(--transition);
  margin-bottom: 6px;
}

.step-item.active .step-circle {
  background: var(--burgundy-mid);
  border-color: var(--burgundy-mid);
  color: #fff;
  box-shadow: 0 4px 16px rgba(168, 77, 114, 0.25);
}

.step-item.done .step-circle {
  background: var(--burgundy-deep);
  border-color: var(--burgundy-deep);
  color: #fff;
}

.step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  text-align: center;
  line-height: 1.3;
}

.step-item.active .step-label {
  color: var(--burgundy-deep);
}

.step-item.done .step-label {
  color: var(--burgundy-mid);
}

/* stages — opacity only (transform clips native select dropdowns) */
.stage {
  display: none;
  position: relative;
  z-index: 1;
}

.stage.active {
  display: block;
  animation: addAdFadeIn 0.35s ease forwards;
  overflow: visible;
  z-index: 5;
}

.container.has-cat-dd-open .stage.active {
  z-index: 50;
}

.container.has-cat-dd-open .nav-buttons {
  z-index: 0;
  pointer-events: none;
}

@keyframes addAdFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.stage-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.stage-desc {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  overflow: visible;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.input-group {
  position: relative;
  overflow: visible;
  z-index: 1;
}

.input-group:has(.cat-dd.is-open),
.input-group.is-select-open {
  z-index: 9000;
}

/* Custom category dropdown (replaces native select) */
.cat-dd {
  position: relative;
  width: 100%;
  z-index: 1;
}

.cat-dd.is-open {
  z-index: 9000;
}

.cat-dd__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  text-align: start;
  transition: var(--transition);
}

.cat-dd.is-open .cat-dd__trigger,
.cat-dd__trigger:focus-visible {
  border-color: var(--burgundy-mid);
  box-shadow: 0 0 0 4px rgba(168, 77, 114, 0.06);
  background: var(--bg-white);
  outline: none;
}

.cat-dd.is-disabled .cat-dd__trigger {
  opacity: 0.65;
  cursor: not-allowed;
  background: var(--bg-soft);
}

.cat-dd.is-error .cat-dd__trigger {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 4px rgba(224, 107, 122, 0.06) !important;
}

.cat-dd__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-dd__label.is-placeholder {
  color: var(--text-muted);
}

.cat-dd__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}

.cat-dd.is-open .cat-dd__chevron {
  transform: rotate(180deg);
}

.cat-dd__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  inset-inline: 0;
  z-index: 9100;
  background: #ffffff;
  background-color: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  max-height: 320px;
  overflow: hidden;
  padding: 6px;
  isolation: isolate;
  flex-direction: column;
}

.cat-dd.is-open .cat-dd__menu {
  display: flex;
}

.cat-dd__search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-soft, #faf7f8);
  flex-shrink: 0;
}

.cat-dd__search-wrap i {
  color: var(--text-muted);
  font-size: 12px;
}

.cat-dd__search {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 0;
}

.cat-dd__options {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 240px;
  padding-inline: 0;
}

.cat-dd__empty {
  padding: 14px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.attr-dependent-hint {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-light);
  background: var(--bg-soft, #faf7f8);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.cat-dd__option {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cat-dd__option:hover,
.cat-dd__option:focus-visible {
  background: var(--burgundy-pale);
  color: var(--burgundy-deep);
  outline: none;
}

.cat-dd__option.is-selected {
  background: var(--burgundy-mid);
  color: #fff;
  font-weight: 700;
}

.cat-dd__empty {
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  background: #ffffff;
}

.input-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.input-group label i {
  color: var(--burgundy-mid);
  margin-inline-end: 6px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 13px 18px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
  font-family: inherit;
  font-weight: 400;
}

.input-group textarea {
  resize: vertical;
  min-height: 90px;
}

.input-group select {
  cursor: pointer;
  position: relative;
  z-index: 1;
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  background-image: none;
  padding-inline-start: 18px;
  padding-inline-end: 18px;
}

.input-group select option {
  color: var(--text-primary);
  background: var(--bg-white);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--burgundy-mid);
  box-shadow: 0 0 0 4px rgba(168, 77, 114, 0.06);
  background: var(--bg-white);
}

.optional-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.error-msg {
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
  display: none;
  font-weight: 500;
}

.error-msg.show {
  display: block;
}

.input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 4px rgba(224, 107, 122, 0.06) !important;
}

/* upload */
.upload-area {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 30px 20px;
  text-align: center;
  transition: var(--transition);
  background: var(--bg-soft);
  cursor: pointer;
  position: relative;
}

.upload-area:hover,
.upload-area.is-dragover {
  border-color: var(--burgundy-light);
  background: var(--burgundy-pale);
}

.upload-area i {
  font-size: 48px;
  color: var(--burgundy-light);
  margin-bottom: 10px;
}

.upload-area p {
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}

.upload-area .count {
  color: var(--burgundy-deep);
  font-weight: 700;
  margin-top: 8px;
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.preview-item {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border-light);
  position: relative;
  background: var(--bg-soft);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item .main-badge {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: rgba(122, 46, 74, 0.88);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 2px;
}

.preview-item .remove {
  position: absolute;
  top: -6px;
  inset-inline-start: -6px;
  background: var(--error);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.preview-item .remove:hover {
  transform: scale(1.1);
}

/* specs */
.extras-section {
  margin-top: 0;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  border: 1px solid var(--border-light);
}

.extras-section h4 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.extras-section h4 i {
  color: var(--burgundy-mid);
  margin-inline-end: 10px;
}

.attrs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}

.attrs-grid .full {
  grid-column: 1 / -1;
}

.attrs-empty {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
  grid-column: 1 / -1;
}

.attr-field {
  position: relative;
  overflow: visible;
  z-index: 0;
}

.attr-field.is-select-open {
  z-index: 200;
}

.attr-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.attr-field input,
.attr-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-white);
  appearance: auto;
  -webkit-appearance: menulist;
}

.attr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attr-chip {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  background: var(--bg-white);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.attr-chip.is-on {
  background: var(--burgundy-mid);
  border-color: var(--burgundy-mid);
  color: #fff;
}

.attr-field.is-error label {
  color: #c62828;
}

.attr-field.is-error input,
.attr-field.is-error textarea,
.attr-field.is-error .cat-dd__trigger {
  border-color: #e57373;
}

.attrs-empty--error {
  color: #c62828;
}

.attr-section__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--burgundy-mid);
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}

.attr-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.attr-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-white);
  resize: vertical;
  min-height: 96px;
}

.attr-field--select .cat-dd {
  width: 100%;
}

.attr-cat-dd .cat-dd__trigger {
  width: 100%;
}

.attr-chips--bool {
  max-width: 280px;
}

.attr-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.attr-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 12px 6px 8px;
  background: var(--bg-white);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.attr-color-chip__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--chip-color, #ccc);
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.attr-color-chip.is-on {
  border-color: var(--burgundy-mid);
  background: rgba(122, 46, 74, 0.08);
  color: var(--burgundy-mid);
}

.attr-color-custom {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-white);
}

/* plans */
.plans-block {
  margin-top: 24px;
}

.plans-block__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.plans-block__title i {
  color: var(--burgundy-mid);
  margin-inline-end: 10px;
}

.balance-line {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 14px;
  font-weight: 600;
}

.balance-line strong {
  color: var(--burgundy-deep);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.plan-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 24px 20px;
  text-align: center;
  transition: var(--transition);
  background: var(--bg-soft);
  cursor: pointer;
  position: relative;
}

.plan-card:hover {
  border-color: var(--burgundy-light);
}

.plan-card.selected {
  border-color: var(--burgundy-mid);
  background: var(--burgundy-pale);
  box-shadow: var(--shadow-card);
}

.plan-card.is-locked {
  cursor: default;
}

.plan-card.is-locked:not(.selected) {
  pointer-events: none;
  opacity: 0.45;
}

.plan-card .plan-icon {
  font-size: 36px;
  color: var(--burgundy-mid);
  margin-bottom: 8px;
}

.plan-card h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.plan-card .price {
  font-size: 20px;
  font-weight: 800;
  color: var(--burgundy-deep);
  margin: 6px 0;
}

.plan-card .price small {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-card ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  text-align: start;
  font-size: 14px;
  color: var(--text-secondary);
}

.plan-card ul li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
}

.plan-card ul li:last-child {
  border-bottom: none;
}

.plan-card ul li i {
  color: var(--burgundy-mid);
  margin-inline-end: 8px;
}

.plan-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-badge.free {
  background: #e8f0fe;
  color: #1a5a9c;
}

.plan-badge.premium {
  background: #eef0f4;
  color: #7a7a8a;
  border: 1px solid #ccc;
}

.plan-badge.vip {
  background: #fef3d6;
  color: #8a6d2b;
  border: 1px solid #d4af37;
}

.plan-card .plan-extra {
  margin-top: 6px;
  display: flex;
  justify-content: center;
}

.plan-card .priority-tag {
  background: #f0f0f0;
  padding: 2px 12px;
  border-radius: 40px;
  font-size: 12px;
  border: 1px solid #ccc;
}

.plan-card .vip-badge {
  display: inline-block;
  background: #d4af37;
  color: #fff;
  padding: 2px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.plan-summary {
  margin-top: 24px;
  background: var(--burgundy-pale);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  border-inline-start: 4px solid var(--burgundy-mid);
}

.plan-summary p {
  font-weight: 600;
  margin: 0;
  font-size: 15px;
}

.plan-summary i {
  color: var(--burgundy-mid);
  margin-inline-end: 8px;
}

/* navigation */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 34px;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.btn {
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--burgundy-mid), var(--burgundy-deep));
  color: #fff;
  box-shadow: 0 4px 16px rgba(168, 77, 114, 0.2);
  margin-inline-start: auto;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(168, 77, 114, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-light);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--burgundy-light);
  color: var(--burgundy-deep);
  background: var(--burgundy-pale);
}

.btn-success {
  background: #1f8b4c;
  color: #fff;
  box-shadow: 0 4px 16px rgba(31, 139, 76, 0.2);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(31, 139, 76, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

@media (max-width: 768px) {
  body.add-ad-body .container {
    padding: 20px 16px;
  }

  .form-grid,
  .attrs-grid,
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .stepper {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 0;
  }

  .stepper::before {
    display: none;
  }

  .step-item {
    flex: 0 0 auto;
  }

  .step-label {
    font-size: 11px;
  }

  .nav-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-success,
  .btn-preview {
    margin-inline-start: 0;
    width: 100%;
    justify-content: center;
  }
}
