/* ════════════════════════════════════════════════════
   SmartCatalogTools v1.1 — Paleta Olimpio Limpieza
   Colores: teal #009b8d | naranja #f5a623 | negro #1a1a1a
   ════════════════════════════════════════════════════ */

:root {
  --sct-primary:      #009b8d;
  --sct-primary-dark: #007a6e;
  --sct-accent:       #f5a623;
  --sct-accent-dark:  #d4891a;
  --sct-success:      #00b894;
  --sct-error:        #e74c3c;
  --sct-radius:       8px;
  --sct-radius-pill:  20px;
  --sct-transition:   0.2s ease;
}

/* ════════════════════════════════════════════════════
   PRECIO TRANSFERENCIA — Listados
   ════════════════════════════════════════════════════ */
.sct-transfer-price {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px auto 4px;
  padding: 5px 14px 6px;
  border-radius: var(--sct-radius-pill);
  background: rgba(0, 155, 141, 0.10);
  text-align: center;
  width: fit-content;
  max-width: 100%;
  line-height: 1.2;
  transition: background var(--sct-transition);
}

.sct-transfer-price:hover {
  background: rgba(0, 155, 141, 0.18);
}

.sct-transfer-price__icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
}

.sct-transfer-price__amount {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.2px;
}

.sct-transfer-price__text {
  font-weight: 600;
  font-size: 0.72rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  width: 100%;
  display: block;
}

/* Centrado completo en miniaturas */
.product-miniature .sct-transfer-price,
.products .sct-transfer-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.product-miniature .sct-transfer-price__amount,
.products .sct-transfer-price__amount {
  display: block;
  text-align: center;
  width: 100%;
}

/* ════════════════════════════════════════════════════
   PRECIO TRANSFERENCIA — Página producto
   ════════════════════════════════════════════════════ */
.sct-transfer-price--product {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 6px;
  padding: 9px 18px;
  border-radius: var(--sct-radius);
  background: rgba(0, 155, 141, 0.07);
  border: 1.5px solid currentColor;
  flex-wrap: wrap;
}

.sct-transfer-price--product .sct-transfer-price__amount {
  font-size: 1.2rem;
  font-weight: 800;
  width: auto;
  display: inline;
}

.sct-transfer-price--product .sct-transfer-price__text {
  font-size: 0.88rem;
  text-transform: none;
  width: auto;
  display: inline;
  text-align: left;
}

/* ════════════════════════════════════════════════════
   SELECTOR DE CANTIDAD
   ════════════════════════════════════════════════════ */
.sct-qty-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 8px;
  user-select: none;
}

.sct-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 36px;
  background: #f0f0f0;
  border: 1.5px solid #ddd;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  transition: background var(--sct-transition), color var(--sct-transition);
  outline: none;
  padding: 0;
  line-height: 1;
}

.sct-qty-btn:first-child {
  border-radius: var(--sct-radius) 0 0 var(--sct-radius);
}

.sct-qty-btn:last-child {
  border-radius: 0 var(--sct-radius) var(--sct-radius) 0;
}

.sct-qty-btn:hover {
  background: var(--sct-primary);
  color: #fff;
  border-color: var(--sct-primary);
}

.sct-qty-btn:active {
  background: var(--sct-primary-dark);
}

.sct-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sct-qty-input {
  width: 44px;
  height: 36px;
  text-align: center;
  border: 1.5px solid #ddd;
  border-left: none;
  border-right: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: #222;
  background: #fff;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
  padding: 0;
}

.sct-qty-input::-webkit-outer-spin-button,
.sct-qty-input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
}

/* ════════════════════════════════════════════════════
   BOTÓN AGREGAR AL CARRITO
   ════════════════════════════════════════════════════ */
.sct-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 14px;
  background: var(--sct-primary);
  color: #fff !important;
  border: none;
  border-radius: var(--sct-radius);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  transition: background var(--sct-transition), transform var(--sct-transition), box-shadow var(--sct-transition);
  outline: none;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.sct-add-btn:hover {
  background: var(--sct-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 155, 141, 0.4);
}

.sct-add-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.sct-add-btn:disabled,
.sct-add-btn.sct-loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.sct-add-btn.sct-success {
  background: var(--sct-success);
}

