/* ═══════════════════════════════════════════════════════════
   BuildMate Portal & Website CSS
   Public Catalog · Customer Portal · WhatsApp Float Button
═══════════════════════════════════════════════════════════ */

:root {
  --bm-brand:    #017E84;
  --bm-dark:     #1F2D3D;
  --bm-light:    #E6F4F5;
  --bm-wa:       #25D366;
  --bm-wa-dark:  #128C7E;
  --bm-text:     #212B36;
  --bm-sub:      #637381;
  --bm-border:   #DDE3E9;
  --bm-gray:     #F4F5F7;
  --bm-white:    #ffffff;
  --bm-success:  #28A745;
  --bm-warn:     #FFC107;
  --bm-danger:   #DC3545;
}

* { box-sizing: border-box; }

/* ── WHATSAPP FLOATING BUTTON ─────────────────────────────── */
.bm-wa-float {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9999;
  background: var(--bm-wa);
  color: #fff !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.25s;
  animation: bm-wa-pulse 2.5s infinite;
}
.bm-wa-float:hover {
  background: var(--bm-wa-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
}
@keyframes bm-wa-pulse {
  0%   { box-shadow: 0 4px 20px rgba(37,211,102,.45); }
  50%  { box-shadow: 0 4px 32px rgba(37,211,102,.7); }
  100% { box-shadow: 0 4px 20px rgba(37,211,102,.45); }
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.bm-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bm-brand); color: #fff;
  padding: 10px 22px; border-radius: 6px;
  font-weight: 700; font-size: 14px; text-decoration: none;
  border: none; cursor: pointer; transition: all .18s;
}
.bm-btn-primary:hover { background: #015A60; color: #fff; }

.bm-btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--bm-text);
  padding: 10px 22px; border-radius: 6px;
  font-weight: 600; font-size: 14px; text-decoration: none;
  border: 1px solid var(--bm-border); cursor: pointer; transition: all .18s;
}
.bm-btn-secondary:hover { background: var(--bm-gray); color: var(--bm-text); }

.bm-btn-whatsapp {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bm-wa); color: #fff;
  padding: 10px 22px; border-radius: 6px;
  font-weight: 700; font-size: 14px; text-decoration: none;
  transition: all .18s;
}
.bm-btn-whatsapp:hover { background: var(--bm-wa-dark); color: #fff; }

.bm-btn-whatsapp-sm {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bm-wa); color: #fff;
  padding: 7px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 700; text-decoration: none;
  width: 100%; justify-content: center; transition: all .18s;
}
.bm-btn-whatsapp-sm:hover { background: var(--bm-wa-dark); color: #fff; }

.bm-btn-sm {
  display: inline-flex; background: var(--bm-light); color: var(--bm-brand);
  padding: 4px 12px; border-radius: 4px; font-size: 12px;
  font-weight: 700; text-decoration: none; border: 1px solid var(--bm-brand);
}
.bm-btn-sm:hover { background: var(--bm-brand); color: #fff; }

.bm-btn-lg { padding: 13px 28px; font-size: 16px; }
.bm-btn-xl { padding: 15px 36px; font-size: 17px; }

/* ── HERO BANNER ──────────────────────────────────────────── */
.bm-hero {
  background: linear-gradient(135deg, var(--bm-dark) 0%, #2C3E50 60%, #017E84 100%);
  color: #fff;
  padding: 60px 0 48px;
  text-align: center;
}
.bm-hero h1 { font-size: 38px; font-weight: 900; margin-bottom: 10px; }
.bm-hero p  { font-size: 16px; opacity: .85; margin-bottom: 28px; }
.bm-search-form {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap; max-width: 700px; margin: 0 auto;
}
.bm-search-input {
  flex: 1; min-width: 280px; padding: 12px 18px;
  border-radius: 6px; border: none; font-size: 14px;
  outline: none;
}
.bm-search-input:focus { box-shadow: 0 0 0 3px rgba(37,211,102,.4); }

/* ── CATALOG LAYOUT ───────────────────────────────────────── */
.bm-catalog-body { padding: 32px 20px; }
.bm-catalog-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 768px) { .bm-catalog-layout { grid-template-columns: 1fr; } }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.bm-sidebar {
  background: #fff;
  border: 1px solid var(--bm-border);
  border-radius: 10px;
  padding: 18px 16px;
  position: sticky; top: 20px;
}
.bm-sidebar h5 {
  font-size: 11px; font-weight: 700; color: var(--bm-sub);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--bm-border);
}
.bm-cat-list { list-style: none; padding: 0; margin: 0 0 16px; }
.bm-cat-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-radius: 6px; font-size: 13px;
  color: var(--bm-text); text-decoration: none; transition: all .15s;
}
.bm-cat-list li a:hover { background: var(--bm-light); color: var(--bm-brand); }
.bm-cat-list li a.active { background: var(--bm-brand); color: #fff; font-weight: 700; }
.bm-count {
  background: var(--bm-gray); color: var(--bm-sub);
  font-size: 10px; padding: 1px 6px; border-radius: 10px;
}
.bm-wa-sidebar {
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 14px; text-align: center;
}
.bm-wa-icon { font-size: 28px; margin-bottom: 6px; }
.bm-wa-sidebar p { font-size: 12px; color: var(--bm-sub); margin-bottom: 10px; }

/* ── SORT BAR ─────────────────────────────────────────────── */
.bm-sort-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; font-size: 13px; color: var(--bm-sub);
}
.bm-sort-form { display: flex; align-items: center; gap: 8px; }
.bm-select {
  border: 1px solid var(--bm-border); border-radius: 6px;
  padding: 5px 10px; font-size: 12px; font-family: inherit;
  outline: none; background: #fff; cursor: pointer;
}

