/* Trang khách: ảnh là chính, chữ và nút chỉ đen trắng để không tranh với quần áo. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  max-width: 1400px;
  padding: 0 env(safe-area-inset-right) calc(20px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
  background: var(--nen);
  color: var(--chu);
  font: 16px/1.45 var(--phong);
  -webkit-tap-highlight-color: transparent;
}
.dau { padding: 16px var(--le) 4px; }
h1 { margin: 0; font-size: clamp(22px, 6vw, 32px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.dau p { margin: 6px 0 0; color: var(--phu); font-size: 14px; }

.thanh-tim { position: sticky; top: 0; z-index: 2; padding: 8px var(--le); background: var(--nen); }
.o-tim { position: relative; }
.o-tim label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.o-tim input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 0;
  border-radius: 0;
  background: var(--nhat) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23111' stroke-width='2'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='M13 13l5 5'/%3E%3C/svg%3E") no-repeat 13px center / 18px;
  color: var(--chu);
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}
.o-tim input::placeholder { color: var(--phu); opacity: 1; }
.o-tim input::-webkit-search-cancel-button { display: none; }
.o-tim input:focus { outline: 2px solid var(--chu); outline-offset: -2px; }
#xoa-tim {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--chu);
  font-size: 24px;
  line-height: 1;
}

.hang-chip {
  display: flex;
  padding: 0 calc(var(--le) - 8px);
  overflow-x: auto;
  border-bottom: 1px solid var(--vien);
  scrollbar-width: none;
}
.hang-chip::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--phu);
  font: inherit;
  font-size: 14px;
}
.chip[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--chu); color: var(--chu); }
.chip:focus-visible { outline: 2px solid var(--chu); outline-offset: -2px; }
.dem, .bao-gan { margin: 10px var(--le) 0; color: var(--phu); font-size: 14px; }
.dem:empty { display: none; }

.luoi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 2px; margin-top: 10px; }
.the { display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 72px; }
.khung-anh { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: var(--nhat); }
.khung-anh img { display: block; width: 100%; height: 100%; object-fit: cover; }
.so {
  position: absolute;
  top: 0;
  left: 0;
  padding: 5px 10px;
  background: var(--nen);
  color: var(--chu);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}
h2 { margin: 8px 10px; font-size: 14px; font-weight: 500; line-height: 1.3; }
.hang-nut { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.nut {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 6px 8px;
  background: var(--chu);
  color: var(--chu-nut);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
a.nut:active { background: var(--nhan-nut); }
.nut:focus-visible { outline: 2px solid var(--chu); outline-offset: 2px; }
.nut-mo { justify-content: flex-start; min-height: 24px; padding: 0 10px; background: none; color: var(--phu); font-size: 14px; font-weight: 400; }

/* Chỉ còn một bộ: ảnh và nút nằm cạnh nhau để bàn phím đang mở vẫn thấy nút. */
.luoi.mot { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.luoi.mot .the { display: grid; grid-template-columns: min(55%, 42vh) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 12px; padding-right: var(--le); }
.luoi.mot .khung-anh { grid-row: 1 / 3; }
.luoi.mot h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
.luoi.mot .hang-nut { gap: 8px; margin-top: 0; }
.luoi.mot .nut-mo { padding: 0; }

.nut-phu {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--chu);
  border-radius: 0;
  background: transparent;
  color: var(--chu);
  font: inherit;
  font-weight: 600;
}
.khong-thay { margin: 24px var(--le); color: var(--phu); }
.khong-thay p { margin: 0 0 12px; }

.tro-giup { margin: 28px var(--le) 0; border-top: 1px solid var(--vien); border-bottom: 1px solid var(--vien); }
.tro-giup summary { display: block; padding: 13px 0; font-size: 15px; font-weight: 600; line-height: 22px; list-style: none; cursor: pointer; }
.tro-giup summary::before { content: "+"; display: inline-block; width: 20px; font-weight: 400; }
.tro-giup[open] summary::before { content: "–"; }
.tro-giup summary::-webkit-details-marker { display: none; }
.tro-giup ol { margin: 0 0 12px; padding-left: 20px; }
.tro-giup .nut-phu { margin-bottom: 12px; }
.bao-chep { margin: 0 0 12px; color: var(--phu); font-size: 14px; overflow-wrap: anywhere; }
.bao-chep:empty { display: none; }
.cuoi { margin: 16px var(--le) 0; color: var(--phu); font-size: 13px; }
.cuoi p { margin: 6px 0; }

/* Điện thoại 2 cột, máy bảng 3, máy tính 4 rồi 5. Xoay ngang điện thoại thì màn thấp nên lấy 4 cột để thấy trọn cả thẻ hơn. */
@media (min-width: 600px) {
  .o-tim { max-width: 560px; }
  .hang-chip { flex-wrap: wrap; margin: 0 var(--le); padding: 0; overflow: visible; }
  .chip { padding: 0 14px 0 0; }
  .chip[aria-pressed="true"] { box-shadow: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
  .luoi { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 4px; padding: 0 var(--le); }
  .luoi.mot .the { padding-right: 0; }
  .tro-giup { max-width: 640px; }
  .cuoi p { max-width: 70ch; }
}
@media (min-width: 600px) and (max-height: 500px), (min-width: 900px) {
  .luoi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .luoi { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (hover: hover) {
  a.nut:hover { background: var(--nhan-nut); }
  .chip:hover { color: var(--chu); }
  .nut-phu:hover { background: var(--nhat); }
}
