/*
 * Product Configurator — frontend styles.
 * Uses the host theme's red tone (#D70019) where it makes sense, but stays
 * self-contained so it works on any theme.
 */

.pc-configurator,
.pc-repair-flow {
  --pc-color: #D70019;
  --pc-color-soft: #fde8eb;
  --pc-border: #e5e7eb;
  --pc-bg: #ffffff;
  --pc-mute: #6b7280;
  font-family: inherit;
  color: #262626;
}

.pc-configurator.is-loading [data-pc-price] { opacity: 0.5; }
.pc-configurator.is-invalid [data-pc-price]:after { content: " · không có sẵn"; color: var(--pc-color); font-weight: 600; font-size: 13px; }

.pc-attr { margin: 10px 0; }
.pc-attr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pc-attr-label { font-weight: 600; font-size: 13px; }
.pc-attr-label .pc-req { color: var(--pc-color); }
/* Picked-label ":Đen" duplicates the highlighted card — hide it. */
.pc-attr-picked { display: none; }

/* Compact 3-col grid, cellphones.com.vn-style single-line cards. */
.pc-options {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.pc-options-color { grid-template-columns: repeat(3, 1fr); }

.pc-opt {
  position: relative; padding: 7px 9px; border: 1px solid var(--pc-border); border-radius: 8px;
  background: #fff; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  display: flex; align-items: center; gap: 5px; text-align: left; font-family: inherit;
  font-size: 12px; line-height: 1.25;
  min-height: 0;
}
.pc-opt .pc-opt-label {
  flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word; font-weight: 500;
}
.pc-opt .pc-opt-mod { flex-shrink: 0; font-size: 11px; }
.pc-swatch { width: 16px; height: 16px; flex-shrink: 0; }
.pc-opt-check { width: 18px; height: 18px; font-size: 10px; line-height: 18px; top: -6px; right: -6px; }

/* Hide section if it has no options (no-op placeholders, etc.) */
.pc-attr:empty { display: none; }
.pc-opt:hover { border-color: #fbb6c0; }
.pc-opt.is-selected { border-color: var(--pc-color); background: var(--pc-color-soft); }
.pc-opt:disabled { opacity: 0.45; cursor: not-allowed; }
.pc-opt-label { flex: 1; }
.pc-opt-mod { font-size: 12px; color: var(--pc-mute); white-space: nowrap; }
.pc-mod-up   { color: #d97706; }
.pc-mod-down { color: #16a34a; }
.pc-opt-check {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pc-color); color: #fff; font-size: 11px; line-height: 22px; text-align: center;
  opacity: 0; transform: scale(0.6); transition: all 0.15s;
}
.pc-opt.is-selected .pc-opt-check { opacity: 1; transform: scale(1); }

.pc-swatch {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
}

.pc-input, .pc-search {
  width: 100%; padding: 9px 12px; border: 1px solid var(--pc-border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff;
}
.pc-input:focus, .pc-search:focus { outline: 2px solid rgba(215,0,25,0.25); border-color: var(--pc-color); }
.pc-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* Price bar */
.pc-pricebar {
  margin-top: 16px; padding: 14px 16px; border: 1px solid var(--pc-border);
  border-radius: 12px; background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.pc-pricebar-label { display: block; font-size: 12px; color: var(--pc-mute); }
.pc-pricebar-price { display: block; font-size: 22px; font-weight: 800; color: var(--pc-color); }
.pc-pricebar-old   { font-size: 13px; color: #9ca3af; text-decoration: line-through; margin-left: 8px; }
.pc-pricebar-actions { display: flex; gap: 8px; }
.pc-cta {
  padding: 10px 18px; border-radius: 10px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 14px; line-height: 1; font-family: inherit;
  background: var(--pc-color); color: #fff; text-decoration: none;
}
.pc-cta:hover { background: #b3001a; }
.pc-cta-call { background: #16a34a; }
.pc-cta-call:hover { background: #15803d; }
.pc-cta-quote { background: #2563eb; }
.pc-cta-quote:hover { background: #1d4ed8; }

/* Repair flow */
.pc-repair-flow { background: #f9fafb; padding: 18px; border-radius: 14px; }
.pc-repair-stepper {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--pc-border);
}
.pc-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--pc-mute); }
.pc-step.is-active .pc-step-num { background: var(--pc-color); color: #fff; }
.pc-step-num {
  width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: #6b7280;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11.5px;
}
.pc-step-lbl { font-weight: 500; }

.pc-repair-attr-label { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.pc-repair-pricebox {
  background: #fff; border: 1px solid var(--pc-border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.pc-repair-pricelabel { font-size: 12px; color: var(--pc-mute); }
.pc-repair-price { display: block; font-size: 24px; font-weight: 800; color: var(--pc-color); margin-top: 4px; }
.pc-repair-pricemsg { font-size: 12.5px; color: var(--pc-mute); margin: 6px 0 0; }

.pc-repair-form { background: #fff; border: 1px solid var(--pc-border); border-radius: 12px; padding: 14px 16px; }
.pc-repair-form label {
  display: block; font-size: 12.5px; color: #374151; margin-bottom: 10px;
}
.pc-repair-form input, .pc-repair-form select, .pc-repair-form textarea {
  display: block; width: 100%; padding: 8px 10px; border: 1px solid var(--pc-border);
  border-radius: 8px; font-family: inherit; font-size: 14px; margin-top: 3px;
}
.pc-repair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .pc-repair-row { grid-template-columns: 1fr; } }
.pc-repair-ok { color: #166534; background: #dcfce7; padding: 14px; border-radius: 8px; font-weight: 600; }

/* Specs table (right column under variant block + hotline) */
.pc-specs-block {
  background: #fff; border: 1px solid var(--pc-border); border-radius: 12px;
  padding: 14px 16px; margin-top: 14px;
}
.pc-specs-title {
  font-size: 14px; font-weight: 700; color: #262626; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.pc-specs-title::before {
  content: ""; width: 3px; height: 16px; border-radius: 2px; background: var(--pc-color);
}
.pc-specs-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pc-specs-table tr { border-top: 1px solid #f1f5f9; }
.pc-specs-table tr:first-child { border-top: 0; }
.pc-specs-table th {
  width: 42%; padding: 7px 8px 7px 0; text-align: left; font-weight: 500; color: #6b7280;
  vertical-align: top;
}
.pc-specs-table td { padding: 7px 0; color: #262626; vertical-align: top; }
