/* === Device Warranty Lookup UI v3.2 – No Frame, Minimal Elegant === */

/* Container chính: bỏ nền, bỏ khung, bỏ bóng */
.dwm-lookup {
  max-width: 880px;
  margin: 40px auto;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-family: "Manrope", "Inter", sans-serif;
  color: #1e293b;
  text-align: center;
}

/* Tiêu đề gọn, tinh tế */
.dwm-lookup h2 {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.dwm-lookup h2 .icon {
  font-size: 18px;
  opacity: 0.7;
}

/* Form: trung tâm, thoáng */
.dwm-lookup .form {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

/* Input nhẹ nhàng, full width khi cần */
.dwm-lookup input[type="text"] {
  width: 100%;
  max-width: 360px;
  height: 40px;
  padding: 0 14px 0 40px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg fill='%236b7280' width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.9 14.32a7 7 0 111.41-1.41l4.39 4.38-1.41 1.42-4.39-4.39zM8 13a5 5 0 100-10 5 5 0 000 10z'/%3E%3C/svg%3E") no-repeat 12px center;
  background-size: 16px;
  font-size: 14px;
  color: #1e293b;
  box-shadow: none;
  transition: all .25s ease;
}
.dwm-lookup input[type="text"]:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
  outline: none;
}

/* Nút “Tra cứu” nổi bật cyan */
.dwm-lookup button[type="submit"] {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(14,165,233,0.25);
  transition: all .25s ease;
}
.dwm-lookup button[type="submit"]:hover {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(14,165,233,0.35);
}

/* Kết quả tra cứu (card view) nhẹ nhàng */
.dwm-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.dwm-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  padding: 20px 24px;
  transition: all .25s ease;
}
.dwm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(37,99,235,0.08);
}
.dwm-card h4 {
  margin: 0 0 10px;
  font-size: 16.5px;
  color: #2563eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dwm-card .badge-id {
  background: #2563eb;
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}

/* Lưới thông tin */
.dwm-card .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 30px;
}
.dwm-card .item {
  display: grid;
  grid-template-columns: 100px 1fr;
  font-size: 13px;
  color: #0f172a;
  line-height: 1.5;
}
.dwm-card .item strong {
  color: #475569;
  font-weight: 600;
  font-size: 12.5px;
}
.dwm-card .item span {
  color: #1e293b;
  font-weight: 500;
}

/* Status */
.dwm-status-ok {
  background: #dcfce7;
  color: #15803d;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
}
.dwm-status-exp {
  background: #fee2e2;
  color: #b91c1c;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
  .dwm-lookup {
    width: 95%;
    margin: 20px auto;
  }
  .dwm-lookup h2 {
    font-size: 17px;
    margin-bottom: 16px;
  }
  .dwm-lookup .form {
    flex-direction: column;
    gap: 10px;
  }
  .dwm-lookup input[type="text"],
  .dwm-lookup button[type="submit"] {
    width: 100%;
    max-width: none;
  }
}
/* ===== Benefits – 1 dòng trên desktop, 3 dòng trên mobile ===== */
.dwm-benefits {
  display: flex;
  justify-content: flex-start;   /* mặc định canh trái */
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  margin-top: 24px;
  padding: 12px 18px;
  font-size: 14px;
  color: #1e3a8a;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
}

.dwm-benefits div {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* 📱 Mobile: xuống 3 dòng, canh trái */
@media (max-width: 640px) {
  .dwm-benefits {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    justify-content: flex-start;
  }
  .dwm-benefits div {
    white-space: normal;
  }
}

/* 🖥️ Desktop: canh giữa toàn khối */
@media (min-width: 641px) {
  .dwm-benefits {
    justify-content: center !important; /* ✅ canh giữa toàn khối */
    text-align: center;
  }
}

/* === Add-on: Restore Pretty Lookup UI – Cards + Accordion + Print (v1) === */

/* Title line on card */
.dwm-card h4 {
  font-weight: 800;
  letter-spacing: .1px;
}
.dwm-card h4 small {
  font-weight: 600;
}

/* Subtle divider inside card */
.dwm-card .row {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e5e7eb;
}

/* Label–value alignment (giống bản cũ, rất gọn mắt) */
.dwm-card .item {
  grid-template-columns: 130px 1fr;   /* canh cột nhãn + giá trị */
  column-gap: 14px;
}
@media (max-width: 480px){
  .dwm-card .item { grid-template-columns: 120px 1fr; }
}
.dwm-card .item strong {
  text-align: right;
  color: #475569;
  opacity: .95;
}
.dwm-card .item span { color: #0f172a; }

/* ===== Accordion – “Xem phiếu bảo hành” ===== */
.dwm-accordion {
  margin-top: 12px;
}
.toggle-accordion {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37,99,235,0.22);
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.toggle-accordion:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 6px 18px rgba(37,99,235,0.25);
}
.toggle-accordion:active { transform: translateY(0); }

.dwm-accordion-content {
  display: none; /* sẽ bật bằng JS */
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

/* ===== Print area / Warranty card ===== */
.print-area {
  padding: 14px 16px;
  background: #fff;
}
.warranty-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04) inset;
}

