/* ══ ID-based overrides — highest specificity, beats any theme ══ */
#txdqs-main-wrap .txdqs-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 20px !important;
  align-items: flex-start !important;
  width: 100% !important;
}
#txdqs-main-wrap .txdqs-grid > div:first-child {
  width: 50% !important;
  min-width: 0 !important;
  max-width: 50% !important;
  flex-shrink: 0 !important;
  position: sticky !important;
  top: 16px !important;
}
#txdqs-main-wrap .txdqs-grid > div:last-child {
  flex: 0 0 50% !important;
  width: 50% !important;
  max-width: 50% !important;
  min-width: 0 !important;
}
@media (max-width: 860px) {
  #txdqs-main-wrap .txdqs-grid { display: block !important; }
  #txdqs-main-wrap .txdqs-grid > div:first-child,
  #txdqs-main-wrap .txdqs-grid > div:last-child {
    width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    position: static !important;
  }
}

/* ══════════════════════════════════════════════════════
   TXD Quotation System — Store CSS v2.1
   Side-by-side layout: Products LEFT | Quotation RIGHT
══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box !important; }

/* Remove WordPress page top padding/margin */
.txdqs-wrap,
.txdqs-wrap * { font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif; }

.txdqs-wrap {
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  color: #1e293b;
  position: relative;
}