/* ── PRODUCTS GRID ────────────────────────────────────────── */
.bm-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
}
.bm-product-card {
  background: #fff;
  border: 1px solid var(--bm-border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--bm-text);
  transition: all .2s;
  display: flex;
  flex-direction: column;
}
.bm-product-card:hover {
  border-color: var(--bm-brand);
  box-shadow: 0 6px 20px rgba(1,126,132,.12);
  transform: translateY(-2px);
  color: var(--bm-text);
}
.bm-product-img {
  height: 160px;
  background: var(--bm-gray);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bm-product-img img { width: 100%; height: 100%; object-fit: cover; }
.bm-product-emoji { font-size: 52px; }
.bm-product-info { padding: 12px 14px; flex: 1; }
.bm-product-cat { font-size: 10px; color: var(--bm-brand); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.bm-product-name { font-weight: 700; font-size: 13px; line-height: 1.3; margin-bottom: 4px; }
.bm-product-meta { font-size: 11px; color: var(--bm-sub); margin-bottom: 6px; }
.bm-product-price { font-size: 15px; font-weight: 900; color: var(--bm-brand); }
.bm-product-code { font-size: 10px; color: var(--bm-sub); font-family: monospace; margin-top: 2px; }
.bm-product-actions { padding: 10px 14px; border-top: 1px solid var(--bm-border); }
.bm-btn-inquiry {
  display: block; text-align: center; background: var(--bm-light);
  color: var(--bm-brand); padding: 7px; border-radius: 5px;
  font-size: 12px; font-weight: 700; transition: all .15s;
}
.bm-product-card:hover .bm-btn-inquiry { background: var(--bm-brand); color: #fff; }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.bm-empty { text-align: center; padding: 60px 20px; color: var(--bm-sub); }
.bm-empty h4 { font-size: 20px; margin: 12px 0 6px; color: var(--bm-text); }

/* ── PRODUCT DETAIL ───────────────────────────────────────── */
.bm-product-detail-page { padding: 24px 20px; }
.bm-breadcrumb { font-size: 13px; color: var(--bm-sub); margin-bottom: 24px; }
.bm-breadcrumb a { color: var(--bm-brand); text-decoration: none; }
.bm-breadcrumb a:hover { text-decoration: underline; }
.bm-detail-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 768px) { .bm-detail-layout { grid-template-columns: 1fr; } }
.bm-detail-img {
  background: var(--bm-gray); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  min-height: 320px; overflow: hidden;
}
.bm-detail-img img { width: 100%; border-radius: 12px; }
.bm-detail-img-placeholder { font-size: 96px; }
.bm-detail-cat { font-size: 11px; color: var(--bm-brand); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.bm-detail-name { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.bm-detail-code { font-size: 12px; color: var(--bm-sub); font-family: monospace; margin-bottom: 14px; }
.bm-detail-price { font-size: 30px; font-weight: 900; color: var(--bm-brand); margin-bottom: 20px; }
.bm-detail-uom { font-size: 16px; font-weight: 400; color: var(--bm-sub); }
.bm-specs-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.bm-specs-table th { width: 140px; text-align: left; padding: 7px 0; font-size: 12px; color: var(--bm-sub); font-weight: 600; border-bottom: 1px solid var(--bm-border); }
.bm-specs-table td { padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--bm-border); }
.bm-detail-desc { font-size: 14px; color: var(--bm-sub); line-height: 1.7; margin-bottom: 20px; }
.bm-detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.bm-related { margin-top: 40px; }
.bm-related h3 { font-size: 20px; font-weight: 700; margin-bottom: 16px; border-bottom: 2px solid var(--bm-brand); padding-bottom: 8px; display: inline-block; }
.bm-related-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 12px; }
.bm-product-card-sm { padding: 12px; }

/* ── RFQ FORM ─────────────────────────────────────────────── */
.bm-rfq-page { padding: 36px 20px; max-width: 860px; margin: 0 auto; }
.bm-rfq-header { text-align: center; margin-bottom: 32px; }
.bm-rfq-header h1 { font-size: 30px; font-weight: 900; color: var(--bm-dark); }
.bm-rfq-header p { color: var(--bm-sub); font-size: 15px; }
.bm-rfq-header a { color: var(--bm-wa); font-weight: 700; }
.bm-rfq-form { background: #fff; border: 1px solid var(--bm-border); border-radius: 12px; padding: 32px; }
.bm-rfq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 640px) { .bm-rfq-grid { grid-template-columns: 1fr; } }
.bm-form-group { margin-bottom: 16px; }
.bm-form-group.bm-full { grid-column: 1/-1; }
.bm-form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--bm-sub); margin-bottom: 5px; }
.bm-form-group input,
.bm-form-group select,
.bm-form-group textarea {
  width: 100%; border: 1px solid var(--bm-border); border-radius: 6px;
  padding: 8px 12px; font-size: 13px; font-family: inherit; outline: none;
  transition: border .15s;
}
.bm-form-group input:focus,
.bm-form-group select:focus,
.bm-form-group textarea:focus { border-color: var(--bm-brand); box-shadow: 0 0 0 3px rgba(1,126,132,.1); }
.bm-rfq-lines { margin: 24px 0 12px; }
.bm-rfq-lines h4 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.bm-rfq-line-header { display: grid; grid-template-columns: 2fr 2fr 80px 32px; gap: 8px; font-size: 11px; font-weight: 700; color: var(--bm-sub); text-transform: uppercase; margin-bottom: 6px; }
.bm-rfq-line { display: grid; grid-template-columns: 2fr 2fr 80px 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.bm-rfq-line input, .bm-rfq-line select {
  border: 1px solid var(--bm-border); border-radius: 5px;
  padding: 7px 8px; font-size: 12px; font-family: inherit; outline: none; width: 100%;
}
.bm-select-product { font-size: 12px; }
.bm-remove-line {
  background: #fee2e2; border: none; color: #991b1b;
  border-radius: 4px; cursor: pointer; font-size: 14px; padding: 4px 8px;
}
.bm-rfq-submit { text-align: center; margin-top: 28px; }
.bm-rfq-note { font-size: 12px; color: var(--bm-sub); margin-top: 10px; }

/* ── THANK YOU PAGE ───────────────────────────────────────── */
.bm-thanks-page { padding: 60px 20px; display: flex; justify-content: center; }
.bm-thanks-card {
  background: #fff; border: 1px solid var(--bm-border); border-radius: 16px;
  padding: 48px 40px; text-align: center; max-width: 500px;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}
.bm-thanks-icon { font-size: 56px; margin-bottom: 16px; }
.bm-thanks-card h1 { font-size: 28px; font-weight: 900; margin-bottom: 12px; }
.bm-thanks-card p { color: var(--bm-sub); font-size: 15px; margin-bottom: 16px; }
.bm-thanks-ref { background: var(--bm-light); border-radius: 6px; padding: 8px 16px; font-size: 13px; color: var(--bm-brand); font-weight: 700; margin-bottom: 20px; }
.bm-thanks-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── CONTACT PAGE ─────────────────────────────────────────── */
.bm-contact-page { padding: 40px 20px; }
.bm-contact-page h1 { font-size: 28px; font-weight: 900; margin-bottom: 24px; }
.bm-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 768px) { .bm-contact-grid { grid-template-columns: 1fr; } }
.bm-contact-item { display: flex; gap: 14px; margin-bottom: 20px; }
.bm-contact-icon { font-size: 24px; flex-shrink: 0; }
.bm-contact-item strong { display: block; font-size: 14px; margin-bottom: 4px; }
.bm-contact-item p { font-size: 13px; color: var(--bm-sub); margin: 0; }
.bm-contact-map { background: var(--bm-gray); border-radius: 12px; display: flex; align-items: center; justify-content: center; min-height: 300px; border: 1px solid var(--bm-border); }
.bm-map-placeholder { text-align: center; color: var(--bm-sub); }