/* Brand header (logo + info) */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}
.brand-left img {
  max-height: 56px;
  display: block;
}
.brand-left strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: #111827;
}
.brand-right {
  text-align: right;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

/* Heading “PHIẾU BẢO HÀNH” */
.print-header {
  text-align: center;
  margin: 10px 0 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .5px;
  color: #1e3a8a;
}

/* Table look & feel như bản cũ */
.warranty-card table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
}
.warranty-card th,
.warranty-card td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13.5px;
  color: #0f172a;
}
.warranty-card th {
  width: 34%;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

/* Signature area */
.warranty-card .signature {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  font-size: 13.5px;
}
.warranty-card .signature > div {
  text-align: center;
  padding: 18px 8px 26px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #334155;
  background: #f8fafc;
}
@media (max-width: 640px){
  .warranty-card .signature { grid-template-columns: 1fr; }
}

/* ===== Buttons “In A5 / In A4” – override inline styles ===== */
.dwm-accordion-content .print-area + div {
  margin-top: 12px !important;
  display: flex !important;
  gap: 10px !important;
  flex-wrap: wrap;
}
.dwm-accordion-content .print-area + div button {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  font-size: 14px;
  font-weight: 700;
  color: #fff !important;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15);
}
.dwm-accordion-content .print-area + div button:first-child {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important; /* A5 */
}
.dwm-accordion-content .print-area + div button:last-child {
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important; /* A4 */
}
.dwm-accordion-content .print-area + div button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}
.dwm-accordion-content .print-area + div button:active {
  transform: translateY(0);
}

