/* ForeverFoods Wholesale Portal -- shares the CRM's colour system for brand
   consistency, plus its own layout classes for the catalog/cart/quote flow. */

:root {
  --green: #2f7d4f;
  --green-dark: #1f5c38;
  --bg: #f6f7f5;
  --card: #ffffff;
  --text: #1f2a24;
  --muted: #6b7a71;
  --border: #e2e6e2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

/* ---------------------------------------------------------------- */
/* Login / Register / Forgot / Reset                                 */
/* ---------------------------------------------------------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.register-card { max-width: 420px; text-align: left; }
.register-card p { text-align: center; }

.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card p { color: var(--muted); margin-top: 0; font-size: 14px; }

.login-card input {
  width: 100%; padding: 11px 12px; margin-bottom: 10px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}

.login-card button {
  width: 100%; padding: 11px; border-radius: 8px; border: none;
  background: var(--green); color: white; font-weight: 600; cursor: pointer; font-size: 14px;
}
.login-card button:hover { background: var(--green-dark); }

.error-msg {
  color: #b3261e; font-size: 13px; margin-top: 10px; text-align: left;
}

.ws-info-msg {
  color: var(--green-dark); font-size: 13px; margin-top: 10px; text-align: left;
  background: #eaf5ee; border: 1px solid #cfe8d8; border-radius: 8px; padding: 10px 12px;
}

.login-links { margin-top: 16px; font-size: 13px; }
.login-links a { color: var(--green-dark); text-decoration: none; }
.login-links a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- */
/* App header + nav                                                  */
/* ---------------------------------------------------------------- */

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--border);
}
.app-header .brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-actions .who { color: var(--muted); font-size: 13px; }
.app-header button {
  padding: 8px 16px; border-radius: 8px;
  background: var(--green); border: none; color: white;
  font-weight: 600; cursor: pointer; font-size: 13px;
}
.app-header button:hover { background: var(--green-dark); }

.ws-nav {
  display: flex; gap: 4px; padding: 12px 24px 0; background: var(--card);
  border-bottom: 1px solid var(--border);
}
.ws-nav-btn {
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent;
}
.ws-nav-btn.active { color: var(--green-dark); border-bottom-color: var(--green); font-weight: 600; }

/* ---------------------------------------------------------------- */
/* Toolbar: origin toggle + search                                   */
/* ---------------------------------------------------------------- */

.ws-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; flex-wrap: wrap;
}

.ws-origin-toggle { display: flex; gap: 6px; }
.ws-origin-btn {
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.ws-origin-btn.active { background: var(--green); border-color: var(--green); color: white; }

.ws-search {
  flex: 1; min-width: 220px; max-width: 420px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--card);
}

/* ---------------------------------------------------------------- */
/* Collections / products                                            */
/* ---------------------------------------------------------------- */

.ws-content {
  padding: 0 24px 100px;
  max-width: 1000px;
  margin: 0 auto;
}

.ws-hint {
  color: var(--muted); font-size: 13px; margin: 0 0 14px;
}

.ws-loading { text-align: center; color: var(--muted); padding: 40px 0; }

.ws-collection-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 14px; overflow: hidden;
}

.ws-collection-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; cursor: pointer; font-weight: 700; font-size: 15px;
}
.ws-collection-count { color: var(--muted); font-weight: 400; font-size: 13px; }
.ws-collection-origin {
  color: var(--green-dark); font-weight: 600; font-size: 11.5px;
  background: #eaf5ee; border-radius: 6px; padding: 2px 8px; margin-left: 4px;
}
.ws-collapse-icon { color: var(--muted); }

.ws-product-list { border-top: 1px solid var(--border); overflow-x: auto; }

.ws-product-table { width: 100%; border-collapse: collapse; min-width: 620px; }

.ws-product-table thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.ws-product-table thead th:first-child { padding-left: 18px; }

.ws-product-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle;
}
.ws-product-table tbody tr:last-child td { border-bottom: none; }