/* ── Header bar ── */
.txdqs-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  padding: 14px 20px !important;
  margin: 0 0 16px 0 !important;
  background: linear-gradient(135deg, #1a6f8c 0%, #0d4f66 100%);
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 4px 18px rgba(13,79,102,.28);
}
.txdqs-header h2 { margin: 0 !important; font-size: 18px; font-weight: 700; color: #fff; }
.txdqs-controls { display: flex; gap: 10px; align-items: center; }
.txdqs-controls label { color: #c8e8f3; font-size: 12px; font-weight: 600; }
.txdqs-controls select {
  padding: 7px 12px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.2); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; outline: none;
}
.txdqs-controls select option { color: #1e293b; background: #fff; }

/* ══════════════════════════════════════════════════════
   MAIN GRID — Products LEFT (fixed) | Quotation RIGHT
   Using ALL possible CSS to force side-by-side on theme
══════════════════════════════════════════════════════ */
.txdqs-grid {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-orient: horizontal !important;
  -webkit-box-direction: normal !important;
  -ms-flex-direction: row !important;
  flex-direction: row !important;
  gap: 16px !important;
  align-items: flex-start !important;
  width: 100% !important;
}

/* LEFT column — Products */
.txdqs-grid > div:first-child {
  width: 50% !important;
  min-width: 0 !important;
  max-width: 50% !important;
  -ms-flex-negative: 0 !important;
  flex-shrink: 0 !important;
  position: sticky !important;
  top: 16px !important;
  max-height: calc(100vh - 40px) !important;
  overflow-y: auto !important;
}

/* RIGHT column — Quotation form */
.txdqs-grid > div:last-child {
  flex: 0 0 50% !important;
  width: 50% !important;
  max-width: 50% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

/* Products scroll */
#txdqs-products {
  max-height: calc(100vh - 160px);
  min-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}
#txdqs-products::-webkit-scrollbar { width: 4px; }
#txdqs-products::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }

/* Mobile: stack vertically */
@media (max-width: 800px) {
  .txdqs-grid {
    display: block !important;
  }
  .txdqs-grid > div:first-child {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    position: static !important;
    max-height: none !important;
  }
  #txdqs-products { max-height: 380px; }
}

/* ── Cards ── */
.txdqs-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.txdqs-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.txdqs-card h3::before {
  content: '';
  display: inline-block;
  width: 4px; height: 16px;
  background: #1a6f8c;
  border-radius: 2px;
}

/* ── Product items ── */
.txdqs-prod {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 5px 0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  transition: all .14s;
}
.txdqs-prod:hover {
  border-color: #1a6f8c;
  box-shadow: 0 3px 14px rgba(26,111,140,.16);
  background: #f0f9ff;
}
.txdqs-prod-left { flex: 1; min-width: 0; }
.txdqs-prod-name { font-weight: 600; font-size: 12px; color: #0f172a; line-height: 1.4; }
.txdqs-prod-meta { font-size: 10px; color: #64748b; margin-top: 4px; display: flex; gap: 5px; flex-wrap: wrap; }
.txdqs-prod-meta span { background: #f1f5f9; padding: 2px 7px; border-radius: 20px; }
.txdqs-prod-price { font-weight: 700; font-size: 13px; color: #1a6f8c; white-space: nowrap; }
.txdqs-prod-add {
  background: linear-gradient(135deg, #2596be, #1a6f8c);
  color: #fff; border: none; border-radius: 7px;
  padding: 6px 12px; cursor: pointer;
  font-size: 11px; font-weight: 700;
  transition: all .14s; white-space: nowrap;
}
.txdqs-prod-add:hover { background: linear-gradient(135deg, #0d4f66, #062e40); }

/* ── Buttons ── */
.txdqs-btn {
  border: 2px solid #1a6f8c; background: #1a6f8c; color: #fff;
  padding: 9px 18px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 700; transition: all .18s;
  text-decoration: none; display: inline-block;
}
.txdqs-btn:hover { background: #0d4f66; border-color: #0d4f66; color: #fff; }
.txdqs-btn-small { padding: 5px 10px; border-radius: 7px; font-size: 12px; }
.txdqs-btn-ghost { background: transparent; color: #1a6f8c; }
.txdqs-btn-ghost:hover { background: #0d4f66; color: #fff; }
.txdqs-btn-primary { background: linear-gradient(135deg,#0f766e,#065f59); border-color: #0f766e; }
.txdqs-btn-primary:hover { background: linear-gradient(135deg,#065f59,#044d48); }
.txdqs-btn-danger { background: #dc2626; border-color: #dc2626; }
.txdqs-btn-danger:hover { background: #991b1b; border-color: #991b1b; }

/* ── Search ── */
.txdqs-search-wrap { position: relative; margin-bottom: 12px; }
.txdqs-search-wrap input {
  width: 100%; padding: 9px 13px;
  border: 2px solid #e2e8f0; border-radius: 10px;
  font-size: 13px; color: #1e293b; background: #fff; transition: border .15s;
}
.txdqs-search-wrap input:focus { border-color: #1a6f8c; outline: none; }
.txdqs-suggestions {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  z-index: 9999; background: #fff;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 240px; overflow-y: auto; margin-top: 4px;
}
.txdqs-suggestion-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 13px; cursor: pointer;
  border-bottom: 1px solid #f1f5f9; gap: 10px; transition: background .12s;
}
.txdqs-suggestion-item:hover { background: #e8f6fd; }
.txdqs-sugg-name { font-size: 13px; color: #0f172a; font-weight: 500; flex: 1; }
.txdqs-sugg-price { font-size: 12px; font-weight: 700; color: #1a6f8c; white-space: nowrap; }

/* ── Empty state ── */
.txdqs-empty {
  color: #94a3b8; font-size: 13px; padding: 20px;
  text-align: center; background: #f8fafc;
  border-radius: 10px; border: 2px dashed #e2e8f0;
}

/* ── Cart rows ── */
.txdqs-cart-row {
  display: flex; justify-content: space-between; gap: 10px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: 10px 13px; margin: 6px 0; background: #fff; transition: all .15s;
}
.txdqs-cart-row:hover { border-color: #1a6f8c; background: #f0f9ff; }
.txdqs-cart-title { font-weight: 600; font-size: 13px; color: #0f172a; }
.txdqs-cart-title input {
  background: transparent; border: none;
  border-bottom: 1.5px dashed #cbd5e1;
  font-size: 13px; font-weight: 600; color: #0f172a;
  padding: 2px 4px; outline: none; width: 100%;
}
.txdqs-cart-title input:focus { border-bottom-color: #1a6f8c; }
.txdqs-cart-sub {
  font-size: 12px; color: #475569;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px;
}
.txdqs-cart-sub input, .txdqs-cart-sub select {
  padding: 4px 7px; border: 1.5px solid #e2e8f0;
  border-radius: 7px; font-size: 12px; background: #f8fafc;
}
.txdqs-cart-sub input:focus, .txdqs-cart-sub select:focus { border-color: #1a6f8c; outline: none; }
.txdqs-cart-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.txdqs-line { font-weight: 700; color: #1a6f8c; font-size: 13px; }

/* ── Form ── */
.txdqs-form label { display: block; font-size: 12px; color: #475569; margin: 10px 0 0; font-weight: 600; }
.txdqs-form input, .txdqs-form textarea, .txdqs-form select {
  width: 100%; padding: 8px 11px;
  border: 1.5px solid #e2e8f0; border-radius: 9px;
  margin-top: 4px; font-size: 13px; color: #1e293b;
  background: #f8fafc; transition: border .15s;
}
.txdqs-form input:focus, .txdqs-form textarea:focus {
  border-color: #1a6f8c; outline: none; background: #fff;
}
.txdqs-form h4 {
  font-size: 13px; font-weight: 700; color: #1a6f8c;
  margin: 18px 0 5px; border-bottom: 2px solid #e0f2fb; padding-bottom: 5px;
}
.txdqs-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.txdqs-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 800px) { .txdqs-row2, .txdqs-row3 { grid-template-columns: 1fr; } }
.txdqs-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 10px; }
.txdqs-help { margin: 3px 0 0; color: #94a3b8; font-size: 11px; }

/* ── Cost rows ── */
.txdqs-cost-data-row {
  display: flex; gap: 6px; align-items: center;
  margin: 5px 0; padding: 7px 9px;
  background: #f8fafc; border-radius: 9px; border: 1.5px solid #e2e8f0;
}
.txdqs-cost-data-row input {
  padding: 5px 7px; border: 1.5px solid #e2e8f0;
  border-radius: 7px; font-size: 12px; background: #fff;
}
.txdqs-cost-data-row input:focus { border-color: #1a6f8c; outline: none; }

/* ── Timeline ── */
.txdqs-timeline-row { display: grid; grid-template-columns: 180px 1fr 40px; gap: 10px; margin: 8px 0; align-items: center; }
@media (max-width: 800px) { .txdqs-timeline-row { grid-template-columns: 1fr; } }