/* ===== Status chip – giữ style đẹp, cân hàng với text */
.dwm-status-ok,
.dwm-status-exp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  border: 1px solid transparent;
}
.dwm-status-ok { border-color: #86efac; }
.dwm-status-exp { border-color: #fecaca; }

/* ===== Small polish on Benefits bar to khớp theme */
.dwm-benefits {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
  font-weight: 700;
}

/* ===== Optional: Dark mode tweak (tự động) ===== */
@media (prefers-color-scheme: dark) {
  .dwm-lookup { color: #e5e7eb; }
  .dwm-card { background: #0b1220; border-color: #1e293b; }
  .dwm-card .item span { color: #e5e7eb; }
  .dwm-card .item strong { color: #9fb0c6; }
  .dwm-accordion-content,
  .warranty-card { background: #0b1220; border-color: #1e293b; }
  .warranty-card th { background:#0f172a; color:#cbd5e1; }
  .brand-right { color:#cbd5e1; }
}
/* === Lookup UI Refinement v3.3 – Wider Form, Cleaner Print === */

/* Toàn form rộng ra và cân giữa */
.dwm-lookup {
  max-width: 1020px;  /* ✅ tăng từ 880px lên 1020px */
  padding: 0 10px;
}

/* Form input và nút canh đều hơn khi rộng */
.dwm-lookup .form {
  gap: 12px;
}
.dwm-lookup input[type="text"] {
  max-width: 440px; /* rộng hơn một chút cho đẹp */
}

/* === Nút “Xem phiếu bảo hành” nhỏ xinh hơn === */
.toggle-accordion {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 2px 6px rgba(37,99,235,0.25);
}
.toggle-accordion:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}

/* === Gọn nền phiếu bảo hành: bỏ các khung nền lồng nhau, chỉ giữ 1 khung chính === */
.dwm-accordion-content {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  padding: 14px 16px; /* ✅ chuyển padding ra content thay vì print-area */
}

/* Ẩn nền thừa bên trong */
.print-area,
.warranty-card {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Giữ lại border nhẹ cho table */
.warranty-card table {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

/* Tên công ty + logo cách đều, gọn */
.brand-header {
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
}

/* Nút in: thu nhỏ hơn, thanh mảnh hơn */
.dwm-accordion-content .print-area + div button {
  padding: 8px 12px !important;
  font-size: 13px;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Benefits bar canh rộng lại theo form */
.dwm-benefits {
  max-width: 1020px;
  margin-left: auto;
  margin-right: auto;
}
/* === Fix: Align all labels in lookup cards to the left (v3.4) === */
.dwm-card .item {
  grid-template-columns: 120px 1fr;  /* giữ cột nhãn rộng vừa phải */
  align-items: baseline;
}
.dwm-card .item strong {
  text-align: left !important;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1px;
  padding-left: 2px;
}
.dwm-card .item span {
  text-align: left;
  display: inline-block;
  color: #1e293b;
}
/* === Fix v3.4.1 – Mobile line spacing + smaller print buttons + clean signature === */

/* 1️⃣ Fix chồng chữ “Trạng thái” trên mobile */
@media (max-width: 640px) {
  .dwm-card .item {
    grid-template-columns: 1fr;   /* mỗi dòng riêng */
    row-gap: 4px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #f1f5f9;
  }
  .dwm-card .item strong {
    display: inline-block;
    margin-bottom: 1px;
  }
}

/* 2️⃣ Thu nhỏ thêm hai nút “In A5 / In A4” */
.dwm-accordion-content .print-area + div button {
  padding: 6px 10px !important;
  font-size: 12.5px;
  border-radius: 7px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
@media (max-width: 640px) {
  .dwm-accordion-content .print-area + div button {
    width: 100%;
    padding: 8px 12px !important;
    font-size: 13px;
  }
}

/* 3️⃣ Bỏ khung nền phần chữ ký + chừa chỗ trống để ký */
.warranty-card .signature > div {
  background: transparent !important;
  border: none !important;
  padding: 24px 8px 60px; /* ✅ chừa trống phía dưới để ký */
}
/* === Mobile UI Optimization v3.5 – Compact & Clean === */
@media (max-width: 640px) {
  /* 🌿 Tổng thể nhẹ hơn */
  .dwm-lookup {
    width: 94%;
    margin: 16px auto;
    font-size: 14px;
  }

  /* 🔍 Input + nút tra cứu tràn full, dễ thao tác */
  .dwm-lookup .form {
    flex-direction: column;
    gap: 8px;
  }
  .dwm-lookup input[type="text"],
  .dwm-lookup button[type="submit"] {
    width: 100%;
    height: 42px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* 🪶 Card bảo hành */
  .dwm-card {
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }
  .dwm-card h4 {
    font-size: 15px;
    margin-bottom: 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .dwm-card .badge-id {
    align-self: flex-start;
    font-size: 11px;
    padding: 2px 6px;
  }

  /* 🧾 Thông tin hiển thị dọc, dễ đọc hơn */
  .dwm-card .row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
  }
  .dwm-card .item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13.5px;
    padding: 4px 0;
  }
  .dwm-card .item strong {
    color: #475569;
    font-weight: 600;
    font-size: 13px;
  }
  .dwm-card .item span {
    color: #0f172a;
  }

  /* 🟢 “Trạng thái” nổi nhẹ hơn */
  .dwm-status-ok, .dwm-status-exp {
    display: inline-block;
    margin-top: 2px;
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 6px;
  }

  /* 📄 Accordion: nút và nội dung */
  .toggle-accordion {
    width: 100%;
    padding: 8px 0;
    font-size: 13px;
    border-radius: 8px;
  }

  /* 💡 Nút in gọn gàng, chiếm 100% chiều ngang */
  .dwm-accordion-content .print-area + div {
    flex-direction: column;
    gap: 8px !important;
  }
  .dwm-accordion-content .print-area + div button {
    width: 100%;
    font-size: 13px;
    padding: 7px 10px !important;
    border-radius: 7px !important;
  }

  /* ✍️ Phần chữ ký tối giản, chừa khoảng ký */
  .warranty-card .signature {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
  }
  .warranty-card .signature > div {
    padding: 18px 6px 55px;
    background: transparent !important;
    border: none !important;
  }

  /* 🌤️ Giãn cách tổng thể hài hòa hơn */
  .print-header {
    font-size: 17px;
    margin: 8px 0 10px;
  }
  .brand-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
