/* ── Admin Layout ─────────────────────────────────────────────────────────── */
.admin-body {
  background: var(--color-bg);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── Admin Header ─────────────────────────────────────────────────────────── */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.admin-header__inner {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-sizing: border-box;
  position: relative;
}

.admin-header__inner > * {
  min-width: 0;
}

.admin-header__back {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 38px;
  padding: .42rem .75rem;
  border: 1.5px solid rgba(15, 143, 114, .28);
  border-radius: 999px;
  background: #ecfdf5;
  box-shadow: 0 8px 18px rgba(8, 112, 90, .12);
  font-size: .9rem;
  font-weight: 850;
  color: #08705a;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.admin-header__back:hover {
  background: #d8f3e9;
  color: #065846;
  box-shadow: 0 10px 24px rgba(8, 112, 90, .18);
  transform: translateY(-1px);
}

.admin-header__title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
  flex: 1;
  text-align: center;
  min-width: 0;
}

.admin-header__brand-mark {
  width: 30px;
  height: 30px;
  display: block;
  flex: 0 0 auto;
}

.admin-header__title-text {
  min-width: 0;
}

.admin-header__language {
  margin-left: auto;
  margin-right: .75rem;
  flex: 0 0 auto;
}

.admin-header__logout {
  margin-left: auto;
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  padding: .35rem .75rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-muted);
  transition: background var(--transition), color var(--transition);
}

.admin-header__logout:hover {
  background: var(--color-danger, #ef4444);
  border-color: var(--color-danger, #ef4444);
  color: #fff;
}

/* ── Admin Main ───────────────────────────────────────────────────────────── */
.admin-main {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 1024px) {
  .admin-header__inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .admin-main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ── Admin Card ───────────────────────────────────────────────────────────── */
.admin-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  border: 1px solid var(--color-border);
  min-width: 0;
}

.admin-card__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  min-width: 0;
}

.admin-card__eyebrow {
  margin: 0 0 .35rem;
  color: var(--color-accent);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.commercial-dashboard,
.onboarding-wizard {
  border-radius: 14px;
}

.commercial-dashboard__head,
.onboarding-wizard__head,
.admin-mode-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-mode-card {
  align-items: center;
  margin-bottom: 0;
}

.admin-mode-card .admin-card__title {
  margin-bottom: .35rem;
}

.admin-mode-card .btn-view-store {
  flex-shrink: 0;
  text-align: center;
}

.commercial-dashboard__head .admin-card__title,
.onboarding-wizard__head .admin-card__title {
  margin: 0;
}

.commercial-dashboard__badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #08705a;
  padding: .35rem .75rem;
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

.commercial-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .8rem;
}

.commercial-kpi-grid article {
  min-width: 0;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 1rem;
}

.commercial-kpi-grid span {
  color: #64748b;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.25;
}

.commercial-kpi-grid strong {
  color: #172033;
  font-size: 1.35rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.wizard-steps {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr));
  gap: .8rem;
}

.wizard-step {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #ffffff;
  padding: 1rem;
}

.wizard-step.is-active {
  border-color: rgba(18, 140, 126, .35);
  background: #f0fdfa;
}

.wizard-step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: .65rem;
  border-radius: 999px;
  background: #e8f4fd;
  color: #1a73e8;
  font-weight: 900;
}

.wizard-step strong,
.wizard-step p,
.wizard-step label {
  display: block;
}

.wizard-step strong {
  color: #172033;
  line-height: 1.25;
}

.wizard-step p,
.wizard-step label {
  margin: .5rem 0 0;
  color: #64748b;
  font-size: .86rem;
  line-height: 1.4;
}

.wizard-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
  margin-top: .75rem;
}

.wizard-card-grid button {
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  padding: .55rem .45rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
}

.wizard-card-grid button:hover,
.wizard-card-grid button.active {
  border-color: #128c7e;
  background: #ecfdf5;
  color: #08705a;
}

.collapsible-chevron,
.cat-scroll-btn,
.quick-scroll__btn {
  opacity: .62;
}

.collapsible-title:hover .collapsible-chevron,
.cat-scroll-btn:hover,
.quick-scroll__btn:hover {
  opacity: .9;
}

.schedule-days.is-disabled label {
  background: #d1d5db !important;
  border-color: #9ca3af !important;
  color: #4b5563 !important;
}

