@import "./cart.css";

body {
  margin: 0;
  background: #fff;
  font-family: sans-serif;
  overflow-x: hidden;
  padding-top: var(--header-offset, 0px);
}

/* HEADER */
.header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "logo search user cart";
  align-items: center;
  padding: 12px 16px;
  background: #111;
  color: #fff;
  gap: 15px;
  width: 100%;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  transform: translateY(0);
  will-change: transform;
}

.logo {
  width: 150px;
  height: 25px;
  object-fit: contain;
  grid-area: logo;
}

.search {
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 15px;
  color: #111;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.search::placeholder {
  font-size: 15px;
  color: #9ca3af;
}

.search:focus {
  outline: none;
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.search-box {
  position: relative;
  min-width: 0;
  grid-area: search;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 50;
}

.search-results.hidden {
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  color: #111;
}

.search-result-item:hover {
  background: #f2f2f2;
}

.search-result-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 900px) {
  body {
    padding-top: var(--header-height, var(--header-offset, 0px));
  }

  .header {
    display: flex;
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 10px;
    padding: 8px;
    align-items: center;
  }
  .header::after {
    content: "";
    flex-basis: 100%;
    height: 0;
    order: 3;
  }
  .header.has-admin-btn::before {
    content: "";
    flex-basis: 100%;
    height: 0;
    order: 5;
  }
  .logo {
    order: 1;
    justify-self: start;
  }
  .header .header-user {
    display: contents;
  }
  .header .user-info {
    order: 2;
    margin: 0;
    margin-left: auto;
    gap: 6px;
  }
  .header #btn-admin-header {
    order: 4;
    margin: 0;
    width: 100%;
    flex: 1 0 100%;
    justify-content: center;
  }
  .header .search-box {
    order: 6;
    flex: 1 1 auto;
    min-width: 0;
  }
  .header .carrito {
    order: 7;
    width: 33px;
    margin: 0;
    padding: 0;
  }
}

.search-result-name {
  font-size: 14px;
  font-weight: 600;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
  grid-area: user;
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding-left: 15px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  color: #111;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  padding: 8px 0;
  min-width: 140px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  z-index: 10;
}

.user-menu:hover .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.user-menu.open .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.delivery-toast {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: #1b7a1f;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.delivery-toast::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #1b7a1f;
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.delivery-dot {
  display: inline-block;
  margin-left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  vertical-align: middle;
}
.notify-dot {
  display: inline-block;
  margin-left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  vertical-align: middle;
}

.dropdown-item {
  display: block;
  padding: 8px 14px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.dropdown-item:hover {
  background: #f2f2f2;
}

.dropdown-button {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  padding: 8px 14px;
  font-weight: 600;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  color: inherit;
}

.dropdown-button:hover {
  background: #f2f2f2;
}

.logout-btn {
  color: #dc2626;
}

.logout-btn:hover,
.logout-btn:focus {
  background: #fee2e2;
}

.carrito {
  width: 33px;
  cursor: pointer;
  margin-left: 0;
  grid-area: cart;
  justify-self: end;
}

.metodos-pago {
  margin-top: 24px;
}

.page-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.cart-pay-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
}

.cart-pay-stack .status {
  margin: 2px 0 0;
}

.cart-saldo {
  margin-top: 8px;
  text-align: right;
  font-weight: 700;
}

.cart-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cart-title-row .cart-saldo {
  margin: 0;
  text-align: right;
  font-size: 22px;
  color: #16a34a;
}

#cart-page-items {
  margin-bottom: 8px;
}

.cart-actions-inline {
  margin-top: 10px;
  text-align: right;
}

.cart-actions-inline .btn-outline,
.cart-actions-inline .btn-primary {
  margin-left: 8px;
}

.btn-disabled-soft,
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.6);
}

.cart-page-table th,
.cart-page-table td {
  text-align: center;
  vertical-align: middle;
}

.cart-page-table th:first-child,
.cart-page-table td:first-child {
  text-align: left;
}

.cart-page-table td.cart-actions-inline {
  text-align: right !important;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.cart-table-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
}

.cart-right .cart-summary-table {
  width: auto;
  min-width: 0;
  display: inline-table;
  margin-left: auto;
}

.cart-summary-table.table-base {
  width: auto !important;
  min-width: 0 !important;
}

.cart-pay-wrap {
  margin-top: 10px;
  text-align: right;
}

.cart-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

