/**
 * FlowForge – Player Base CSS
 * Layout and container only. All visual theming is in /themes/*.css
 * Themes are loaded dynamically by flow-player.js based on flow meta.
 */

/* ── Container wrapper ────────────────────────────────────────────────────── */

.flowforge-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

/* Fallback background — overridden by each theme */
.flowforge-container.flowforge-embed {
  min-height: 40px;
}

/* ── Shortcode error ──────────────────────────────────────────────────────── */

.ff-sc-error {
  padding: 12px 16px;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  color: #e53e3e;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Loading state (before theme CSS arrives) ─────────────────────────────── */

.flowforge-container .ff-player-loading {
  text-align: center;
  padding: 48px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  color: #888;
}

/* ── WooCommerce product grid (layout only) ───────────────────────────────── */

.flowforge-container .ff-products-wrap { margin-top: 28px; }

.flowforge-container .ff-products-loading,
.flowforge-container .ff-products-empty {
  text-align: center;
  font-size: 14px;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #888;
}

.flowforge-container .ff-products-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.flowforge-container .ff-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.flowforge-container .ff-product-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.flowforge-container .ff-product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.flowforge-container .ff-product-img-link { display: block; }
.flowforge-container .ff-product-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f3f4f6; }
.flowforge-container .ff-product-body { padding: 12px 14px; flex: 1; }
.flowforge-container .ff-product-name { font-size: 14px; font-weight: 600; margin: 0 0 4px; line-height: 1.3; font-family: inherit; }
.flowforge-container .ff-product-name a { color: inherit; text-decoration: none; }
.flowforge-container .ff-product-name a:hover { text-decoration: underline; }
.flowforge-container .ff-product-desc { font-size: 12px; color: #6b7280; margin: 0 0 8px; line-height: 1.4; }
.flowforge-container .ff-product-price { font-size: 15px; font-weight: 700; color: #6c47ff; }
.flowforge-container .ff-product-price ins { text-decoration: none; }
.flowforge-container .ff-product-price del { color: #9ca3af; font-weight: 400; font-size: 12px; margin-right: 4px; }
.flowforge-container .ff-product-actions { padding: 10px 14px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.flowforge-container .ff-btn-cart {
  background: #6c47ff; color: #fff; flex: 1; text-align: center;
  border-radius: 7px; padding: 9px 12px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background 0.2s; white-space: nowrap; cursor: pointer; border: none; font-family: inherit;
}
.flowforge-container .ff-btn-cart:hover { background: #7d5cff; }
.flowforge-container .ff-btn-view {
  background: transparent; color: #6c47ff; border: 1px solid #6c47ff;
  border-radius: 7px; padding: 9px 12px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all 0.2s; white-space: nowrap; font-family: inherit;
}
.flowforge-container .ff-btn-view:hover { background: #6c47ff; color: #fff; }
.flowforge-container .ff-out-of-stock { font-size: 12px; color: #9ca3af; font-style: italic; align-self: center; }

/* Add to Cart button states */
.flowforge-container .ff-atc-btn { cursor: pointer; font-family: inherit; transition: background 0.2s, transform 0.1s; }
.flowforge-container .ff-atc-btn:disabled { cursor: default; opacity: 0.85; }
.flowforge-container .ff-atc-btn:not(:disabled):hover { transform: translateY(-1px); }
.flowforge-container .ff-atc-spinner { animation: ff-spin 0.8s linear infinite; display: inline-block; }
@keyframes ff-spin { to { transform: rotate(360deg); } }

/* ── Option card: has() fallback ──────────────────────────────────────────── */
.flowforge-container .ff-option-card.selected { outline: 2px solid #6c47ff; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .flowforge-container .ff-products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .flowforge-container .ff-product-actions { flex-direction: column; }
}

/* ── Progress bar components (all types) ─────────────────────────────────── */

/* Legacy .ff-progress still supported for built-in themes */
.flowforge-container .ff-progress {
  height: 4px; background: #e2e0f0; border-radius: 4px;
  overflow: hidden; margin-bottom: 28px;
}
.flowforge-container .ff-progress-bar {
  height: 100%; background: #6c47ff; border-radius: 4px;
  transition: width 0.45s cubic-bezier(0.25,1,0.5,1);
}

/* New component-aware wrappers */
.flowforge-container .ff-progress-wrap { margin-bottom: 28px; }

.flowforge-container .ff-progress-linear {
  height: 4px; background: #e2e0f0; border-radius: 4px; overflow: hidden;
}

.flowforge-container .ff-progress-steps {
  display: flex; align-items: center; gap: 8px;
}
.flowforge-container .ff-progress-step {
  width: 10px; height: 10px; border-radius: 50%;
  background: #e2e0f0; transition: background 0.3s; flex-shrink: 0;
}
.flowforge-container .ff-progress-step.active { background: #6c47ff; }
.flowforge-container .ff-progress-step.done   { background: #6c47ff; opacity: 0.5; }

.flowforge-container .ff-progress-dots {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.flowforge-container .ff-progress-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #e2e0f0; transition: all 0.3s;
}
.flowforge-container .ff-progress-dot.active { background: #6c47ff; transform: scale(1.3); }
.flowforge-container .ff-progress-dot.done   { background: #6c47ff; opacity: 0.5; }

.flowforge-container .ff-progress-label {
  font-size: 11px; color: #64648a; text-align: right; margin-bottom: 4px;
}