.schedule-days.is-disabled input {
  accent-color: #6b7280;
}

.quick-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 0 0 .9rem;
}

@media (max-width: 1180px) {
  .commercial-kpi-grid,
  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .commercial-dashboard__head,
  .onboarding-wizard__head,
  .admin-mode-card {
    flex-direction: column;
  }

  .commercial-dashboard__badge {
    white-space: normal;
  }

  .commercial-kpi-grid,
  .wizard-steps,
  .wizard-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Billing / Plan ─────────────────────────────────────────────────────── */
.billing-card {
  gap: 1.25rem;
}

.billing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.billing-head .admin-card__title {
  margin-bottom: .35rem;
}

.billing-status {
  min-width: 190px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: .85rem 1rem;
  background: linear-gradient(135deg, #f8fafc, #fff);
}

.billing-status__label {
  display: block;
  color: var(--color-muted);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.billing-status strong {
  display: block;
  color: var(--color-accent);
  font-size: 1.25rem;
  line-height: 1.2;
}

.billing-status small {
  display: block;
  color: var(--color-muted);
  margin-top: .15rem;
}

.billing-alert {
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  padding: .85rem 1rem;
  font-size: .9rem;
  margin-bottom: 1rem;
}

.billing-alert--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.billing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.billing-plan {
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 310px;
  position: relative;
}

.billing-plan--current {
  border-color: var(--color-accent);
  box-shadow: 0 8px 24px rgba(18, 140, 126, .12);
}

.billing-plan--featured {
  border-color: #2563eb;
}

.billing-plan__badge {
  align-self: flex-start;
  border-radius: 999px;
  background: #e8f4fd;
  color: #0f4f80;
  font-size: .72rem;
  font-weight: 700;
  padding: .22rem .55rem;
  margin-bottom: .75rem;
}

.billing-plan h3 {
  margin: 0 0 .4rem;
  color: var(--color-text);
  font-size: 1.1rem;
}

.billing-plan__price {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  margin: .25rem 0 1rem;
}

.billing-plan__price strong {
  font-size: 1.65rem;
  color: var(--color-text);
}

.billing-plan__price span {
  color: var(--color-muted);
  font-size: .85rem;
}

.billing-plan__trial {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: .65rem .75rem;
  margin: -.25rem 0 .9rem;
  line-height: 1.35;
}

.billing-plan__trial strong,
.billing-plan__trial span {
  display: block;
}

.billing-plan__trial strong {
  font-size: .82rem;
}

.billing-plan__trial span {
  font-size: .78rem;
  margin-top: .15rem;
}

.billing-plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  color: #374151;
  font-size: .9rem;
  line-height: 1.35;
}

.billing-plan li::before {
  content: '✓';
  color: var(--color-accent);
  font-weight: 800;
  margin-right: .45rem;
}

.billing-plan__action {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

.billing-plan__action:disabled {
  opacity: .65;
  cursor: default;
}

.billing-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.billing-footer p {
  flex: 1;
  min-width: 220px;
  color: var(--color-muted);
  font-size: .84rem;
  line-height: 1.45;
}

.billing-cancel-btn {
  border-color: #fecaca;
  color: #991b1b;
}

@media (max-width: 900px) {
  .billing-head,
  .billing-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .billing-status {
    min-width: 0;
  }

  .billing-grid {
    grid-template-columns: 1fr;
  }
}

.admin-card__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.admin-card__desc {
  font-size: .92rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.admin-card__footer {
  margin-top: 1.5rem;
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .admin-header__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "back title title"
      "bell language logout";
    gap: .42rem .55rem;
    padding: .5rem .65rem;
  }

  .admin-header__back {
    grid-area: back;
    max-width: none;
    min-height: 36px;
    padding: .36rem .55rem;
    font-size: .78rem;
    line-height: 1.08;
    border-radius: 12px;
  }

  .admin-header__back svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
  }

  .admin-header__title {
    grid-area: title;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .18rem .35rem;
    font-size: .9rem;
    line-height: 1.08;
    text-align: left;
  }

  .admin-header__title-text {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0;
  }

  .admin-header__title-text::after {
    content: "Panel Admin";
    font-size: .9rem;
  }

  .admin-header__brand-mark {
    width: 24px;
    height: 24px;
  }

  .admin-header__store-badge {
    max-width: min(9.5rem, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 0;
    padding: .12rem .45rem;
    font-size: .68rem;
  }

  .admin-header__language {
    grid-area: language;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
  }

  .admin-header__language select {
    max-width: min(100%, 8.5rem);
    min-height: 30px;
    font-size: .76rem;
  }

  .admin-header__bell {
    grid-area: bell;
    justify-self: start;
    align-self: center;
    min-width: 32px;
    height: 30px;
  }

  .admin-header__logout {
    grid-area: logout;
    margin-left: 0;
    align-self: center;
    justify-self: end;
    min-height: 30px;
    padding: .28rem .5rem;
    font-size: .72rem;
    white-space: nowrap;
  }

  .admin-main {
    padding: 1rem .75rem 4rem;
    gap: 1rem;
  }

  .admin-store-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .35rem;
    padding: .38rem .65rem;
  }

  .store-bar__label {
    display: none;
  }

  .store-bar__url {
    min-width: 0;
    min-height: 32px;
    display: flex;
    align-items: center;
    padding: 0 .65rem;
    border: 1px solid rgba(34, 197, 94, .22);
    border-radius: 999px;
    background: #fff;
    font-size: .76rem;
  }

  .store-bar__actions {
    gap: .25rem;
  }

  .store-bar__btn,
  .store-bar__wa {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0;
    line-height: 1;
  }

  .store-bar__btn::before {
    content: "📋";
    font-size: .92rem;
  }

  .store-bar__wa::before {
    content: "↗";
    font-size: 1rem;
    font-weight: 900;
  }

  .admin-card {
    border-radius: 12px;
    padding: 1rem;
  }

  .admin-card__title {
    align-items: flex-start;
    gap: .45rem;
    font-size: 1rem;
    line-height: 1.18;
  }

  .admin-card__icon {
    font-size: 1.15rem;
  }

  .admin-card__footer {
    justify-content: stretch;
  }

  .admin-card__footer .btn-primary,
  .admin-card__footer .btn-secondary,
  .admin-card__footer .btn-terms {
    width: 100%;
  }
}

/* ── Form Grid ────────────────────────────────────────────────────────────── */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

@media (max-width: 600px) {
  .admin-form-grid { grid-template-columns: 1fr; }
}

.form-field { display: flex; flex-direction: column; gap: .35rem; }
.form-field--full { grid-column: 1 / -1; }

.variant-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .55rem;
}

.variant-stock-cell {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .5rem;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-bg);
}