@media (min-width: 1200px) {
  .cart-layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    align-items: start;
  }

  .cart-right {
    border-left: 1px solid #d1d5db;
    padding-left: 14px;
  }
}

@media (max-width: 1199px) {
  .cart-right {
    width: 100%;
  }
}

.checkout-form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-label {
  font-weight: 700;
  margin: 6px 0 2px;
}

.form-label .required {
  color: red;
}

.form-select,
.form-input {
  width: 100%;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#input-ref {
  width: 350px;
  max-width: 350px;
}

#phone-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hidden {
  display: none !important;
}

/* Loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  visibility: visible;
  opacity: 1;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.page-loader__logo {
  width: 180px;
  height: 32px;
  position: relative;
  background: url("https://ojigtjcwhcrnawdbtqkl.supabase.co/storage/v1/object/public/public_assets/logos/moose.png")
    center / contain no-repeat;
}
.page-loader__logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.input-error {
  border-color: red !important;
}

.input-disabled {
  background: #f2f2f2;
  color: #777;
}

.dropzone {
  border: 2px dashed #bbb;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  background: #fafafa;
  transition:
    background 0.15s ease,
    opacity 0.15s ease;
  width: 350px;
}

.file-preview {
  margin-top: 10px;
  display: inline-block;
  max-width: 200px;
  max-height: 200px;
}

.file-preview img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.reporte-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

.reporte-form .form-label {
  margin-bottom: 4px;
}

.checkout-total {
  margin-top: 10px;
  font-weight: 700;
  background: #eef2f6;
  border-radius: 10px;
  padding: 10px 12px;
}

.checkout-countdown {
  margin-top: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  color: #444;
}

.pago-movil-note {
  margin-top: 6px;
  font-weight: 900;
  font-size: 1.2rem;
  color: #b45309;
}

.saldo-display {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.saldo-subtitle {
  font-size: 1rem;
  color: #555;
}

.saldo-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0 16px 16px;
  margin: 0 auto 20px;
  text-align: left;
}

.saldo-page #saldo-input {
  font-size: 26px;
  padding: 14px 16px 14px 36px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  box-shadow: none;
  text-align: center;
  font-weight: 800;
  color: #1f2937 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.saldo-page #saldo-input::placeholder {
  color: #cbd5f5 !important;
  opacity: 1;
}

.saldo-page #saldo-input::-webkit-input-placeholder {
  color: #cbd5f5 !important;
  opacity: 1;
}

.saldo-page #saldo-input::-moz-placeholder {
  color: #cbd5f5 !important;
  opacity: 1;
}

.saldo-page #saldo-input:-ms-input-placeholder {
  color: #cbd5f5 !important;
  opacity: 1;
}

.saldo-page #saldo-input::-ms-input-placeholder {
  color: #cbd5f5 !important;
  opacity: 1;
}

.saldo-page #saldo-input.saldo-zero {
  color: #cbd5f5 !important;
}

.saldo-page #saldo-input:focus::placeholder {
  color: transparent !important;
}

.saldo-page #saldo-input:focus::-webkit-input-placeholder {
  color: transparent !important;
}

.saldo-page #saldo-input:focus::-moz-placeholder {
  color: transparent !important;
}

.saldo-page #saldo-input:focus:-ms-input-placeholder {
  color: transparent !important;
}

.saldo-page #saldo-input:focus::-ms-input-placeholder {
  color: transparent !important;
}

.saldo-page #saldo-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Quitar flechas del input numérico */
.saldo-page #saldo-input::-webkit-outer-spin-button,
.saldo-page #saldo-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.saldo-page #saldo-input[type="number"] {
  -moz-appearance: textfield;
}

.saldo-input-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

.saldo-page .saldo-input-wrap {
  max-width: 280px;
}

.saldo-currency {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 700;
  color: #6b7280;
  pointer-events: none;
}

.saldo-page .saldo-form {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  align-items: center;
}

.saldo-page .saldo-form .btn-primary {
  align-self: center;
}

.saldo-page.categorias-dinamicas {
  margin: 0 auto 20px;
  padding: 0 16px 16px;
}

@media (max-width: 700px) {
  .saldo-page .saldo-form {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .saldo-input-wrap {
    max-width: 100%;
    margin: 0 auto;
  }

  .saldo-page #saldo-input {
    width: 100%;
    max-width: 100%;
    display: block;
    margin: 0 auto;
  }
}