.sct-add-btn.sct-error {
  background: var(--sct-error);
}

/* Botón "Ver opciones" */
.sct-options-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  color: var(--sct-primary) !important;
  border: 1.5px solid var(--sct-primary);
  border-radius: var(--sct-radius);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  transition: all var(--sct-transition);
  outline: none;
}

.sct-options-btn:hover {
  background: var(--sct-primary);
  color: #fff !important;
}

/* Contenedor acciones */
.sct-catalog-actions {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

/* ════════════════════════════════════════════════════
   POPUP
   ════════════════════════════════════════════════════ */
.sct-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sctFadeIn 0.2s ease;
}

.sct-popup {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
  animation: sctSlideUp 0.25s ease;
  text-align: center;
  border-top: 4px solid var(--sct-primary);
}

.sct-popup__icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.sct-popup__title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0 0 6px;
}

.sct-popup__product {
  font-size: 0.88rem;
  color: #666;
  margin: 0 0 20px;
}

.sct-popup__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.sct-popup__btn {
  padding: 10px 20px;
  border-radius: var(--sct-radius);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: all var(--sct-transition);
  text-decoration: none !important;
}

.sct-popup__btn--continue {
  background: #f0f0f0;
  color: #333 !important;
}

.sct-popup__btn--continue:hover {
  background: #e0e0e0;
}

.sct-popup__btn--cart {
  background: var(--sct-primary);
  color: #fff !important;
}

.sct-popup__btn--cart:hover {
  background: var(--sct-primary-dark);
}

.sct-popup__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
  padding: 4px;
}

.sct-popup__close:hover { color: #333; }

/* Toast */
.sct-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1a1a;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--sct-radius);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 99999;
  animation: sctSlideInRight 0.3s ease;
  max-width: 300px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.sct-toast--success { border-left: 4px solid var(--sct-success); }
.sct-toast--error   { border-left: 4px solid var(--sct-error); }

/* ════════════════════════════════════════════════════
   ANIMACIONES
   ════════════════════════════════════════════════════ */
@keyframes sctFadeIn   { from { opacity:0 } to { opacity:1 } }
@keyframes sctSlideUp  { from { opacity:0; transform:translateY(20px) } to { opacity:1; transform:translateY(0) } }
@keyframes sctSlideInRight { from { opacity:0; transform:translateX(40px) } to { opacity:1; transform:translateX(0) } }
@keyframes sctSpin     { to { transform:rotate(360deg) } }

.sct-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sctSpin 0.7s linear infinite;
  display: inline-block;
}

/* ════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sct-catalog-actions { padding: 6px 8px 8px; }
  .sct-add-btn, .sct-options-btn { font-size: 0.82rem; padding: 8px 10px; }
  .sct-qty-btn  { width: 30px; height: 32px; }
  .sct-qty-input { width: 38px; height: 32px; }
  .sct-toast { bottom:12px; right:12px; left:12px; max-width:none; }
}

/* ════════════════════════════════════════════════════
   DARK THEME
   ════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  .sct-qty-btn   { background:#2a2a2a; border-color:#444; color:#eee; }
  .sct-qty-input { background:#1a1a1a; border-color:#444; color:#eee; }
  .sct-transfer-price { background: rgba(0,155,141,0.15); }
  .sct-popup { background:#1e1e1e; }
  .sct-popup__title { color:#f0f0f0; }
  .sct-popup__product { color:#aaa; }
  .sct-popup__btn--continue { background:#333; color:#eee !important; }
}

/* ── Login link (usuarios no logueados) ─────────────────── */
.sct-catalog-actions {
  position: relative;
  z-index: 2;
}

.sct-login-link {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #888;
  text-decoration: none;
  padding: 4px 8px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  transition: color 0.2s, border-color 0.2s;
  margin-top: 4px;
  margin-bottom: 2px;
  line-height: 1.4;
  cursor: pointer;
}

.sct-login-link:hover {
  color: #333;
  border-color: #888;
  text-decoration: none;
}

.sct-login-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Asegurar que el overlay del tema (quickview) no tape el link */
.product-miniature:hover .sct-catalog-actions,
.product-miniature:hover .sct-login-link {
  z-index: 10;
  pointer-events: auto;
}
