/* ========== TABLA ========== */
.tabla-autos {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
}

.tabla-autos thead {
  background-color: var(--input-bg);
}

.tabla-autos th,
.tabla-autos td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--input-border);
  vertical-align: middle;
}

.tabla-autos th {
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  font-size: 0.85rem;
}

.tabla-autos td img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

.tabla-autos td button {
  font-size: 0.9rem;
  margin-right: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.tabla-autos td:last-child {
  white-space: nowrap;
}

/* ========== MODAL ========== */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7); /* más oscuro para foco */
  backdrop-filter: blur(4px); /* difumina fondo */
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.modal-contenido {
  background-color: var(--card-bg);
  color: var(--text-color);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  animation: modalFadeIn 0.3s ease-out;
  border: 1px solid var(--input-border);
}

.modal-contenido-inner {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-contenido-inner label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 14px;
  color: var(--text-color);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--input-border);
  background-color: var(--card-bg);
  text-align: right;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cerrar-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 22px;
  font-weight: bold;
  color: var(--text-color);
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cerrar-modal:hover {
  transform: scale(1.2);
}

/* Títulos y campos */
.modal-contenido h3 {
  margin: 0 0 20px;
  font-size: 1.4rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-contenido input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.95rem;
  border: none;
  border-bottom: 1px solid var(--input-border);
  background-color: transparent;
  color: var(--text-color);
  transition: border-color 0.2s ease;
  outline: none;
  margin-top: 4px;
}

.modal-contenido input:focus {
  border-bottom-color: var(--primary-color);
}

.modal-contenido input:disabled {
  opacity: 0.6;
  border-bottom-style: dashed;
}

/* ========== CARRUSEL ========== */
.carrusel-wrapper {
  position: relative;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #000;
}

.carrusel-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carrusel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s ease;
}

.carrusel-btn:hover {
  background-color: rgba(0, 0, 0, 0.75);
}

.carrusel-btn.prev { left: 8px; }
.carrusel-btn.next { right: 8px; }

.carrusel-contador {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
  z-index: 5;
  pointer-events: none;
}

/* ========== BOTONES ========== */
.btn-editar,
.btn-guardar,
.btn-publicar {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-editar {
  background-color: var(--primary-color);
  color: white;
}

.btn-guardar {
  background-color: #2ecc71;
  color: white;
}

.btn-publicar {
  background-color: var(--primary-color);
  color: white;
}

.btn-publicar:hover {
  background-color: var(--primary-hover);
}

.modal-contenido .btn-guardar {
  position: sticky;
  bottom: 0;
}

/* ========== FORMULARIO ========== */
.form-publicar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

.form-publicar-grid input,
.form-publicar-grid select {
  padding: 10px;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-color);
  transition: border-color 0.2s ease;
}

.label-subida {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 12px;
  transition: background-color 0.3s ease;
}

.label-subida:hover {
  background-color: var(--primary-hover);
}

/* ========== PREVIEW DE IMÁGENES ========== */
.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  cursor: grab;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
}

/* ========== MISC ========== */
.form-submit {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mensaje-publicacion {
  font-weight: 500;
  color: var(--primary-color);
  margin-top: 10px;
}
.tabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background-color: var(--input-bg);
  color: var(--text-color);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.tab-btn:hover {
  background-color: var(--primary-hover);
  color: white;
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: bold;
}
.tab-content {
  transition: opacity 0.3s ease;
}
.tabs-panel {
  border-radius: 12px;
  background-color: var(--card-bg);
  padding: 20px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.08);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}
/* ========== REPUTACIÓN ========== */
#reputacionPanel {
  margin-top: 20px;
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  font-size: 0.95rem;
  color: var(--text-color);
}

#reputacionPanel h4 {
  margin-bottom: 12px;
  font-size: 1.1rem;
  color: var(--primary-color);
}

#reputacionPanel ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#reputacionPanel li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--input-border);
}

#reputacionPanel li:last-child {
  border-bottom: none;
}

#reputacionPanel .estrella {
  color: gold;
  font-size: 1.1rem;
}
/* ========== ESTADÍSTICAS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stat-card {
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  text-align: center;
  color: var(--text-color);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary-color);
}

.stat-card p {
  margin: 10px 0 0;
  font-size: 1.6rem;
  font-weight: bold;
}
/* ========== SUBHEADER DE FRANQUICIA ========== */
#franquiciaEncabezado {
  background-color: var(--card-bg);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--input-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

#franquiciaEncabezado img {
  height: 44px;
  width: 44px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
  display: block;
}

#franquiciaEncabezado h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--primary-color);
  font-weight: 600;
}

#franquiciaEncabezado p {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--text-color);
}
/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: var(--card-bg);
  color: var(--text-color);
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-10px);
  animation: toastFadeIn 0.3s ease forwards;
}

.toast.success {
  border-left: 4px solid #4caf50;
}

.toast.error {
  border-left: 4px solid #f44336;
}

.toast.info {
  border-left: 4px solid #2196f3;
}

@keyframes toastFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ========== TEXTAREA DE PERFIL ========== */
#perfilDescripcion {
  padding: 10px;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-color);
  resize: vertical;
  transition: border-color 0.2s ease;
  font-family: inherit;
  min-height: 100px;
}

#perfilDescripcion:focus {
  border-color: var(--primary-color);
  outline: none;
}
.btn-panel {
  background-color: white;
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-panel:hover {
  background-color: #e3f2fd;
}
#editDescripcion {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-color);
}
#franquiciaEncabezado:hover {
  background-color: var(--input-bg);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
#franquiciaEncabezado {
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}
.vendido-label {
  font-weight: bold;
  color: green;
}

.preview-item {
  position: relative;
  display: inline-block;
  margin: 4px;
}

.preview-item img {
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
}

.preview-item .delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: red;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
}