.dropzone.dragover {
  background: rgba(0, 0, 0, 0.1);
}

.dropzone.dropzone-disabled {
  background: #f2f2f2;
  border-color: #ddd;
  color: #777;
  pointer-events: none;
  opacity: 0.8;
}

.checkbox-line input {
  margin-right: 8px;
}

.metodos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.metodo-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #f7f7f7;
  cursor: pointer;
  font-weight: 700;
}

.metodo-btn.selected {
  border-color: #111;
  background: #e7e7e7;
}

.metodo-detalle {
  background: #eef2f6;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
  width: 350px;
}

.metodo-detalle p {
  margin: 4px 0;
}

.inventario-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.inventario-item {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.inventario-btn {
  width: 100%;
  text-align: left;
  font-weight: 700;
}

.inventario-plan {
  margin-top: 8px;
}

.inventario-plan-btn {
  width: 100%;
  text-align: left;
}

.btn-outline,
.btn-primary {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.btn-small {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.actions-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-outline {
  background: #f7f7f7;
  border: 1px solid #ddd;
  color: #111;
}

.btn-primary {
  background: #111;
  color: #fff;
}

.btn-outline:hover {
  background: #eee;
}

.reportes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.reportes-table th,
.reportes-table td {
  padding: 10px;
  border: 1px solid #e5e5e5;
  font-size: 13px;
}

.reportes-table th {
  background: #f8f8f8;
  text-align: left;
}

.modal-body-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: flex-start;
  text-align: left;
}

.modal-info p {
  margin: 6px 0;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
}

.modal-info-grid .label {
  font-weight: 700;
}

.modal-info-grid .value {
  word-break: break-word;
}

.input-inline {
  width: 100%;
  max-width: 240px;
  padding: 8px 10px;
}

.modal-actions-column {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
}

/* Quitar flechas de inputs numéricos */
input[type="number"].input-inline::-webkit-outer-spin-button,
input[type="number"].input-inline::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"].input-inline {
  -moz-appearance: textfield;
}

.plat-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}
.modal-evidencia {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
}

.modal-evidencia img {
  max-width: 260px;
  max-height: 200px;
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #eee;
}

.resumen-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.resumen-row .label {
  font-weight: 700;
}

.resumen-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resumen-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resumen-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.resumen-checks label {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-primary:hover {
  background: #333;
}

.admin-actions {
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin: 16px 0;
  align-items: center;
  flex-wrap: wrap;
}

.admin-group {
  background: #e9e9e9;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #dcdcdc;
  width: 100%;
  max-width: 900px;
}

.admin-action {
  width: 200px;
  align-self: center;
  margin: 0;
}
.admin-actions.single {
  justify-content: center;
}
.admin-action-full {
  width: 100%;
  max-width: 480px;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}
.admin-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.admin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.admin-card.reportes {
  background: #ff716f;
  border-color: #ff716f;
  color: #fff;
}
.admin-card.cortes {
  background: #ffa770;
  border-color: #ffa770;
  color: #fff;
}
.admin-card.pedidos {
  background: #77b687;
  border-color: #77b687;
  color: #fff;
}
.admin-card .card-title {
  margin: 0;
  font-weight: 700;
  font-size: 15px;
}
.admin-card .card-count {
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0;
}
.admin-card .card-desc {
  margin: 4px 0 0;
  color: #555;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 20px;
  max-width: 720px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 3001;
}

.modal-card-resumen {
  max-width: 520px;
  width: 95%;
}

.modal-card-sol {
  max-width: 520px;
  width: 95%;
}

.modal-card-renovar {
  max-width: 300px;
  width: 90%;
}

.modal-renovar-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-close {
  position: absolute;
  top: 4px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  background: #eef2f6;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  overflow-y: auto;
}

/* Asegura que el contenido del modal se ajuste al ancho del modal */
#platform-modal * {
  box-sizing: border-box;
}

#platform-modal .modal-body,
#platform-modal .modal-media,
#platform-modal .modal-media-wrap,
#platform-modal .modal-top,
#platform-modal .modal-banner-meta,
#platform-modal .modal-bottom,
#platform-modal .modal-info,
#platform-modal .modal-scroll {
  width: 100%;
  max-width: 100%;
}

#platform-modal .modal-scroll-hint {
  display: none;
}

.modal-plan-hint {
  display: block;
  margin: 6px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #f29aa0;
  text-transform: none;
}