/* ── PORTAL PAGES ─────────────────────────────────────────── */
.bm-portal-page { padding: 24px; max-width: 1000px; }
.bm-portal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.bm-portal-header h2 { font-size: 22px; font-weight: 900; }
.bm-portal-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 640px) { .bm-portal-kpis { grid-template-columns: 1fr 1fr; } }
.bm-portal-kpi {
  background: #fff; border: 1px solid var(--bm-border);
  border-radius: 10px; padding: 20px 16px; text-align: center;
  text-decoration: none; color: var(--bm-text); transition: all .18s;
  border-top: 3px solid var(--bm-brand);
}
.bm-portal-kpi:hover { border-color: var(--bm-brand); box-shadow: 0 4px 16px rgba(1,126,132,.12); transform: translateY(-1px); color: var(--bm-text); }
.bm-kpi-cta { border-top-color: var(--bm-wa); }
.bm-kpi-cta:hover { border-color: var(--bm-wa); }
.bm-kpi-icon { font-size: 28px; margin-bottom: 8px; }
.bm-kpi-val { font-size: 26px; font-weight: 900; color: var(--bm-brand); }
.bm-kpi-label { font-size: 12px; color: var(--bm-sub); margin-top: 4px; }
.bm-portal-section { background: #fff; border: 1px solid var(--bm-border); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.bm-portal-section-hd { padding: 12px 16px; border-bottom: 1px solid var(--bm-border); display: flex; justify-content: space-between; align-items: center; }
.bm-portal-section-hd h4 { font-size: 14px; font-weight: 700; margin: 0; }
.bm-portal-section-hd a { font-size: 12px; color: var(--bm-brand); text-decoration: none; font-weight: 700; }
.bm-portal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bm-portal-table th { background: var(--bm-gray); padding: 9px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--bm-sub); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--bm-border); }
.bm-portal-table td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; }
.bm-portal-table tr:hover td { background: #f8fafb; }
.bm-portal-table tr:last-child td { border-bottom: none; }
.bm-empty-row { text-align: center; color: var(--bm-sub); padding: 32px !important; }
.bm-empty-row a { color: var(--bm-brand); font-weight: 700; }
.bm-total-row td { background: var(--bm-light) !important; border-top: 2px solid var(--bm-brand); }
.bm-portal-wa-cta {
  display: flex; align-items: center; gap: 16px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px;
  padding: 18px 20px; margin-top: 12px;
}
.bm-portal-wa-cta div { flex: 1; }
.bm-portal-wa-cta strong { display: block; font-size: 14px; margin-bottom: 3px; }
.bm-portal-wa-cta p { font-size: 12px; color: var(--bm-sub); margin: 0; }
.bm-order-detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.bm-order-info-block { background: var(--bm-gray); border-radius: 8px; padding: 16px; }
.bm-order-info-row { display: flex; gap: 12px; font-size: 13px; margin-bottom: 8px; }
.bm-order-info-row span { width: 120px; color: var(--bm-sub); flex-shrink: 0; }

/* ── STATUS BADGES ────────────────────────────────────────── */
.bm-status-badge {
  display: inline-flex; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.bm-status-done    { background: #d1fae5; color: #065f46; }
.bm-status-assigned{ background: #dbeafe; color: #1e40af; }
.bm-status-ready   { background: #dbeafe; color: #1e40af; }
.bm-status-waiting { background: #fef3c7; color: #92400e; }
.bm-status-new     { background: #dbeafe; color: #1e40af; }
.bm-status-contacted{background: #fef3c7; color: #92400e; }
.bm-status-converted{background: #d1fae5; color: #065f46; }
.bm-status-closed  { background: #f3f4f6; color: #374151; }
.bm-status-cancel  { background: #fee2e2; color: #991b1b; }