.variant-stock-cell label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-text);
}

.form-field__label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text);
}

.required { color: var(--color-danger); }
.optional  { font-weight: 400; color: var(--color-muted); font-size: .8rem; }

.form-field__input {
  width: 100%;
  padding: .55rem .875rem;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font-size: .95rem;
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-field__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,211,102,.15);
}

.form-field__prefix-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-field__prefix-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,211,102,.15);
}

.form-field__prefix {
  display: flex;
  align-items: center;
  padding: 0 .6rem;
  background: #f0fdf4;
  border-right: 1.5px solid var(--color-border);
  height: 100%;
}

.form-field__input--prefixed {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.form-field__input--prefixed:focus { box-shadow: none; }

.form-field__hint {
  font-size: .78rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.schedule-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .45rem;
  margin-top: .25rem;
}

.schedule-days label {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 38px;
  padding: .45rem .6rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: .88rem;
  font-weight: 700;
}

.schedule-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .4rem;
}

.schedule-time-grid label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  color: var(--color-muted);
  font-size: .84rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .schedule-time-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  min-width: 160px;
  min-height: 42px;
}

.btn-primary:hover:not(:disabled) { background: var(--color-primary-d); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 42px;
  min-width: 150px;
  padding: .65rem 1.15rem;
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.btn-secondary:hover,
.btn-outline:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.btn-secondary:disabled,
.btn-outline:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.theme-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
}

.theme-template-card {
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  padding: .65rem;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.theme-template-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.theme-template-card.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .16);
}

.theme-template-preview {
  border: 1px solid var(--theme-border);
  border-radius: 7px;
  background: var(--theme-bg);
  overflow: hidden;
  min-height: 84px;
}