.modal-title-mobile {
  display: none;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  text-align: left;
}

#platform-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
  padding-top: 36px;
}

#platform-modal .modal-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

#platform-modal .modal-info {
  display: flex;
  flex-direction: column;
}

#platform-modal .modal-media-wrap {
  align-self: start;
}

#platform-modal .modal-info {
  align-self: start;
}

#platform-modal .modal-media-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-mobile-header {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  margin: 0 0 2px;
}

#platform-modal .modal-banner-meta {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  margin-top: 0;
  padding: 0;
}

#platform-modal .modal-banner-meta .modal-badge {
  width: 100%;
  display: block;
  text-align: center;
  margin: 0;
}

#platform-modal .modal-banner-meta h3 {
  margin: 0;
}

.modal-name-mobile {
  display: none;
  margin: 0;
}

.modal-category-mobile {
  display: none;
  margin: 0;
}

#platform-modal .modal-bottom {
  background: #eef2f6;
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #1f2933;
  align-items: center;
}

#platform-modal .modal-bottom .modal-qty,
#platform-modal .modal-bottom .modal-total,
#platform-modal .modal-bottom #add-cart {
  width: 100%;
  max-width: 320px;
}

#platform-modal .modal-bottom .modal-qty {
  margin: 0 auto;
  border-color: #cbd5e1;
  color: #1f2933;
  justify-content: center;
  text-align: center;
}

#platform-modal .modal-bottom .modal-duration-label,
#platform-modal .modal-bottom .modal-duration-suffix {
  color: #4b5563;
}

#platform-modal .modal-bottom .modal-qty button {
  background: #d5dde6;
  color: #1f2933;
}

#platform-modal .modal-bottom .modal-qty button:hover {
  background: #c7d0db;
}

#platform-modal .modal-bottom .modal-total {
  margin: 4px 0 0;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

#platform-modal .modal-bottom #add-cart {
  margin-top: 4px;
  margin-left: auto;
  margin-right: auto;
  background: #1f2933;
  color: #f8fafc;
}

#platform-modal .modal-bottom #add-cart:hover {
  background: #111827;
}

/* Mueve el scrollbar al borde del modal (evita scrollbar interno en modal-body) */
#platform-modal .modal-card {
  overflow: hidden;
  scrollbar-gutter: stable;
}

#platform-modal .modal-scroll {
  overflow-y: auto;
  padding-right: 12px;
  margin-right: -12px;
}

/* For single-column layout in renovar row modal */
#modal-renovar-row .modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
}
#modal-renovar-row .modal-footer {
  padding-left: 0;
}
#modal-renovar-row .modal-card {
  width: auto;
  max-width: 520px;
  align-items: flex-start;
}

/* For single-column layout in renovar modal */
#modal-renovar .modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

#modal-renovar .modal-card {
  width: auto;
  max-width: 520px;
}

/* Resumen de cambios: forzar layout vertical */
.modal-body.resumen-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.modal-media {
  background: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  flex: 1;
}

.modal-info h3 {
  margin: 0 0 6px;
}

.modal-category {
  margin: 0 0 12px;
  color: #666;
}

.modal-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: 700;
  margin: 4px 0;
}

.modal-badge-mobile {
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1.1;
}

.badge-green {
  background: #d6f5d8;
  color: #1b7a1f;
  border: 1px solid #9adba0;
}

.badge-warning {
  background: #fff4cc;
  color: #8a6a00;
  border: 1px solid #f3d27a;
}

.badge-gray {
  background: #f0f0f0;
  color: #555;
  border: 1px solid #d6d6d6;
}

@media (max-width: 640px) {
  /* Botón del modal en mobile: ancho completo al final */
  #platform-modal .modal-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  #platform-modal #add-cart {
    width: 100%;
    align-self: stretch;
    margin-top: 6px;
  }

  .plan-price-line {
    margin-top: 0;
  }
}

.modal-precios {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.plan-bloque {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#platform-modal .plan-bloque {
  background: #eef2f6;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.plan-titulo {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  color: #636f87;
  line-height: 1.1;
}

.plan-name {
  display: inline-flex;
  align-items: center;
  line-height: 1.1;
}
.plan-titulo .stock-line {
  font-weight: 400;
  color: #9ca3af;
  display: block;
  margin-top: 2px;
}
.plan-titulo .stock-subtitle {
  font-weight: 700;
}

.plan-price-line {
  font-weight: 700;
  font-size: 20px;
  margin-top: 0;
  display: block;
  color: #303238;
  line-height: 1.1;
}

#platform-modal .plan-bloque.selected {
  background: #3c3e44;
  color: #fff;
}

