/**
 * DataFirefly Marketplace - Front styles.
 * Scoped under .df-* wrappers so nothing leaks into the host theme.
 * Inherits the theme typography; adds a refined SaaS layer + DataFirefly accent.
 */

:root {
  --dfmp-accent: #f59e0b;
  --dfmp-accent-dark: #d97706;
  --dfmp-ink: #1f2937;
  --dfmp-muted: #6b7280;
  --dfmp-line: #e7e9ee;
  --dfmp-surface: #ffffff;
  --dfmp-bg: #f6f7f9;
  --dfmp-radius: 14px;
  --dfmp-radius-sm: 10px;
  --dfmp-shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.18);
}

/* ---------- shared scaffolding ---------- */
.df-dashboard,
.df-products,
.df-storefront,
.df-directory,
.df-p2b,
.df-register { color: var(--dfmp-ink); }

.df-dashboard h2,
.df-products h2,
.df-products h3,
.df-storefront h2,
.df-directory h1,
.df-p2b h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--dfmp-line);
}

.df-card,
.df-dashboard section:not(.df-kpis),
.df-products .df-card {
  background: var(--dfmp-surface);
  border: 1px solid var(--dfmp-line);
  border-radius: var(--dfmp-radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--dfmp-shadow);
}

/* ---------- buttons ---------- */
.df-dashboard .btn,
.df-products .btn,
.df-storefront .btn,
.df-directory .btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .01em;
  padding: .55rem 1.25rem;
  border: 1px solid transparent;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
}
.df-dashboard .btn:active,
.df-products .btn:active { transform: translateY(1px); }

.df-btn-primary,
.df-dashboard .btn-primary,
.df-products .btn-primary,
.df-storefront .btn-primary {
  background: var(--dfmp-accent);
  border-color: var(--dfmp-accent);
  color: #1a1205;
  box-shadow: 0 6px 16px -8px var(--dfmp-accent-dark);
}
.df-dashboard .btn-primary:hover,
.df-products .btn-primary:hover,
.df-storefront .btn-primary:hover {
  background: var(--dfmp-accent-dark);
  border-color: var(--dfmp-accent-dark);
  color: #fff;
}
.df-dashboard .btn-secondary,
.df-products .btn-secondary {
  background: #fff;
  border-color: var(--dfmp-line);
  color: var(--dfmp-ink);
}
.df-dashboard .btn-secondary:hover,
.df-products .btn-secondary:hover { border-color: var(--dfmp-accent); color: var(--dfmp-accent-dark); }
.df-btn-sm, .btn-sm { padding: .3rem .7rem !important; font-size: .8rem; }

/* ---------- dashboard nav ---------- */
.df-dash-nav { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.5rem; }

