/* =================================================================
   Wapu Listas — Pinterest compact style
   ================================================================= */

#wcpl-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0 60px;
  color: #111827;
}

/* ── Page header ── */
.wcpl-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.wcpl-page-title { font-size: 24px !important; font-weight: 700 !important; color: #111827 !important; margin: 0 0 3px !important; }
.wcpl-page-sub   { font-size: 13px !important; color: #6b7280 !important; margin: 0 !important; }
.wcpl-section-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #9ca3af; margin-bottom: 12px; }

/* ── Botones ── */
.wcpl-btn-new {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; background: #111827; color: #fff;
  border: none; border-radius: 50px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.wcpl-btn-new:hover { background: #1f2937; }
.wcpl-btn-primary { padding: 9px 18px; background: #111827; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.wcpl-btn-primary:hover { background: #1f2937; }
.wcpl-btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.wcpl-btn-cancel { padding: 9px 14px; background: transparent; color: #6b7280; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; cursor: pointer; font-family: inherit; }
.wcpl-btn-cancel:hover { background: #f9fafb; }
.wcpl-btn-sec-sm {
  display:inline-flex; align-items:center; gap:5px;
  padding:6px 14px; background:#fff; color:#374151;
  border:1px solid #e5e7eb; border-radius:8px;
  font-size:12px; font-weight:500; cursor:pointer; font-family:inherit;
  transition:all .13s;
}
.wcpl-btn-sec-sm:hover { border-color:#374151; }
.wcpl-btn-edit { padding: 6px 14px; background: #fff; color: #374151; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; }
.wcpl-btn-edit:hover { border-color: #111827; }
.wcpl-btn-edit.active { background: #111827; color: #fff; border-color: #111827; }
.wcpl-btn-danger { padding: 8px 14px; background: #fee2e2; color: #dc2626; border: none; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.wcpl-btn-danger:hover { background: #fecaca; }
.wcpl-btn-danger:disabled { opacity: .4; cursor: not-allowed; }
.wcpl-btn-danger-outline { padding: 8px 14px; background: transparent; color: #dc2626; border: 1px solid #fecaca; border-radius: 8px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; }
.wcpl-btn-danger-outline:hover { background: #fee2e2; }

/* ── Grid de listas (tarjetas) ── */
.wcpl-lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.wcpl-list-card {
  background: #f3f4f6; border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  text-decoration: none !important; display: block;
}
.wcpl-list-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.1); }
.wcpl-list-card-mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 100px 50px; gap: 2px; background: #e5e7eb; overflow: hidden; border-radius: 14px 14px 0 0; }
.wcpl-list-card-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wcpl-mosaic-main { grid-row: 1/3; }
.wcpl-mosaic-empty { background: #f9fafb; display: flex; align-items: center; justify-content: center; color: #d1d5db; font-size: 18px; }
.wcpl-list-card-single { height: 150px; overflow: hidden; border-radius: 14px 14px 0 0; }
.wcpl-list-card-single img { width: 100%; height: 100%; object-fit: cover; }
.wcpl-list-card-empty-img { height: 150px; background: linear-gradient(135deg, #f3f4f6, #e5e7eb); border-radius: 14px 14px 0 0; display: flex; align-items: center; justify-content: center; font-size: 28px; opacity: .35; }
.wcpl-list-card-body { padding: 12px 14px; }
.wcpl-list-card-name { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 2px; }
.wcpl-list-card-count { font-size: 11px; color: #9ca3af; }

/* ── Grid masonry de productos (COMPACTO) ── */
.wcpl-pinterest-grid {
  columns: 5; column-gap: 10px;
}
@media (max-width: 1000px) { .wcpl-pinterest-grid { columns: 4; } }
@media (max-width: 700px)  { .wcpl-pinterest-grid { columns: 3; } }
@media (max-width: 480px)  { .wcpl-pinterest-grid { columns: 2; } }

/* Detalle — menos columnas */
.wcpl-detail-grid { columns: 5; }
@media (max-width: 1000px) { .wcpl-detail-grid { columns: 4; } }
@media (max-width: 700px)  { .wcpl-detail-grid { columns: 3; } }

.wcpl-product-card {
  break-inside: avoid;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: grab;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid #f3f4f6;
}
.wcpl-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.wcpl-product-card.dragging { opacity: .5; cursor: grabbing; }

/* Imagen cuadrada compacta */
.wcpl-product-img-wrap {
  position: relative;
  overflow: hidden;
  background: #f9fafb;
}
.wcpl-product-img-wrap img {
  width: 100%; display: block;
  transition: transform .3s;
  aspect-ratio: 1;
  object-fit: cover;
}
.wcpl-product-card:hover .wcpl-product-img-wrap img { transform: scale(1.05); }

/* Overlay en hover — muestra acciones */
.wcpl-product-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.wcpl-product-card:hover .wcpl-product-overlay { opacity: 1; pointer-events: all; }

.wcpl-overlay-btn {
  width: 34px; height: 34px;
  border-radius: 50%; border: none;
  background: rgba(255,255,255,.95);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all .13s; color: #374151;
  flex-shrink: 0;
  line-height: 1;
}
.wcpl-overlay-btn svg {
  width: 14px; height: 14px;
  display: block; flex-shrink: 0;
  fill: none !important;
  stroke: currentColor;
  pointer-events: none;
}
.wcpl-overlay-btn:hover { background: #fff; transform: scale(1.08); }
.wcpl-overlay-btn.cart { background: #111827; color: #fff; }
.wcpl-overlay-btn.cart svg { stroke: #fff; }
.wcpl-overlay-btn.cart:hover { background: #1f2937; }
.wcpl-overlay-btn.added { background: #059669; color: #fff; }
.wcpl-overlay-btn.added svg { stroke: #fff; }
.wcpl-overlay-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Checkbox selección */
.wcpl-product-checkbox {
  position: absolute; top: 8px; left: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(255,255,255,.9);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: all .13s; z-index: 3; font-size: 11px;
}
.wcpl-product-checkbox.checked { background: #111827; border-color: #111827; color: #fff; }
.wcpl-edit-mode .wcpl-product-checkbox { display: flex; }

.wcpl-sale-badge {
  position: absolute; top: 8px; right: 8px;
  background: #111827; color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 20px; letter-spacing: .04em;
}

/* Título compacto */
.wcpl-product-body { padding: 8px 10px 10px; }
.wcpl-product-name {
  font-size: 11px; font-weight: 500; color: #374151;
  line-height: 1.35; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Detalle de lista ── */
.wcpl-detail-header { margin-bottom: 20px; }
.wcpl-detail-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wcpl-back-link { font-size: 12px; color: #9ca3af !important; text-decoration: none !important; display: flex; align-items: center; gap: 4px; }
.wcpl-back-link:hover { color: #374151 !important; }
.wcpl-detail-title { font-size: 28px !important; font-weight: 800 !important; color: #111827 !important; margin: 0 !important; }

.wcpl-edit-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: #fff; border-radius: 10px;
  border: 1px solid #e5e7eb; margin-bottom: 16px; gap: 8px; flex-wrap: wrap;
}
.wcpl-edit-bar-left { font-size: 12px; color: #6b7280; font-weight: 500; }
.wcpl-edit-bar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.wcpl-detail-empty { text-align: center; padding: 48px 20px; color: #9ca3af; font-size: 13px; }
.wcpl-detail-empty-icon { font-size: 36px; opacity: .2; margin-bottom: 10px; }

/* ── Modal ── */
.wcpl-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.wcpl-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 400px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.wcpl-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #f3f4f6; }
.wcpl-modal-title { font-size: 14px; font-weight: 700; color: #111827; }
.wcpl-modal-close { width: 26px; height: 26px; border-radius: 50%; border: none; background: #f3f4f6; cursor: pointer; font-size: 13px; color: #6b7280; display: flex; align-items: center; justify-content: center; }
.wcpl-modal-close:hover { background: #e5e7eb; }
.wcpl-modal-body { padding: 18px; }
.wcpl-modal-note { font-size: 12px; color: #6b7280; margin-bottom: 12px; }
.wcpl-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #f3f4f6; }

.wcpl-field { margin-bottom: 12px; }
.wcpl-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #9ca3af; margin-bottom: 5px; }
.wcpl-input { width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; font-family: inherit; color: #111827; background: #f9fafb; outline: none; }
.wcpl-input:focus { border-color: #111827; background: #fff; }
.wcpl-textarea { min-height: 64px; resize: vertical; }

.wcpl-move-options { display: flex; flex-direction: column; gap: 5px; }
.wcpl-move-option { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 2px solid #e5e7eb; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: #374151; transition: all .13s; }
.wcpl-move-option:hover { border-color: #111827; }
.wcpl-move-option.selected { border-color: #111827; background: #f9fafb; }

/* ── Popup agregar a lista (desde producto) ── */
.wcpl-list-popup {
  position: absolute; top: 100%; left: 0; z-index: 9999;
  background: #fff; border-radius: 12px; border: 1px solid #e5e7eb;
  box-shadow: 0 12px 40px rgba(0,0,0,.15); min-width: 220px;
  padding: 8px; margin-top: 6px; animation: wcpl-drop .15s ease;
}
@keyframes wcpl-drop { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.wcpl-list-popup-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: #374151; cursor: pointer;
  transition: background .12s;
}
.wcpl-list-popup-item:hover { background: #f3f4f6; }
.wcpl-list-popup-item.in-list { color: #059669; font-weight: 500; }
.wcpl-list-popup-empty { font-size: 12px; color: #9ca3af; padding: 8px 10px; }
.wcpl-list-popup-new { border-top: 1px solid #f3f4f6; margin-top: 4px; padding-top: 4px; color: #7c3aed !important; }

/* Botones del producto */
.wcpl-product-actions { display: flex; gap: 8px; margin-top: 10px; position: relative; flex-wrap: wrap; }
.wcpl-wl-btn { display: inline-flex !important; align-items: center; gap: 5px; font-size: 13px !important; padding: 8px 14px !important; background: #fff !important; border: 1px solid #e5e7eb !important; border-radius: 8px !important; cursor: pointer; transition: all .13s !important; color: #374151 !important; }
.wcpl-wl-btn:hover { border-color: #374151 !important; }
.wcpl-wl-btn.wcpl-wl-active { color: #dc2626 !important; border-color: #fecaca !important; background: #fff5f5 !important; }
.wcpl-add-to-list-btn { display: inline-flex !important; align-items: center; gap: 5px; font-size: 13px !important; padding: 8px 14px !important; background: #fff !important; border: 1px solid #e5e7eb !important; border-radius: 8px !important; cursor: pointer; transition: all .13s !important; color: #374151 !important; }
.wcpl-add-to-list-btn:hover { border-color: #374151 !important; }
.wcpl-add-to-list-btn.wcpl-disabled { opacity: .5; cursor: not-allowed !important; }

/* ── Drop targets ── */
.wcpl-list-card { position: relative; }
.wcpl-list-card-link { text-decoration: none !important; display: block; color: inherit !important; }
.wcpl-drop-hint {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  border-radius: 14px; font-size: 13px; font-weight: 700;
  color: #7c3aed; background: rgba(245,243,255,.92);
  border: 2px dashed #7c3aed;
  pointer-events: none;
  z-index: 10;
}
.wcpl-drop-active .wcpl-drop-hint { display: flex; }
.wcpl-drop-over {
  transform: scale(1.03);
  box-shadow: 0 0 0 3px #7c3aed, 0 12px 32px rgba(124,58,237,.2) !important;
}
.wcpl-drop-over .wcpl-drop-hint {
  background: rgba(124,58,237,.12);
  border-color: #7c3aed;
}
.wcpl-product-card.dragging { opacity: .4; transform: scale(.97); }

/* ── Ver más / colapsar ── */
.wcpl-wl-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 8px;
}
.wcpl-btn-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.wcpl-btn-more:hover { background: #e5e7eb; }

/* ── Dialog modal ── */
.wapu-dialog { max-width: 360px !important; }
.wapu-dialog .wcpl-modal-body { padding: 20px 20px 8px; }
.wapu-dialog-btn { padding: 9px 20px; border-radius: 8px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .13s; }
.wcpl-input-error { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.1) !important; animation: wcpl-shake .3s ease; }
@keyframes wcpl-shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)}
}

/* Misc */
.wcpl-msg { font-size: 12px; margin-top: 6px; min-height: 16px; }
.wcpl-msg.ok  { color: #059669; }
.wcpl-msg.err { color: #dc2626; }
.wcpl-grid-loading { color: #9ca3af; font-size: 13px; padding: 16px 0; }