#platform-modal .plan-bloque.selected .plan-titulo,
#platform-modal .plan-bloque.selected .stock-line,
#platform-modal .plan-bloque.selected .plan-price-line,
#platform-modal .plan-bloque.selected .plan-name {
  color: #fff;
}

.plan-info-wrap {
  position: static;
  display: inline-flex;
  align-items: center;
}

.plan-info-icon {
  display: inline-flex;
  margin-left: 6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #d1d5db;
  color: #2f343a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.plan-info-icon:hover {
  background: #d1d5db;
}

.plan-bloque {
  position: relative;
}

.plan-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 280px;
  max-width: 80vw;
  background: #3c4048;
  color: #f9fafb;
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  display: none;
  z-index: 2;
}

.plan-tooltip.is-visible {
  display: block;
}

.plan-opciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.precio-region {
  margin: 0;
  font-size: 13px;
  color: #555;
  width: 100%;
}

.precio-opcion {
  padding: 8px 10px;
  border: 1px solid #2f2f2f;
  border-radius: 10px;
  background: #2f2f2f;
  color: #f8fafc;
  cursor: pointer;
  font-weight: 700;
}

.precio-opcion.selected {
  border-color: #3c3c3c;
  background: #656565;
  color: #fff;
}

.precio-opcion:active {
  background: #656565;
  border-color: #3c3c3c;
  color: #fff;
}

.precio-opcion.selected:active {
  background: #656565;
  border-color: #3c3c3c;
  color: #fff;
}

.modal-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px 10px;
}

.modal-qty.modal-qty-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.modal-duration-label,
.modal-duration-suffix {
  font-weight: 700;
  font-size: 13px;
}

.modal-qty.hidden {
  display: none;
}

.discount-badge {
  display: inline-block;
  background: #1b7a1f;
  color: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 12px;
  margin-left: auto;
}

.discount-badge.is-zero {
  background: #9ca3af;
  color: #111827;
}

.flying-price {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-qty button {
  width: 28px;
  height: 28px;
  border: none;
  background: #111;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.modal-qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}

.modal-total {
  margin: 4px 0 6px;
  font-weight: 700;
  font-size: 14px;
  color: #111;
}

/* Próximas a vencer */
.proximas-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}

.proximas-header {
  font-weight: 600;
  margin-bottom: 8px;
}

.proximas-bloque + .proximas-bloque {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.proximas-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.proximas-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 720px;
}

.proximas-table td {
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  word-break: break-word;
}
.proximas-table th {
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  text-align: left;
  word-break: break-word;
}

/* Ancho por defecto (modal proximas en inventario) */
.proximas-table td:nth-child(1),
.proximas-table th:nth-child(1) {
  width: 70px;
}
.proximas-table td:nth-child(2),
.proximas-table th:nth-child(2) {
  width: 200px;
}
.proximas-table td:nth-child(3),
.proximas-table th:nth-child(3) {
  width: 20px;
}

/* Anchos específicos para el panel de resultados en renovar_cliente */
#buscador-resultado {
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  padding: 8px 10px;
  box-sizing: border-box;
}
#buscador-resultado .proximas-table {
  margin: 0;
  table-layout: auto;
  min-width: 640px;
}
#buscador-resultado .proximas-table th,
#buscador-resultado .proximas-table td {
  padding: 6px 6px;
  font-size: 13px;
}
#buscador-resultado .proximas-table td:nth-child(1),
#buscador-resultado .proximas-table th:nth-child(1) {
  min-width: 52px;
}
#buscador-resultado .proximas-table td:nth-child(2),
#buscador-resultado .proximas-table th:nth-child(2) {
  min-width: 110px;
}
#buscador-resultado .proximas-table td:nth-child(3),
#buscador-resultado .proximas-table th:nth-child(3) {
  min-width: 160px;
}
#buscador-resultado .proximas-table td:nth-child(4),
#buscador-resultado .proximas-table th:nth-child(4) {
  min-width: 120px;
}
#buscador-resultado .proximas-table td:nth-child(5),
#buscador-resultado .proximas-table th:nth-child(5) {
  min-width: 120px;
}

