:root {
  --primary-color: #3498db;
  --primary-color-dark: #2980b9;
  --background-color: #f5f5f5;
  --text-color: #333;
  --card-bg: #fff;
  --border-radius: 5px;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --font-family: 'Open Sans', sans-serif;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family);
  margin: 0;
  padding: 0; /* 🔥 quitar el espacio lateral que causa las líneas blancas */
}

/* Contenedor centrado */
#wcpm-app {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

/* Mensajes */
.wcpm-message {
  display: none;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: var(--border-radius);
  text-align: center;
}
.wcpm-message.success { background: #e3f9e5; color: #2f8f4e; }
.wcpm-message.error   { background: #fdecea; color: #a94442; }

/* Top panels: formulario + dropzone */
.wcpm-top {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.wcpm-panel {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px;
  flex: 1 1 45%;
  min-width: 280px;
}

/* Formularios */
form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
form input,
form select,
form button {
  flex: 1 1 200px;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}
form button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
form button:hover {
  background: var(--primary-color-dark);
}
#wcpm-cancel-edit {
  background: #999;
}
#wcpm-cancel-edit:hover {
  background: #777;
}

/* Dropzone */
.wcpm-dropzone {
  position: relative;
  border: 2px dashed #ccc;
  border-radius: var(--border-radius);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 16px;
  text-align: center;
}
.wcpm-dropzone input[type=file] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Barra de filtros */
#wcpm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
#wcpm-filter-bar select,
#wcpm-filter-bar input,
#wcpm-filter-bar button {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}
#wcpm-filter-bar button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
#wcpm-filter-bar button:hover {
  background: var(--primary-color-dark);
}

/* Inventario: filas */
#wcpm-product-list {
  display: block;
}
.inventory-row {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  margin-bottom: 10px;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}
.inv-col {
  padding: 0 10px;
  font-size: 14px;
  color: var(--text-color);
}
.inv-col--img {
  flex: 0 0 80px;
}
.inv-col--img img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--border-radius);
}
.inv-col--info {
  flex: 2;
}
.inv-col--qty,
.inv-col--price {
  flex: 0 0 80px;
  text-align: center;
}
.inv-col--actions {
  flex: 0 0 160px;
  display: flex;
  gap: 10px;
}
.inv-col--actions button {
  padding: 8px 12px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
}
.inv-col--actions .wcpm-delete {
  background: #e74c3c;
  color: #fff;
}
.inv-col--actions .wcpm-edit {
  background: var(--primary-color);
  color: #fff;
}

/* Lista vacía */
#wcpm-product-list .empty {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 40px 0;
}

/* Paginación */
#wcpm-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}
#wcpm-pagination button {
  padding: 10px 15px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  background: var(--card-bg);
  cursor: pointer;
  transition: background 0.3s;
}
#wcpm-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#wcpm-pagination button:hover:not(:disabled) {
  background: var(--background-color);
}

/* Animación */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Ajustes para evitar distorsión tras mover dropzone dentro del form */
#wcpm-app .wcpm-top .wcpm-panel {
  flex: 1 1 100% !important;
}

#wcpm-app form .wcpm-dropzone {
  flex: 1 1 100%;
  margin: 10px 0;
}

#wcpm-app form {
  gap: 15px;
}

@media (max-width: 600px) {
  #wcpm-app .wcpm-dropzone {
    height: 150px;
  }
}
