/* ---- bricophone_diagnostic modal ---- */

.bpdiag-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
}
.bpdiag-modal.bpdiag-open {
  display: block;
}

.bpdiag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 40, 0.6);
  backdrop-filter: blur(2px);
}

.bpdiag-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 18px;
  width: 92%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 36px 30px 28px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
}

.bpdiag-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: #f2f2f2;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 16px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  color: #555;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.bpdiag-close:hover {
  background: #e0e0e0;
  color: #111;
}

/* Breadcrumb */
.bpdiag-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #999;
  margin-bottom: 14px;
}
.bpdiag-crumb { color: #777; }
.bpdiag-sep { color: #ccc; margin: 0 2px; }

/* Title */
.bpdiag-title {
  font-size: 19px;
  font-weight: 700;
  color: #1a2233;
  margin: 0 0 18px;
  line-height: 1.25;
}

/* Phone hint */
.bpdiag-phone-hint {
  background: #fff8e1;
  border-left: 3px solid #f5a623;
  padding: 10px 14px;
  font-size: 13px;
  color: #6b4f00;
  border-radius: 0 8px 8px 0;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* Device type grid */
.bpdiag-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bpdiag-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 14px;
  border: 2px solid #e8eaf0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.bpdiag-type-btn:hover {
  border-color: #1a5cff;
  background: #f0f4ff;
  transform: translateY(-1px);
}
.bpdiag-type-icon { font-size: 30px; line-height: 1; }
.bpdiag-type-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a2233;
}

/* Lists */
.bpdiag-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  padding: 10px 14px 4px;
}
.bpdiag-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  overflow: hidden;
  max-height: 350px;
  overflow-y: auto;
}
.bpdiag-list li + li {
  border-top: 1px solid #f0f0f0;
}
.bpdiag-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  background: #fff;
  border: none;
  cursor: pointer;
  font-size: 13.5px;
  color: #2c3552;
  transition: background 0.1s;
  line-height: 1.4;
}
.bpdiag-item:hover {
  background: #f4f6ff;
  color: #1a5cff;
}

/* Back button */
.bpdiag-back {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
  color: #555;
  margin-top: 12px;
  transition: background 0.1s, border-color 0.1s;
}
.bpdiag-back:hover {
  background: #f5f5f5;
  border-color: #bbb;
}

/* Loading */
.bpdiag-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 50px 20px;
  color: #aaa;
  font-size: 13px;
}
.bpdiag-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #e8e8e8;
  border-top-color: #1a5cff;
  border-radius: 50%;
  animation: bpdiag-spin 0.7s linear infinite;
}
@keyframes bpdiag-spin {
  to { transform: rotate(360deg); }
}

/* Result */
.bpdiag-result-text {
  background: #f4f7ff;
  border-left: 3px solid #1a5cff;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #333;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}
.bpdiag-result-products-title {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin: 0 0 10px;
}
.bpdiag-products-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.bpdiag-products-list li {
  margin-bottom: 8px;
}
.bpdiag-product-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #e8eaf0;
  border-radius: 10px;
  text-decoration: none;
  color: #1a2233;
  font-size: 13.5px;
  transition: border-color 0.15s, background 0.15s;
}
.bpdiag-product-link:hover {
  border-color: #1a5cff;
  background: #f4f7ff;
  text-decoration: none;
  color: #1a5cff;
}
.bpdiag-product-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  background: #f9f9f9;
}
.bpdiag-product-name { flex: 1; }

.bpdiag-result-actions { margin-top: 8px; }
.bpdiag-result-empty {
  text-align: center;
  padding: 24px 0 12px;
  color: #777;
  font-size: 14px;
  line-height: 1.6;
}
.bpdiag-contact-link {
  color: #1a5cff;
  text-decoration: underline;
}

.bpdiag-error,
.bpdiag-empty {
  color: #999;
  font-size: 13.5px;
  padding: 18px 0 8px;
}
.bpdiag-error { color: #c0392b; }

body.bpdiag-no-scroll { overflow: hidden; }

/* Mobile */
@media (max-width: 640px) {
  .bpdiag-panel {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    border-radius: 18px 18px 0 0;
    padding: 28px 20px 24px;
  }
  .bpdiag-type-grid { gap: 8px; }
  .bpdiag-type-btn { padding: 16px 10px; }
  .bpdiag-type-icon { font-size: 26px; }
  .bpdiag-type-label { font-size: 12.5px; }
}