.modal-card-proximas {
  max-width: 720px;
  width: 95%;
}

.table-base {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
}

.table-base th,
.table-base td {
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 3px 10px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  height: 30px;
  white-space: nowrap;
  overflow: hidden;
}
.table-base th {
  background: var(--table-header-bg, #2c2f36);
  color: #fff;
  padding: 5px 10px;
  font-size: 17px;
  font-weight: 800;
}
.table-base tbody tr:nth-child(odd) {
  background: #eef1f5;
}
.table-base tbody tr:nth-child(even) {
  background: #ffffff;
}

.table-base td[style*="display:flex"] {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.table-base td .btn-outline,
.table-base td .btn-primary,
.table-base td .btn-delete,
.table-base td .btn-copy,
.table-base td .btn-delete-venta {
  max-width: 100%;
}

/* Contenedor de tablas (datos de cuentas) */
.cuenta-table-wrap {
  overflow-x: auto;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
}

.modal-card-renovar-sel {
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-renovar-sel-body {
  display: block;
}

#modal-renovar-sel .proximas-table {
  width: 100%;
  table-layout: fixed;
}

.modal-proximas-body {
  display: block;
  width: 100%;
}

.modal-proximas-title {
  margin-top: 0;
}

.proximas-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proximas-table-wrap {
  flex: 1;
  overflow-x: auto;
}

.proximas-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proximas-footnote {
  margin: 0;
  font-size: 13px;
  color: #555;
}

.buscador-actions {
  margin-top: 10px;
}

.input-disabled {
  background: #f1f1f1;
  color: #888;
}

.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-add {
  display: inline-block;
  padding: 10px 16px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.btn-add:hover {
  background: #333;
}

/* CATEGORÍAS */
.categorias-dinamicas {
  margin: 0 20px 20px;
  padding-top: 12px;
}

.categoria-card {
  margin-top: 20px;
}

.categorias-dinamicas > .categoria-card:first-child {
  margin-top: 0;
}

.testing-toggle-wrap {
  display: flex;
  justify-content: flex-start;
  padding: 0 20px 10px;
}

.missing-data-wrap {
  display: flex;
  justify-content: center;
  padding: 0 20px 12px;
}

.missing-data-wrap.hidden {
  display: none;
}

.missing-data-wrap .btn-outline {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 700;
}

.missing-data-wrap .btn-outline:hover {
  background: #fde68a;
}

.testing-toggle-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  background: #f97316;
  color: #fff;
}

.testing-toggle-btn.testing-off {
  background: #16a34a;
}

.categorias-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 0;
}

.categoria-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.categoria-card h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
}

/* Refuerzo para evitar sobrescrituras externas */
.categorias-dinamicas .categoria-card h3 {
  font-size: 22px !important;
  font-weight: 700 !important;
}

.plataformas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.plataforma-card {
  background: #f8f8f8;
  border-radius: 10px;
  padding: 10px;
  text-align: left;
}

.plataforma-thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: transparent;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
}

.plataforma-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.plataforma-nombre {
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  color: #111827;
}

.categorias-dinamicas .plataforma-nombre {
  font-size: 18px !important;
  font-weight: 600 !important;
}

.plataforma-precio {
  font-size: 13px;
  color: #374151;
  text-align: left;
  margin-top: 4px;
}

.plataforma-precio sup {
  font-size: 0.75em;
  vertical-align: baseline;
  position: relative;
  top: -0.25em;
}

.sin-plataformas {
  color: #777;
  margin: 0;
  font-size: 14px;
}

.status {
  color: #555;
  font-size: 14px;
  margin: 8px 0;
}

#categorias-status:empty {
  display: none;
}