.ws-td-product { display: flex; align-items: center; gap: 12px; padding-left: 18px !important; min-width: 220px; }
.ws-thumb {
  width: 44px; height: 44px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); flex-shrink: 0;
}
.ws-product-title { font-size: 14px; font-weight: 600; }

.ws-td-retail { color: var(--muted); white-space: nowrap; }
.ws-td-wholesale { color: var(--text); font-weight: 700; white-space: nowrap; }
.ws-per-kg { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 2px; }
.ws-td-moq { color: var(--muted); white-space: nowrap; }

.ws-qty-input {
  width: 68px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; text-align: center;
}

.ws-td-total { font-weight: 700; color: var(--green-dark); white-space: nowrap; }

/* ---------------------------------------------------------------- */
/* My Quotes                                                          */
/* ---------------------------------------------------------------- */

.ws-myquote-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 12px;
}
.ws-myquote-header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 14px; margin-bottom: 8px;
}
.ws-myquote-total { color: var(--green-dark); }
.ws-myquote-items { border-top: 1px solid var(--border); padding-top: 8px; margin-bottom: 12px; }
.ws-myquote-item { font-size: 13px; color: var(--text); padding: 3px 0; }
.ws-unavailable-tag {
  color: #a15c00; font-size: 11px; margin-left: 6px; background: #fdf1de; border-radius: 6px; padding: 1px 6px;
}
.ws-reorder-btn {
  padding: 9px 16px; border-radius: 8px; border: none;
  background: var(--green); color: white; font-weight: 600; cursor: pointer; font-size: 13px;
}
.ws-reorder-btn:hover { background: var(--green-dark); }

/* ---------------------------------------------------------------- */
/* Cart bar                                                           */
/* ---------------------------------------------------------------- */

.ws-cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--green-dark); color: white;
  display: flex; align-items: center; justify-content: center; gap: 22px;
  padding: 16px 24px; box-shadow: 0 -4px 16px rgba(0,0,0,0.15); z-index: 100;
}
.ws-cart-total { font-weight: 700; font-size: 16px; }
.ws-cart-bar button {
  padding: 10px 20px; border-radius: 8px; border: none;
  background: white; color: var(--green-dark); font-weight: 700; cursor: pointer; font-size: 14px;
}
.ws-cart-bar button:hover { background: #eef4ef; }

/* ---------------------------------------------------------------- */
/* Modals                                                             */
/* ---------------------------------------------------------------- */

.ws-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}

.ws-modal {
  background: var(--card); border-radius: 14px; padding: 26px 26px 22px;
  width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto;
}
.ws-modal-narrow { max-width: 380px; text-align: center; }

.ws-modal h2 { margin-top: 0; font-size: 18px; }
.ws-modal-sub { color: var(--muted); font-size: 13px; margin-top: -6px; }

.ws-quote-items { margin: 16px 0; border-top: 1px solid var(--border); }
.ws-quote-item { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.ws-quote-item-main { display: flex; justify-content: space-between; gap: 12px; }
.ws-quote-item-title { font-weight: 600; }
.ws-moq-note { color: #a15c00; font-size: 12px; margin-top: 4px; }

.ws-quote-modal-total { text-align: right; font-weight: 700; font-size: 16px; margin-top: 6px; }

.ws-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.ws-modal-actions button {
  flex: 1; padding: 11px; border-radius: 8px; border: none;
  background: var(--green); color: white; font-weight: 600; cursor: pointer; font-size: 14px;
}
.ws-modal-actions button:hover { background: var(--green-dark); }
.ws-modal-actions button:disabled { opacity: 0.6; cursor: default; }
.ws-btn-secondary { background: var(--bg) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.ws-btn-secondary:hover { background: var(--border) !important; }

/* ---------------------------------------------------------------- */
/* Mobile                                                             */
/* ---------------------------------------------------------------- */

@media (max-width: 640px) {
  .app-header { padding: 12px 16px; }
  .ws-nav { padding: 10px 16px 0; }
  .ws-toolbar { padding: 12px 16px; }
  .ws-content { padding: 0 12px 110px; }
  .ws-cart-bar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
}
