*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0f0f2;
  --bg-subtle: #e8e8ec;
  --surface: #ffffff;
  --text: #09090b;
  --muted: #71717a;
  --line: rgba(0, 0, 0, 0.07);
  --btn: #09090b;
  --btn-hover: #27272a;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.06);
  --max: 1120px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 0, 0, 0.04), transparent),
    linear-gradient(180deg, var(--bg) 0%, #ececef 100%);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: rgba(240, 240, 242, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.logo-mark {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.logo-text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.logo-tld {
  color: var(--muted);
  font-weight: 500;
}

.logo-text span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-contacts { display: none; }

.header-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}

.header-contact-link svg { width: 14px; height: 14px; }

.header-contact-zalo {
  color: #0068ff;
  background: #eef6ff;
  border-color: #cce4ff;
}

.header-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Layout ── */
.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 16px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-side,
.panel-main {
  min-width: 0;
}

/* Hero — compact on mobile */
.hero { margin-bottom: 4px; }

.hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* Search */
.search-wrap { margin-bottom: 0; }

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  min-height: 50px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form:focus-within {
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: var(--shadow-md);
}

.search-form svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }

.search-form input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
}

.search-form input::placeholder { color: #a1a1aa; }
.search-form input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Sidebar card — hidden on mobile (footer has contacts) */
.side-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.side-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 14px;
}

.side-links { display: flex; flex-direction: column; gap: 8px; }

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  word-break: break-all;
}

.side-link svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }

.side-link-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: #0068ff;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  flex-shrink: 0;
}

.side-link-zalo { background: #f0f7ff; border-color: #cce4ff; color: #0068ff; }

.search-empty {
  display: none;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.search-empty.is-visible { display: block; }

/* ── Domain grid ── */
.domain-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.domain-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 16px 18px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.35s ease both;
  animation-delay: calc(var(--i) * 25ms);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.domain-item.is-hidden { display: none; }

.domain-info { flex: 1; min-width: 0; }

.domain-name {
  font-size: clamp(16px, 4.2vw, 18px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.25;
  word-break: break-all;
}

.domain-name .tld { color: var(--muted); font-weight: 500; }

.domain-price {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.btn-contact {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 84px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--btn);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-contact:active {
  transform: scale(0.97);
  background: var(--btn-hover);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ── Footer ── */
.site-footer {
  margin-top: 8px;
  background: #0c0c0e;
  color: #fafafa;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fafafa;
}

.footer-logo-mark {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
}

.footer-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.footer-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.footer-logo-text strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.footer-logo-text span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  line-height: 1.3;
}

.footer-contact-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  word-break: break-all;
}

.footer-item:active { background: rgba(255, 255, 255, 0.07); }

.footer-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
}

.footer-item-icon svg { width: 14px; height: 14px; }

.footer-item-icon-zalo {
  background: rgba(0, 104, 255, 0.2);
  color: #4da3ff;
}

.footer-item-icon-phone {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.footer-item-icon-email {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
}

.footer-item-zalo {
  border-color: rgba(0, 104, 255, 0.22);
  background: rgba(0, 104, 255, 0.07);
  color: #7eb8ff;
}

.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 16px calc(10px + var(--safe-bottom));
}

.footer-bar p {
  max-width: var(--max);
  margin: 0 auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
}

/* ── Contact popup ── */
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.contact-overlay.is-open { opacity: 1; visibility: visible; }

.contact-sheet {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 22px 26px;
  transform: translateY(20px);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.15);
}

.contact-overlay.is-open .contact-sheet { transform: translateY(0); }

.contact-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.contact-sheet-head h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.contact-sheet-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.contact-sheet-domain {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
}

.contact-close {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--bg);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.contact-actions { display: flex; flex-direction: column; gap: 10px; }

.contact-action {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 0 18px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--bg);
  transition: background 0.2s;
}

.contact-action:active { background: #e4e4e7; }

.contact-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.contact-action-icon svg { width: 20px; height: 20px; }
.contact-action-icon--zalo { background: #eef6ff; color: #0068ff; }
.contact-action-icon--phone { background: #f0fdf4; color: #16a34a; }

.contact-action-text span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Tablet ── */
@media (min-width: 600px) {
  .domain-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .domain-item {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 16px;
  }

  .domain-name { font-size: 18px; }
  .btn-contact { width: 100%; min-height: 46px; }
}

/* ── Desktop ── */
@media (min-width: 960px) {
  .site-header { padding-top: calc(16px + var(--safe-top)); }

  .header-contacts { display: flex; gap: 8px; }

  .layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    padding: 32px 24px calc(48px + var(--safe-bottom));
    align-items: start;
  }

  .panel-side {
    position: sticky;
    top: calc(76px + var(--safe-top));
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .hero { margin-bottom: 0; }

  .hero-title { font-size: 1.75rem; }

  .side-card { display: block; }

  .domain-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .domain-item {
    padding: 22px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px 18px;
  }

  .footer-contact-grid {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
  }

  .footer-item {
    min-height: 36px;
    padding: 6px 12px;
    width: auto;
  }

  .contact-overlay { align-items: center; padding: 24px; }
  .contact-sheet { border-radius: 24px; transform: translateY(12px) scale(0.98); }
  .contact-overlay.is-open .contact-sheet { transform: translateY(0) scale(1); }
}

@media (min-width: 1200px) {
  .domain-list { grid-template-columns: repeat(3, 1fr); }
}

@media (hover: hover) {
  .btn-contact:hover { background: var(--btn-hover); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
  .domain-item:hover {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
  .footer-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
  }
  .footer-item-zalo:hover {
    background: rgba(0, 104, 255, 0.14);
    border-color: rgba(0, 104, 255, 0.35);
  }
  .header-contact-link:hover { background: #e4e4e7; }
  .side-link:hover { background: #e4e4e7; }
  .contact-action:hover { background: #e4e4e7; }
}
