/* =====================================================
   Hardware Quote Plugin — Frontend Form
   Style: ASO Roofing Supply accordion layout
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --hqp-brand:   #0d1939;
  --hqp-text:    #1C1C1E;
  --hqp-grey:    #737373;
  --hqp-border:  #e5e5e5;
  --hqp-bg:      #ffffff;
  --hqp-soft:    #f9f9f9;
  --hqp-red:     #c0392b;
  --hqp-r:       6px;
}

#hqp-app {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 48px;
  color: var(--hqp-text);
}

/* ── Page header ── */
.hqp-page-hdr { display:flex; align-items:center; gap:16px; margin-bottom:8px; }
.hqp-page-title { font-size:1.75rem; font-weight:600; color:var(--hqp-brand); margin:0; }
.hqp-page-desc { margin-bottom:28px; }
.hqp-page-desc p { font-size:.95rem; color:var(--hqp-grey); line-height:1.65; margin:0; }

/* ── Step wrapper ── */
.hqp-step { background:var(--hqp-bg); }

/* ── Step header ── */
.hqp-step-header { display:flex; align-items:center; justify-content:space-between; padding:20px 0; }
.hqp-step-left { display:flex; align-items:center; gap:14px; }

/* Number circle */
.hqp-num {
  width:36px; height:36px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:.9rem; font-weight:700; flex-shrink:0;
  background:#e8e8e8; color:var(--hqp-grey);
  transition:background .25s, color .25s;
}
.hqp-num.active { background:var(--hqp-brand); color:#fff; }
.hqp-num.done   { background:var(--hqp-brand); color:#fff; }

/* Title */
.hqp-step-title { font-size:1rem; font-weight:600; margin:0; color:var(--hqp-grey); transition:color .25s; }
.hqp-step-title.active { color:var(--hqp-text); }

/* Edit btn */
.hqp-edit-btn { font-size:.85rem; font-weight:500; color:var(--hqp-brand); background:none; border:1px solid var(--hqp-brand); border-radius:4px; padding:4px 14px; cursor:pointer; transition:background .2s,color .2s; }
.hqp-edit-btn:hover { background:var(--hqp-brand); color:#fff; }

/* ── Collapsible body ── */
#hqp-app .hqp-body { overflow:hidden; display:none; }
#hqp-app .hqp-body.open { display:block; }
.hqp-body-inner { padding-bottom:24px; }

/* ── Divider ── */
.hqp-divider { height:1px; background:var(--hqp-border); margin:0; }

/* ── Field rows ── */
.hqp-row { display:flex; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.hqp-field { flex:1; min-width:200px; }
.hqp-field.hqp-full { flex:0 0 100%; min-width:0; }

/* ── Labels ── */
.hqp-label { font-size:.85rem; font-weight:500; color:var(--hqp-text); margin:0 0 6px; }

/* ── Inputs ── */
.hqp-input-wrap { position:relative; }
.hqp-input {
  width:100%; padding:10px 14px;
  border:1.5px solid var(--hqp-border); border-radius:var(--hqp-r);
  font-family:inherit; font-size:.9rem; color:var(--hqp-text); background:#fff;
  outline:none; box-sizing:border-box;
  transition:border-color .2s, box-shadow .2s; appearance:none;
}
.hqp-input:focus { border-color:var(--hqp-brand); box-shadow:0 0 0 3px rgba(13,25,57,.1); }
.hqp-input.hqp-invalid { border-color:var(--hqp-red); }
.hqp-textarea { resize:vertical; min-height:80px; }

/* ── Hint row ── */
.hqp-hint-row { display:flex; align-items:flex-start; gap:6px; margin-top:6px; }
.hqp-hint-row svg { flex-shrink:0; margin-top:2px; }
.hqp-hint-text { font-size:.78rem; color:var(--hqp-grey); line-height:1.4; }

/* ── Required note ── */
.hqp-required-note { font-size:.78rem; color:var(--hqp-grey); margin:4px 0 16px; }

/* ── Errors ── */
.hqp-err { font-size:.82rem; color:var(--hqp-red); background:#fef2f2; border:1px solid #fecaca; border-radius:var(--hqp-r); padding:8px 12px; margin-bottom:14px; display:none; }
.hqp-err.visible { display:block; }

/* ── Continue button ── */
.hqp-btn-row { display:flex; }
.hqp-continue-btn { background:var(--hqp-brand); color:#fff; border:none; border-radius:var(--hqp-r); padding:12px 32px; font-family:inherit; font-size:.95rem; font-weight:600; cursor:pointer; transition:opacity .2s; }
.hqp-continue-btn:hover { opacity:.88; }
.hqp-continue-btn:disabled { opacity:.6; pointer-events:none; }

/* ── Toolbar ── */
.hqp-toolbar { display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.hqp-search-box { flex:1; min-width:200px; position:relative; }
.hqp-search-box svg { position:absolute; right:10px; top:50%; transform:translateY(-50%); width:16px; height:16px; pointer-events:none; fill: #fff;}
.hqp-search-box input { width:100%; padding:10px 14px 10px 34px; border:1.5px solid var(--hqp-border); border-radius:var(--hqp-r); font-family:inherit; font-size:.9rem; outline:none; box-sizing:border-box; transition:border-color .2s; }
.hqp-search-box input:focus { border-color:var(--hqp-brand); }
#hqp-cat-filter { padding:10px 14px; border:1.5px solid var(--hqp-border); border-radius:var(--hqp-r); font-family:inherit; font-size:.9rem; background:#fff; outline:none; cursor:pointer; min-width:160px; transition:border-color .2s; }
#hqp-cat-filter:focus { border-color:var(--hqp-brand); }
.hqp-pc-qty .hqp-qty-btn{ padding:0 10px;}
.hqp-pc-qty .hqp-qty-input{ padding: 2px 0;}
/* ── Product grid ── */
.hqp-products-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin-bottom:16px; min-height:100px; }

/* Product card */
.hqp-product-card { border:1.5px solid var(--hqp-border); border-radius:var(--hqp-r); overflow:hidden; cursor:pointer; transition:border-color .2s,box-shadow .2s; background:#fff; position:relative; display:flex; flex-direction:column; }
.hqp-product-card:hover { border-color:var(--hqp-brand); box-shadow:0 2px 12px rgba(13,25,57,.1); }
.hqp-product-card.selected { border-color:var(--hqp-brand); background:#f0f3f8; }
.hqp-pc-img { width:100%; height:100px; background:var(--hqp-soft); display:flex; align-items:center; justify-content:center; font-size:2rem; flex-shrink:0; overflow:hidden; }
.hqp-pc-img img { width:100%; height:100%; object-fit:cover; }
.hqp-pc-body { padding:8px 10px; flex:1; display:flex; flex-direction:column; gap:3px; }
.hqp-pc-sku { font-size:.7rem; color:var(--hqp-grey); font-weight:500; }
.hqp-pc-name { font-size:.8rem; font-weight:500; line-height:1.3; flex:1; }
.hqp-pc-price { font-size:.9rem; font-weight:700; color:var(--hqp-brand); }
.hqp-pc-tick { position:absolute; top:6px; right:6px; width:20px; height:20px; background:var(--hqp-brand); border-radius:50%; display:none; align-items:center; justify-content:center; }
.hqp-product-card.selected .hqp-pc-tick { display:flex; }
.hqp-pc-tick svg { width:11px; height:11px; color:#fff; }
.hqp-pc-qty { display:none; align-items:center; gap:4px; padding:6px 10px; border-top:1px solid var(--hqp-border); background:#fff; }
.hqp-product-card.selected .hqp-pc-qty { display:flex; }
.hqp-qty-btn { width:24px; height:24px; border:1.5px solid var(--hqp-border); border-radius:4px; background:#fff; cursor:pointer; font-size:.9rem; display:flex; align-items:center; justify-content:center; transition:border-color .2s; font-family:inherit; }
.hqp-qty-btn:hover { border-color:var(--hqp-brand); color:var(--hqp-brand); }
.hqp-qty-input { width:36px; text-align:center; border:1.5px solid var(--hqp-border); border-radius:4px; font-size:.82rem; padding:2px; outline:none; }
.hqp-qty-input:focus { border-color:var(--hqp-brand); }

/* Loading */
.hqp-loading { grid-column:1/-1; display:flex; align-items:center; gap:10px; justify-content:center; padding:32px; color:var(--hqp-grey); font-size:.9rem; }
.hqp-spinner { width:20px; height:20px; border:2.5px solid var(--hqp-border); border-top-color:var(--hqp-brand); border-radius:50%; animation:hqp-spin .7s linear infinite; }
@keyframes hqp-spin { to { transform:rotate(360deg); } }
.hqp-no-products { grid-column:1/-1; text-align:center; padding:32px; color:var(--hqp-grey); font-size:.9rem; }

/* Show More button */
.hqp-pagination { margin-bottom: 16px; text-align: center; }
.hqp-show-more-btn {
  background: #fff;
  color: var(--hqp-brand);
  border: 1.5px solid var(--hqp-brand);
  border-radius: var(--hqp-r);
  padding: 9px 28px;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
  width: 100%;
}
.hqp-show-more-btn:hover { background: var(--hqp-brand); color: #fff; }
.hqp-show-more-btn:disabled { opacity: .6; pointer-events: none; }

/* Cart bar */
.hqp-cart-bar { display:flex; justify-content:space-between; align-items:center; background:var(--hqp-brand); color:#fff; border-radius:var(--hqp-r); padding:10px 16px; margin-bottom:16px; font-size:.9rem; }
#hqp-cart-total { font-weight:700; }

/* ── Delivery radio ── */
.hqp-radio-group { display:flex; gap:10px; flex-wrap:wrap; }
.hqp-radio-opt { display:flex; align-items:center; gap:7px; padding:9px 18px; border:1.5px solid var(--hqp-border); border-radius:var(--hqp-r); cursor:pointer; font-size:.9rem; font-weight:500; color:var(--hqp-grey); transition:all .2s; user-select:none; }
.hqp-radio-opt input { display:none; }
.hqp-radio-opt:hover { border-color:var(--hqp-brand); color:var(--hqp-brand); }
.hqp-radio-opt.selected { border-color:var(--hqp-brand); background:#f0f3f8; color:var(--hqp-brand); }

/* ── Review ── */
.hqp-review-block { background:var(--hqp-soft); border:1px solid var(--hqp-border); border-radius:var(--hqp-r); padding:14px 16px; margin-bottom:16px; }
.hqp-review-row { display:flex; gap:12px; font-size:.875rem; padding:5px 0; border-bottom:1px solid var(--hqp-border); }
.hqp-review-row:last-child { border-bottom:none; }
.hqp-review-key { font-weight:600; color:var(--hqp-grey); min-width:90px; }
.hqp-review-val { color:var(--hqp-text); }

/* ── Quote table ── */
.hqp-quote-table-wrap { overflow-x:auto; border:1px solid var(--hqp-border); border-radius:var(--hqp-r); margin-bottom:10px; }
.hqp-quote-table { width:100%; border-collapse:collapse; font-size:.875rem; }
.hqp-quote-table thead { background:var(--hqp-soft); }
.hqp-quote-table th, .hqp-quote-table td { padding:10px 14px; text-align:left; border-bottom:1px solid var(--hqp-border); }
.hqp-quote-table tbody tr:last-child td { border-bottom:none; }
.hqp-quote-table th { font-size:.75rem; text-transform:uppercase; letter-spacing:.05em; color:var(--hqp-grey); font-weight:600; }
.hqp-tf-label { text-align:right; font-weight:600; }
.hqp-tf-total { font-weight:700; color:var(--hqp-brand); }
.hqp-disclaimer { font-size:.76rem; color:var(--hqp-grey); margin:6px 0 0; }

/* ── Success ── */
#hqp-success { text-align:center; padding:40px 16px; }
.hqp-success-inner { max-width:680px; margin:0 auto; }
.hqp-success-icon { width:60px; height:60px; margin:0 auto 20px; }
.hqp-success-icon svg { width:60px; height:60px; fill:#fff; }
#hqp-success h2 { font-size:1.4rem; font-weight:600; margin:0 0 20px; color:var(--hqp-brand); }
.hqp-quote-summary-box { background:#fff; border:1px solid var(--hqp-border); border-radius:var(--hqp-r); padding:16px; margin:0 0 24px; text-align:left; }
.hqp-qs-header { display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px; font-size:.875rem; padding-bottom:10px; margin-bottom:10px; border-bottom:1px solid var(--hqp-border); }
#hqp-qs-id { font-weight:700; color:var(--hqp-brand); }

/* ── Responsive ── */
@media (max-width:560px) {
  .hqp-row { flex-direction:column; }
  .hqp-field { min-width:0; }
  .hqp-products-grid { grid-template-columns:1fr 1fr; }
  .hqp-radio-group { flex-direction:column; }
}
@media (max-width:380px) { .hqp-products-grid { grid-template-columns:1fr; } }

/* ── Delivery cards (screenshot style) ── */
.hqp-delivery-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--hqp-text);
  margin: 0 0 16px;
}
.hqp-delivery-cards {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.hqp-delivery-card {
  flex: 1;
  min-width: 180px;
  border: 2px solid var(--hqp-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  padding: 16px 18px;
  display: block;
}
.hqp-delivery-card input[type="radio"] { display: none; }
.hqp-delivery-card:hover { border-color: #aaa; }
.hqp-delivery-card.selected {
  border-color: var(--hqp-brand);
  box-shadow: 0 0 0 1px var(--hqp-brand);
}
.hqp-delivery-card-inner { pointer-events: none; }
.hqp-delivery-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.hqp-delivery-card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--hqp-text);
  margin-bottom: 4px;
}
.hqp-delivery-card-sub {
  font-size: .82rem;
  color: var(--hqp-grey);
}
.hqp-free-badge {
  background: var(--hqp-brand);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Schedule title ── */
.hqp-schedule-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--hqp-text);
  margin: 0 0 16px;
}

/* ── Store info grid ── */
.hqp-store-info-grid {
  display: flex;
  gap: 40px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.hqp-store-info-left,
.hqp-store-info-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .875rem;
  color: var(--hqp-text);
  line-height: 1.6;
}
.hqp-store-info-left strong,
.hqp-store-info-right strong {
  font-weight: 600;
  margin-bottom: 2px;
}

/* ── Date input with icon ── */
.hqp-input-wrap { position: relative; }
.hqp-date-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.hqp-date-icon svg { width: 16px; height: 16px; color: var(--hqp-grey); }
.hqp-input-date { padding-left: 38px !important; }

/* ── Store location cards ── */
.hqp-store-cards {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.hqp-store-card {
  flex: 1;
  min-width: 200px;
  border: 2px solid var(--hqp-border);
  border-radius: 10px;
  cursor: pointer;
  padding: 14px 16px;
  display: block;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
}
.hqp-store-card input[type="radio"] { display: none; }
.hqp-store-card:hover { border-color: #aaa; }
.hqp-store-card.selected {
  border-color: var(--hqp-brand);
  box-shadow: 0 0 0 1px var(--hqp-brand);
}
.hqp-store-card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--hqp-text);
  margin-bottom: 6px;
}
.hqp-store-card-detail {
  font-size: .82rem;
  color: var(--hqp-grey);
  line-height: 1.6;
}
.hqp-store-hours-wrap {
  margin-bottom: 16px;
}
@media (max-width: 560px) {
  .hqp-store-cards { flex-direction: column; }
}

/* ── Terms & Conditions checkbox ── */
.hqp-tc-wrap {
  margin: 14px 0;
  padding: 12px 16px;
  border: 1.5px solid #fecaca;
  border-radius: var(--hqp-r);
  background: #fef2f2;
}
.hqp-tc-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .875rem;
  line-height: 1.5;
}
.hqp-tc-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--hqp-brand);
}