.tasa-actual {
  font-weight: 700;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, #e6ecff, transparent 35%),
    radial-gradient(circle at 80% 0%, #ffe5f0, transparent 30%),
    linear-gradient(180deg, #f9fafc 0%, #eef1f7 100%);
}

.auth-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid #f0f0f0;
}

.auth-logo {
  width: 80px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: brightness(0);
}

.auth-title {
  margin: 0;
  font-size: 26px;
}

.auth-subtitle {
  margin: 6px 0 20px;
  color: #555;
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  align-items: flex-start;
}

.form-label.required::after {
  content: " *";
  color: #dc2626;
  font-weight: 700;
}

.auth-form .form-input,
.auth-form .input-with-toggle {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.auth-submit {
  margin-top: 6px;
  align-self: center;
}

.auth-secondary {
  margin-top: 12px;
}

.input-message {
  display: none;
  margin: 0;
  color: #c0392b;
  font-size: 13px;
}

.input-message:not(:empty) {
  display: block;
  margin: 4px 0 10px;
}

.input-message a {
  color: inherit;
  text-decoration: underline;
  font-weight: 700;
}

.status-message {
  text-align: center;
  color: #2c3e50;
}

.status-message.is-error {
  color: #c0392b;
}

.status-message.is-success {
  color: #1e8449;
}

.link-inline {
  color: inherit;
  text-decoration: underline;
}

.input-with-toggle {
  position: relative;
}

.input-with-toggle .form-input {
  padding-right: 42px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: color 0.15s ease;
}

.toggle-password:hover {
  background: transparent;
  color: #111;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.toggle-password .icon-closed {
  display: none;
}

.toggle-password.is-hidden .icon-open {
  display: none;
}

.toggle-password.is-hidden .icon-closed {
  display: block;
}

.ocupado-reemplazo {
  background: #ffeaea;
  color: #b91c1c;
  font-weight: 600;
}

.toggle-text {
  margin-left: 8px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 700px) {
  /* Quitar cajas de categorías en móvil */
  .categoria-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .categorias-dinamicas > .categoria-card + .categoria-card {
    margin-top: 12px;
  }

  .modal-card {
    max-width: 420px;
    width: 80%;
    padding: 16px;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  #platform-modal .modal-card {
    height: auto;
    max-height: 92vh;
  }

  #platform-modal .modal-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    gap: 5px;
    padding-top: 24px;
  }

  #platform-modal .modal-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    position: relative;
  }

  #platform-modal .modal-top::after {
    content: "";
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    margin-top: -20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff);
    pointer-events: none;
  }

  #platform-modal .modal-scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%) translateY(6px);
    background: rgba(17, 24, 39, 0.85);
    color: #f9fafb;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    letter-spacing: 0.2px;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s ease;
    pointer-events: none;
    z-index: 2;
  }

  #platform-modal .modal-scroll-hint.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  #platform-modal .modal-scroll-hint {
    display: block;
  }

  #platform-modal .modal-top::-webkit-scrollbar {
    width: 6px;
  }

  #platform-modal .modal-top::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
  }

  #platform-modal .modal-top::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
  }

  #platform-modal .modal-media {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 825 / 414;
    min-height: 138px;
    width: 100%;
    background: #f3f4f6;
  }

  #platform-modal .modal-media img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
  }

  #platform-modal .modal-media-wrap {
    gap: 2px !important;
  }

  #platform-modal .modal-banner-meta {
    gap: 0 !important;
    margin: 3px 0 0 !important;
    padding: 0 !important;
    min-height: 0;
    height: auto;
  }

  #platform-modal .modal-banner-meta .modal-badge {
    padding: 2px 6px;
    line-height: 1;
    font-size: 13px;
  }

  #platform-modal .modal-info {
    display: flex;
    flex-direction: column;
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
  }

  #platform-modal .modal-header {
    display: none;
  }

  .modal-mobile-header {
    display: none;
  }

  .modal-name-mobile {
    display: none;
  }

  .modal-category-mobile {
    display: none;
  }

  #platform-modal .modal-info .modal-header h3 {
    display: none;
  }

  #platform-modal .modal-info .modal-category {
    display: none;
  }

  #platform-modal .modal-info .modal-title {
    display: none;
  }

  #platform-modal .modal-banner-meta {
    display: flex;
  }

  .modal-title-mobile {
    display: none;
  }

  #platform-modal .plan-bloque {
    background: #eef2f6;
    border-radius: 10px;
    padding: 8px 10px;
  }

  .plan-info-icon {
    display: inline-flex;
  }

  #platform-modal .modal-scroll {
    flex: 1 1 auto;
    overflow: visible;
    padding-right: 0;
    margin-right: 0;
  }

  #platform-modal .modal-bottom {
    margin: 4px 0 0;
    padding: 12px;
    border-radius: 12px;
    align-self: center;
  }

  #platform-modal .modal-close:hover {
    background: #eef2f6;
    border-radius: 999px;
  }
}

.btn-alert {
  background: #dc2626;
  color: #fff;
  border: none;
}

.btn-entregar {
  background: #16a34a;
  color: #fff;
  border: none;
}