/* ---------- KPI cards ---------- */
.df-kpis { margin: 0 0 1.5rem; }
.df-kpi {
  background: linear-gradient(180deg, #fff, #fbfbfc);
  border: 1px solid var(--dfmp-line);
  border-radius: var(--dfmp-radius-sm);
  padding: 1.1rem 1rem;
  text-align: center;
  height: 100%;
  box-shadow: var(--dfmp-shadow);
}
.df-kpi span {
  display: block; font-size: .72rem; color: var(--dfmp-muted);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.df-kpi strong { font-size: 1.5rem; display: block; margin-top: .35rem; color: var(--dfmp-ink); }

/* ---------- tables ---------- */
.df-dashboard table,
.df-products table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 0;
  font-size: .92rem;
}
.df-dashboard table thead th,
.df-products table thead th {
  text-align: left; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--dfmp-muted); font-weight: 700;
  padding: .6rem .75rem; border-bottom: 2px solid var(--dfmp-line); background: transparent;
}
.df-dashboard table tbody td,
.df-products table tbody td {
  padding: .8rem .75rem; border-bottom: 1px solid var(--dfmp-line); vertical-align: middle;
}
.df-dashboard table tbody tr:hover,
.df-products table tbody tr:hover { background: #fcfcfd; }

/* ---------- forms ---------- */
.df-form .form-group { margin-bottom: 1.1rem; }
.df-form label,
.df-products label,
.df-dashboard label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--dfmp-ink); margin-bottom: .35rem;
}
.df-input,
.df-products input[type=text],
.df-products input[type=number],
.df-products select,
.df-products textarea,
.df-dashboard input[type=text],
.df-dashboard select,
.df-form .form-control {
  width: 100%;
  background: #fff;
  border: 1px solid var(--dfmp-line);
  border-radius: var(--dfmp-radius-sm);
  padding: .6rem .8rem;
  font-size: .95rem;
  color: var(--dfmp-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.df-products input:focus,
.df-products select:focus,
.df-products textarea:focus,
.df-form .form-control:focus,
.df-dashboard input:focus {
  outline: none;
  border-color: var(--dfmp-accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,.18);
}
.df-form { max-width: 720px; }

/* product create/edit form: responsive grid */
.df-product-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; max-width: 820px; }
.df-product-form label { margin: 0; }
.df-product-form .df-full { grid-column: 1 / -1; }
.df-product-form textarea { min-height: 90px; resize: vertical; }
.df-product-form input[type=file] { width: 100%; padding: .5rem; border: 1px dashed var(--dfmp-line); border-radius: var(--dfmp-radius-sm); background: #fafbfc; }
.df-form-actions { display: flex; gap: .6rem; align-items: center; }

/* product list thumbnails + row actions */
.df-thumb-cell { width: 52px; }
.df-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--dfmp-line); display: inline-block; }
.df-thumb-empty { background: repeating-linear-gradient(45deg, #f1f2f4, #f1f2f4 6px, #e9eaee 6px, #e9eaee 12px); }
.df-row-actions { white-space: nowrap; display: flex; gap: .6rem; align-items: center; }
.df-link-danger { color: #b91c1c; font-size: .85rem; }
.df-link-danger:hover { color: #7f1d1d; text-decoration: underline; }

/* image management grid (edit mode) */
.df-image-grid { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.df-image-thumb { position: relative; margin: 0; }
.df-image-thumb img { width: 88px; height: 88px; object-fit: cover; border-radius: var(--dfmp-radius-sm); border: 1px solid var(--dfmp-line); }
.df-image-del {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; line-height: 20px;
  text-align: center; border-radius: 999px; background: #b91c1c; color: #fff; font-weight: 700;
  text-decoration: none; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.df-image-del:hover { background: #7f1d1d; color: #fff; }

/* inline forms (payout / shipment / kyc) */
.df-inline-form { margin: 0 0 1.25rem; }
.df-ship-form,
.df-kyc-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.df-ship-form input[type=text],
.df-ship-form select { width: auto; min-width: 130px; }

/* ---------- badges / statuses ---------- */
.df-badge { padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.df-pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.df-status-approved { background: #dcfce7; color: #166534; }
.df-status-pending  { background: #fef9c3; color: #854d0e; }
.df-status-rejected,
.df-status-suspended { background: #fee2e2; color: #991b1b; }

/* ---------- storefront ---------- */
.df-storefront-banner img { width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--dfmp-radius); }
.df-storefront-head { margin: 1.5rem 0 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.df-storefront-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; border: 1px solid var(--dfmp-line); }
.df-storefront-head h1 { margin: 0; font-weight: 800; letter-spacing: -.02em; }
.df-rating { color: var(--dfmp-accent-dark); font-weight: 700; margin: .2rem 0 0; }
.df-storefront-desc { flex-basis: 100%; color: var(--dfmp-muted); margin-top: .5rem; }

.df-dsa-block {
  border: 1px solid var(--dfmp-line); border-left: 4px solid var(--dfmp-accent);
  background: #fffdf7; border-radius: var(--dfmp-radius-sm); padding: 1.1rem 1.3rem; margin: 0 0 2rem;
}
.df-dsa-block h2 { border: 0; font-size: .95rem; margin-bottom: .6rem; }
.df-dsa-block ul { margin: 0; padding-left: 1.1rem; color: #374151; font-size: .9rem; }
.df-dsa-block li { margin: .15rem 0; }

.df-storefront-grid { margin-bottom: 2.5rem; }
.df-product-card {
  border: 1px solid var(--dfmp-line); border-radius: var(--dfmp-radius);
  padding: 1.1rem; height: 100%; background: #fff; box-shadow: var(--dfmp-shadow);
  transition: transform .12s ease, box-shadow .2s ease;
}
.df-product-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -16px rgba(16,24,40,.35); }
.df-product-card h3 { border: 0; font-size: 1rem; margin: 0 0 .4rem; }
.df-product-card a { color: var(--dfmp-ink); text-decoration: none; }
.df-product-card a:hover { color: var(--dfmp-accent-dark); }
.df-price { font-weight: 800; color: var(--dfmp-accent-dark); margin: 0; }

/* reviews */
.df-reviews { margin-top: 1rem; }
.df-review { border-bottom: 1px solid var(--dfmp-line); padding: .9rem 0; }
.df-review-rating { color: var(--dfmp-accent-dark); font-weight: 700; margin: 0 0 .25rem; }
.df-review-form { margin-top: 1.5rem; background: var(--dfmp-bg); padding: 1.3rem; border-radius: var(--dfmp-radius); border: 1px solid var(--dfmp-line); max-width: 560px; }
.df-review-form h3 { border: 0; font-size: 1rem; }
.df-review-form label { display: block; margin-bottom: .9rem; }

/* ---------- directory ---------- */
.df-directory h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.df-seller-card {
  border: 1px solid var(--dfmp-line); border-radius: var(--dfmp-radius);
  padding: 1.4rem 1.1rem; text-align: center; background: #fff; height: 100%;
  box-shadow: var(--dfmp-shadow); transition: transform .12s ease, box-shadow .2s ease; margin-bottom: 1.5rem;
}
.df-seller-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -16px rgba(16,24,40,.35); }
.df-seller-card img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; margin-bottom: .6rem; }
.df-seller-card h3 { border: 0; font-size: 1rem; }
.df-seller-card a { color: var(--dfmp-ink); text-decoration: none; }
.df-seller-card a:hover { color: var(--dfmp-accent-dark); }

/* ---------- product page "sold by" hook ---------- */
.df-sold-by { margin: .6rem 0; font-size: .92rem; color: var(--dfmp-muted); }
.df-seller-link { font-weight: 700; color: var(--dfmp-accent-dark); }

/* ---------- misc ---------- */
.df-dispute, .df-thread { padding: .55rem 0; border-bottom: 1px solid var(--dfmp-line); font-size: .92rem; }
.df-thread .badge { background: var(--dfmp-accent); color: #1a1205; border-radius: 999px; padding: .1rem .5rem; }
.df-p2b { max-width: 820px; }
.df-p2b p { color: #374151; line-height: 1.6; }

/* ---------- responsive ---------- */
@media (max-width: 767px) {
  .df-product-form { grid-template-columns: 1fr; }
  .df-storefront-head { text-align: center; justify-content: center; }
  .df-dashboard table, .df-products table { font-size: .85rem; }
}

/* checkbox grid (shipping carriers) */
.df-checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem .9rem; margin-bottom: 1.2rem; }
.df-checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; font-size: .92rem; margin: 0; }
.df-checkbox input { width: auto; }