.theme-template-preview__header {
  height: 24px;
  background: var(--theme-surface);
  border-bottom: 1px solid var(--theme-border);
}

.theme-template-preview__body {
  padding: .45rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
}

.theme-template-preview__card {
  min-height: 34px;
  border-radius: 5px;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
}

.theme-template-preview__button {
  grid-column: 1 / -1;
  height: 12px;
  border-radius: 999px;
  background: var(--theme-primary);
}

.theme-template-name {
  display: block;
  margin-top: .55rem;
  font-size: .86rem;
  font-weight: 800;
}

.theme-template-desc {
  display: block;
  margin-top: .15rem;
  color: var(--color-muted);
  font-size: .74rem;
  line-height: 1.3;
}

.btn-terms {
  border: 1.5px solid;
  border-radius: 7px;
  padding: .55rem .9rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-terms--pending {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

.btn-terms--accepted {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

.btn-terms__cue {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: termsCue 1s ease-in-out infinite;
}

@keyframes termsCue {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  45% { transform: translateX(5px) rotate(-8deg); }
}

.store-terms-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.store-terms-modal[hidden] {
  display: none;
}

.store-terms-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .58);
}

.store-terms-modal__dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(82dvh, 760px);
  overflow: auto;
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  padding: 1.1rem;
}

.store-terms-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.store-terms-modal__title {
  margin: 0;
  font-size: 1.05rem;
}

.store-terms-modal__close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.store-terms-modal__body {
  color: var(--color-text);
  font-size: .88rem;
  line-height: 1.58;
}

.store-terms-modal__body p {
  margin: 0 0 .8rem;
}

.store-terms-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Upload Zone ──────────────────────────────────────────────────────────── */
.upload-zone {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--color-bg);
}

.upload-zone:hover,
.upload-zone--drag { border-color: var(--color-primary); background: #f0fdf4; }
.upload-zone--has-file { border-color: var(--color-primary); background: #f0fdf4; }

.upload-zone__icon { font-size: 2rem; margin-bottom: .5rem; }

.upload-zone__text {
  font-size: .95rem;
  color: var(--color-muted);
}

.upload-zone__link {
  color: var(--color-accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-zone__hint {
  font-size: .78rem;
  color: var(--color-muted);
  margin-top: .4rem;
}

.upload-zone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* La label interna recibe el clic, el input invisible ocupa toda la zona */
.upload-zone--images .upload-zone__input { display: none; }

/* ── Selected file indicator ─────────────────────────────────────────────── */
.upload-selected {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  padding: .5rem .875rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  font-size: .88rem;
}

.upload-selected__icon { font-size: 1.1rem; }
.upload-selected__name { flex: 1; font-weight: 500; word-break: break-all; }

.upload-selected__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: 4px;
  transition: color var(--transition);
}

.upload-selected__remove:hover { color: var(--color-danger); }

/* ── Image Preview Grid ───────────────────────────────────────────────────── */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.img-preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

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

.img-preview-name {
  font-size: .68rem;
  padding: .25rem .4rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.img-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: .7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.img-preview-remove:hover { background: var(--color-danger); }

/* ── Result Box ───────────────────────────────────────────────────────────── */
.upload-result {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: .88rem;
}

.product-workspace-tabs-shell {
  position: relative;
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.product-workspace-tabs-shell::before,
.product-workspace-tabs-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  pointer-events: none;
  z-index: 2;
}

.product-workspace-tabs-shell::before {
  left: 0;
  background: linear-gradient(90deg, var(--color-surface), rgba(255,255,255,0));
}

.product-workspace-tabs-shell::after {
  right: 0;
  background: linear-gradient(270deg, var(--color-surface), rgba(255,255,255,0));
}

.product-workspace-tabs {
  display: flex;
  gap: .45rem;
  padding: .35rem 2.25rem;
  background: var(--color-surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2.25rem;
}

.product-workspace-tabs::-webkit-scrollbar {
  display: none;
}

.product-workspace-scroll {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  z-index: 3;
  border: 0;
  background: var(--color-surface);
  color: #64748b;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  opacity: .76;
}

.product-workspace-scroll--left {
  left: 0;
  border-right: 1px solid rgba(0,0,0,.06);
}

.product-workspace-scroll--right {
  right: 0;
  border-left: 1px solid rgba(0,0,0,.06);
}

.product-workspace-scroll:hover:not(:disabled) {
  color: #166534;
  opacity: 1;
}

.product-workspace-scroll:disabled {
  opacity: .22;
  cursor: default;
}

.product-workspace-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: .55rem .85rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--color-muted);
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.product-workspace-tab:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.product-workspace-tab.is-active {
  background: #eafaf0;
  border-color: rgba(37, 211, 102, .35);
  color: #166534;
}

.product-workspace-section {
  display: none;
}

.product-workspace-section.is-active {
  display: block;
}

.product-add-mode-tabs {
  display: none;
  gap: .45rem;
  padding: .35rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.product-add-mode-tabs.is-active {
  display: flex;
  flex-wrap: wrap;
}

.product-add-mode-tab {
  flex: 1 1 180px;
  min-height: 40px;
  padding: .6rem .85rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--color-muted);
  font-size: .86rem;
  font-weight: 900;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.product-add-mode-tab:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.product-add-mode-tab.is-active {
  background: #eafaf0;
  border-color: rgba(37, 211, 102, .35);
  color: #166534;
}

.product-workspace-section.product-add-mode-panel.is-active {
  display: none;
}

.product-workspace-section.product-add-mode-panel.is-active.is-add-mode-active {
  display: block;
}

.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}

.result-badge {
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}

.result-badge--ok    { background: #dcfce7; color: #166534; }
.result-badge--warn  { background: #fef9c3; color: #854d0e; }
.result-badge--err   { background: #fee2e2; color: #991b1b; }
.result-badge--total { background: #e0f2fe; color: #075985; }

.result-errors {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  max-height: 200px;
  overflow-y: auto;
}

.result-errors li {
  padding: .3rem .6rem;
  background: #fef2f2;
  border-left: 3px solid var(--color-danger);
  border-radius: 4px;
  font-size: .82rem;
}

.result-ok {
  color: #166534;
  font-weight: 600;
  margin-bottom: .5rem;
}

.result-url-title {
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--color-text);
}

.result-url-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  max-height: 220px;
  overflow-y: auto;
}

.result-url-list li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .6rem;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.result-url-list code {
  flex: 1;
  font-size: .8rem;
  word-break: break-all;
  color: var(--color-accent);
}

.btn-copy {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: .1rem .25rem;
  border-radius: 4px;
  transition: background var(--transition);
}

.btn-copy:hover { background: var(--color-bg); }

.result-error-msg {
  color: var(--color-danger);
  font-weight: 500;
}

/* ── Admin Toast ──────────────────────────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: .75rem 1.4rem;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  max-width: calc(100vw - 2rem);
  text-align: center;
  transition: opacity .3s ease;
}

.admin-toast--success { background: #166534; color: #fff; }
.admin-toast--error   { background: var(--color-danger); color: #fff; }
.admin-toast--warn    { background: #854d0e; color: #fff; }

/* ── Promociones Genéricas ─────────────────────────────────────────── */
.promo-generic-card {
  border: 1px solid #e0e4e7;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: white;
  transition: border-color 0.2s ease;
}

.promo-generic-card[data-status="expired"] {
  border-color: #f56565;
  background: #fef2f2;
}

.promo-generic-card[data-status="exhausted"] {
  border-color: #ed8936;
  background: #fffaf0;
}

.promo-generic-card[data-status="active"] {
  border-color: #48bb78;
  background: #f0fff4;
}

.promo-generic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.promo-generic-info h4 {
  margin: 0 0 0.5rem 0;
  color: #2d3748;
  font-size: 1.1rem;
}

.promo-generic-details {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.promo-detail {
  font-size: 0.9rem;
  color: #4a5568;
}

.promo-status {
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.promo-status--active {
  background: #c6f6d5;
  color: #22543d;
}

.promo-status--expired {
  background: #fed7d7;
  color: #742a2a;
}

.promo-status--exhausted {
  background: #feebc8;
  color: #7b341e;
}

.promo-generic-actions {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

.btn-copy-promo, .btn-stats-promo {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-promo {
  background: #3182ce;
  color: white;
}

.btn-copy-promo:hover {
  background: #2c5aa0;
}

.btn-stats-promo {
  background: #805ad5;
  color: white;
}

.btn-stats-promo:hover {
  background: #6b46c1;
}

.promo-generic-usage {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.promo-generic-usage summary {
  cursor: pointer;
  color: #4a5568;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.promo-usage-list {
  background: #f7fafc;
  border-radius: 4px;
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.promo-usage-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

.promo-usage-item:last-child {
  border-bottom: none;
}

/* ── Modales de Promociones ──────────────────────────────────────────── */
.promo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.promo-modal__content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

.promo-modal__content--large {
  max-width: 800px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.promo-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.promo-modal__header h3 {
  margin: 0;
  color: #2d3748;
  font-size: 1.25rem;
}

.promo-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #718096;
  padding: 0.25rem;
  line-height: 1;
}

.promo-modal__close:hover {
  color: #2d3748;
}

.promo-modal__body {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.promo-preview {
  margin-bottom: 1.5rem;
}

.promo-preview__customer {
  background: #f7fafc;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.promo-preview__customer strong {
  color: #2d3748;
}

.promo-preview__customer span {
  color: #718096;
  font-size: 0.9rem;
}

.promo-preview__message {
  background: #25d366;
  color: white;
  padding: 1rem;
  border-radius: 12px 12px 12px 4px;
  margin: 0 0 0 2rem;
  position: relative;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.promo-preview__message::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #25d366;
  transform: rotate(-45deg);
}

.promo-preview__message pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
}

.promo-modal__buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.promo-modal__buttons button {
  flex: 1;
  min-width: 120px;
}

/* ── Envío Masivo ─────────────────────────────────────────────────────── */
.massive-send-options {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.massive-option {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.massive-option:hover {
  border-color: #cbd5e0;
}

.massive-option__header h4 {
  margin: 0 0 0.5rem 0;
  color: #2d3748;
  font-size: 1.1rem;
}

.massive-option__header p {
  margin: 0 0 1rem 0;
  color: #718096;
  font-size: 0.9rem;
}

.massive-option__actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.massive-option__info small {
  color: #4a5568;
  line-height: 1.4;
}

.sequential-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f7fafc;
  border-radius: 6px;
}

.sequential-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #4a5568;
  font-size: 0.9rem;
}

.sequential-controls select {
  padding: 0.25rem 0.5rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.85rem;
}

.sequential-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.individual-messages {
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.individual-message-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.individual-message-card:last-child {
  border-bottom: none;
}

.individual-message-info {
  flex-shrink: 0;
  width: 120px;
}

.individual-message-info strong {
  display: block;
  color: #2d3748;
  font-size: 0.9rem;
}

.individual-message-info span {
  color: #718096;
  font-size: 0.8rem;
}

.individual-message-preview {
  flex: 1;
  background: #f7fafc;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.individual-message-preview pre {
  margin: 0;
  white-space: pre-wrap;
  color: #4a5568;
  line-height: 1.3;
}

.individual-send-btn {
  flex-shrink: 0;
}

/* ── Botones mejorados ───────────────────────────────────────────────── */
.promo-prepare-btn {
  background: #4299e1;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: 1px solid #28a745;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-success:hover {
  background: linear-gradient(135deg, #218838, #1d9f85);
  border-color: #1e7e34;
  transform: translateY(-1px);
}

/* ── Rubros múltiples ─────────────────────────────────────────────────── */
.rubros-selection-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rubros-selected {
  min-height: 44px;
  padding: 0.5rem;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.rubros-selected-empty {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0;
  font-style: italic;
}

.rubro-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: linear-gradient(135deg, var(--color-primary), #20c997);
  color: white;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.rubro-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.rubro-tag-emoji {
  font-size: 1rem;
}

.rubro-tag-remove {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  transition: background 0.2s ease;
}

.rubro-tag-remove:hover {
  background: rgba(255, 255, 255, 0.2);
}

.rubro-cats-summary {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: #f0fdf4;
  border-radius: 6px;
  color: #166534;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Categorías sugeridas mejoradas ─────────────────────────────────────── */
.rubro-cats-box {
  margin-top: 1rem;
  padding: 1rem;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  border-left: 4px solid var(--color-primary);
}

.rubro-cats-title {
  margin: 0 0 0.75rem 0;
  color: #2d3748;
  font-weight: 600;
  font-size: 0.95rem;
}

.rubro-cats-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cat-tag {
  padding: 0.25rem 0.6rem;
  background: white;
  border: 1px solid #cbd5e0;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #4a5568;
  transition: all 0.2s ease;
}

.cat-tag:hover {
  border-color: var(--color-primary);
  background: #f0fff4;
}
}

.promo-prepare-btn:hover {
  background: #3182ce;
  transform: translateY(-1px);
}

.promo-prepare-btn:disabled {
  background: #a0aec0;
  cursor: not-allowed;
  transform: none;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: #ed8936;
  color: white;
  transition: background 0.2s ease;
}

.btn-small:hover {
  background: #dd6b20;
}

@media (max-width: 768px) {
  .promo-modal__content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .massive-option__actions {
    flex-direction: column;
  }
  
  .individual-message-card {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .individual-message-info {
    width: auto;
  }
}

/* ── Gestión de Catálogo ─────────────────────────────────────────────────── */
.catalog-controls {
  margin-bottom: 1.5rem;
}

.catalog-filters {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.catalog-select {
  flex: 1;
  min-width: 150px;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.catalog-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.catalog-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.action-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-right: 0.5rem;
  white-space: nowrap;
}

.btn-action {
  padding: 0.4rem 0.8rem;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  background: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-action:hover {
  background: var(--color-bg);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.catalog-count {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.75rem;
  text-align: center;
}

/* Grilla de productos para gestión */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.catalog-item {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.catalog-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--color-accent);
}

.catalog-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.catalog-item-info {
  flex: 1;
  min-width: 0;
}

.catalog-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.25rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-item-category {
  font-size: 0.8rem;
  color: var(--color-muted);
  background: var(--color-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  display: inline-block;
}

.catalog-item-toggle {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch.active {
  background: var(--color-accent);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

.catalog-item-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.catalog-item-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
}

.catalog-item-stock {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--color-bg);
}

.catalog-item-stock.ok {
  background: #d1f2eb;
  color: #0c5345;
}

.catalog-item-stock.low {
  background: #fef3d1;
  color: #7d4e00;
}

.catalog-item-stock.out {
  background: #fde8e8;
  color: #7d1d1d;
}

.catalog-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.catalog-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-muted);
}

.catalog-edit-wide {
  grid-column: 1 / -1;
}

.catalog-edit-input {
  width: 100%;
  padding: 0.42rem 0.5rem;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  background: white;
  color: var(--color-text);
  font: inherit;
  font-size: 0.82rem;
}

.catalog-edit-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.catalog-save-btn {
  grid-column: 1 / -1;
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: var(--color-accent);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.catalog-save-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.catalog-item-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.stock-input {
  width: 60px;
  padding: 0.3rem 0.5rem;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.8rem;
  text-align: center;
}

.stock-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.stock-btn {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: white;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
}

.stock-btn:hover {
  background: var(--color-bg);
  border-color: var(--color-accent);
}

@media (max-width: 768px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-row {
    flex-direction: column;
  }
  
  .action-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .catalog-edit-form {
    grid-template-columns: 1fr;
  }
}

.action-buttons-grid {
  display: grid;
  gap: 0.6rem;
  width: 100%;
}

.cat-action-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
}

.cat-action-row__name {
  min-width: 0;
  color: var(--color-text);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-action-row__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.action-buttons-grid .cat-category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 34px;
  padding: 0.38rem 0.58rem;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  background: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.action-buttons-grid .cat-category-btn small {
  color: var(--color-muted);
  font-weight: 700;
}

.action-buttons-grid .cat-btn-enable {
  border-color: #bbf7d0;
}

.action-buttons-grid .cat-btn-disable {
  border-color: #fecaca;
}

.action-buttons-grid .cat-btn-rename {
  color: #2454a6;
}

.action-buttons-grid .cat-btn-enable:hover {
  background: #d1f2eb;
  border-color: #0c5345;
  color: #0c5345;
}

.action-buttons-grid .cat-btn-disable:hover {
  background: #fde8e8;
  border-color: #7d1d1d;
  color: #7d1d1d;
}

.action-buttons-grid .cat-btn-rename:hover {
  background: #eef4ff;
  border-color: #2454a6;
  color: #2454a6;
}

@media (max-width: 640px) {
  .cat-action-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .cat-action-row__buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .cat-action-row__buttons .cat-btn-rename {
    grid-column: 1 / -1;
  }
}
