/* ==========================================================================
   TOPSITE - Tra cứu tên miền: kết quả, gợi ý, WHOIS, giỏ hàng dính, bán chéo
   ========================================================================== */

/* ---------- Khung tìm kiếm & nền banner ---------- */
.domain-search-panel.has-banner { background-size: cover; background-position: center; background-repeat: no-repeat; }
.domain-search-box { gap: .5rem; }
.domain-search-box .form-control { flex: 1 1 auto; min-width: 0; }
.domain-search-box .btn { flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 575.98px) {
    .domain-search-box .form-control { font-size: 1rem; padding-left: .9rem; }
    .domain-search-box .btn { font-size: 1rem; padding-left: 1rem !important; padding-right: 1rem !important; }
}
@media (max-width: 359.98px) {
    .domain-search-box .btn .btn-label { display: none; }
    .domain-search-box .btn i { margin-right: 0 !important; }
}

/* ---------- Kết quả tra cứu ---------- */
.min-w-0 { min-width: 0; }
.dres { margin-top: 1rem; display: grid; gap: .6rem; }
.dres-item {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
    background: #fff; color: var(--ts-body); border-radius: 12px; padding: .85rem 1.1rem;
    border-left: 4px solid var(--ts-line); box-shadow: 0 4px 14px rgba(35, 38, 43, .06);
}
.dres-item.is-available { border-left-color: var(--ts-green); }
.dres-item.is-taken { border-left-color: #e2445c; }
.dres-item.is-unknown { border-left-color: var(--ts-muted); }
.dres-name { font-size: 1.1rem; font-weight: 700; color: var(--ts-dark); overflow-wrap: anywhere; }
.dres-meta { font-size: .85rem; color: var(--ts-muted); }
.dres-meta strong { color: var(--ts-primary); }
.dres-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.dres-badge { font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 100px; white-space: nowrap; }
.dres-badge.ok { background: #E8F5DD; color: var(--ts-green-dark); }
.dres-badge.no { background: #FDE8EB; color: #b42336; }
.dres-badge.na { background: #EEF0F2; color: #5d646c; }
.dres-badge.warn { background: #FFF4D6; color: #9a6700; }
.dres-badge.cache { background: transparent; color: var(--ts-muted); font-weight: 400; padding-left: 0; }
.dres .btn { white-space: nowrap; }
.btn-incart { background: #E8F5DD; color: var(--ts-green-dark); border: 0; }
.btn-incart:hover { background: #d6edc4; color: var(--ts-green-dark); }

/* ---------- Gợi ý & lịch sử ---------- */
.dsg { margin-top: 1.25rem; }
.dsg-title { font-weight: 700; margin-bottom: .6rem; color: inherit; font-size: 1rem; }
.dsg-title small { font-weight: 400; opacity: .7; }
.dsg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.dsg-card {
    background: rgba(255, 255, 255, .96); color: var(--ts-body); border-radius: 12px; padding: .75rem .9rem;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; border: 1px solid var(--ts-line);
}
.dsg-card .dsg-domain { font-weight: 700; color: var(--ts-dark); overflow-wrap: anywhere; line-height: 1.3; }
.dsg-card .dsg-price { font-size: .8rem; color: var(--ts-primary); }
.dsg-card .dsg-tag { font-size: .7rem; color: var(--ts-muted); }
.dsg-add { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.dsg-skeleton { height: 62px; border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,.08) 25%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.08) 75%); background-size: 200% 100%; animation: dsg-shimmer 1.2s infinite; }
@keyframes dsg-shimmer { to { background-position: -200% 0; } }
.dhis { margin-top: 1rem; }
.dhis-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.dhis-chip {
    display: inline-flex; align-items: center; gap: .45rem; background: rgba(255, 255, 255, .1); color: inherit;
    border: 1px solid rgba(255, 255, 255, .25); border-radius: 100px; padding: .3rem .4rem .3rem .85rem; font-size: .875rem;
}
.dhis-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ts-muted); }
.dhis-chip .dot.available { background: #7bd33f; }
.dhis-chip .dot.taken { background: #ff6b81; }
.dhis-chip button { border: 0; background: rgba(255, 255, 255, .92); color: var(--ts-dark); border-radius: 100px; font-size: .75rem; padding: .15rem .6rem; }
.dhis-chip button:hover { background: #fff; color: var(--ts-primary); }
.dhis-chip .dhis-link { background: #E8F5DD; color: var(--ts-green-dark); border-radius: 100px; font-size: .75rem; padding: .15rem .6rem; }
.dhis-chip .btn-incart { font-size: .75rem; padding: .15rem .6rem; }

/* ---------- Popup WHOIS & bán chéo ---------- */
.domain-modal { border: 0; border-radius: var(--ts-radius); }
.whois-table th { width: 38%; color: var(--ts-muted); font-weight: 500; }
.whois-table td { color: var(--ts-dark); word-break: break-word; }
.whois-ns { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.whois-backorder { background: var(--ts-soft); border-radius: 12px; padding: 1rem; }
.whois-backorder.is-hot { background: #FFF4D6; border: 1px solid #FFD66B; }
.xsell-card { position: relative; border: 1px solid var(--ts-line); border-radius: 14px; padding: 1.1rem; height: 100%; display: flex; flex-direction: column; }
.xsell-card.is-popular { border-color: var(--ts-primary); box-shadow: 0 10px 30px rgba(248, 120, 0, .12); }
.xsell-ribbon { position: absolute; top: -10px; right: 12px; background: var(--ts-green); color: #fff; font-size: .7rem; font-weight: 700; padding: .2rem .6rem; border-radius: 100px; }
.xsell-service { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ts-muted); }
.xsell-name { font-weight: 700; color: var(--ts-dark); font-size: 1.05rem; }
.xsell-price { font-size: 1.25rem; font-weight: 800; color: var(--ts-primary); }
.xsell-price small { font-size: .75rem; font-weight: 400; color: var(--ts-muted); }
.xsell-features { list-style: none; padding: 0; margin: .5rem 0 1rem; font-size: .85rem; flex: 1; }
.xsell-features li { margin-bottom: .3rem; }
.xsell-features i { color: var(--ts-green); margin-right: .35rem; }

/* ---------- Giỏ hàng dính ---------- */
.dcart { position: fixed; left: 18px; bottom: 18px; z-index: 1040; width: 340px; max-width: calc(100vw - 36px); }
.dcart[hidden] { display: none !important; }
.dcart-box { background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(35, 38, 43, .22); overflow: hidden; display: flex; flex-direction: column-reverse; }
.dcart-toggle { width: 100%; border: 0; background: var(--ts-dark); color: #fff; display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; text-align: left; }
.dcart-icon { position: relative; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--ts-primary), var(--ts-accent)); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; }
.dcart-count { position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #fff; color: var(--ts-dark); font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.dcart-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.dcart-text small { color: var(--ts-accent); font-weight: 600; }
.dcart-cta { background: var(--ts-primary); color: #fff; border-radius: 100px; padding: .3rem .8rem; font-size: .85rem; font-weight: 600; }
.dcart-chevron { transition: transform .2s; }
.dcart.is-open .dcart-chevron { transform: rotate(180deg); }
.dcart-panel { display: none; }
.dcart.is-open .dcart-panel { display: block; }
.dcart-head { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem .4rem; font-weight: 700; color: var(--ts-dark); }
.dcart-lines { list-style: none; margin: 0; padding: 0 1rem; max-height: 280px; overflow-y: auto; }
.dcart-lines li { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem 0; border-bottom: 1px dashed var(--ts-line); font-size: .9rem; }
.dcart-lines .l-name { font-weight: 600; color: var(--ts-dark); word-break: break-all; line-height: 1.3; }
.dcart-lines .l-desc { font-size: .75rem; color: var(--ts-muted); line-height: 1.3; }
.dcart-lines .l-price { white-space: nowrap; font-weight: 600; color: var(--ts-primary); text-align: right; }
.dcart-lines .l-price s { display: block; color: var(--ts-muted); font-weight: 400; font-size: .75rem; }
.dcart-lines .l-remove { border: 0; background: none; color: var(--ts-muted); padding: 0 0 0 .35rem; }
.dcart-lines .l-remove:hover { color: #e2445c; }
.dcart-foot { padding: .8rem 1rem 1rem; }
.dcart-backdrop { display: none; }
.dcart.is-bump .dcart-icon { animation: dcart-bump .5s; }
@keyframes dcart-bump { 30% { transform: scale(1.25); } 60% { transform: scale(.92); } }
.dcart-sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--ts-line); margin: .5rem auto 0; }

.dtoast { position: fixed; left: 50%; top: 96px; transform: translate(-50%, -12px); opacity: 0; visibility: hidden; z-index: 1090; background: var(--ts-dark); color: #fff; padding: .6rem 1.1rem; border-radius: 100px; font-size: .9rem; box-shadow: var(--ts-shadow); transition: transform .25s, opacity .25s, visibility .25s; max-width: calc(100vw - 32px); pointer-events: none; }
.dtoast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.dtoast.error { background: #b42336; }

@media (max-width: 767.98px) {
    .dcart { left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; }
    .dcart-box { border-radius: 16px 16px 0 0; flex-direction: column-reverse; }
    .dcart-toggle { padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); }
    .dcart-chevron { display: none; }
    .dcart-panel { max-height: 70vh; overflow-y: auto; }
    .dcart-lines { max-height: 45vh; }
    .dcart.is-open .dcart-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: -1; }
    body.has-dcart { padding-bottom: 72px; }
    body.has-dcart .float-contact { bottom: 84px; }
    .dres-item { padding: .75rem .9rem; }
    .dres-actions { width: 100%; justify-content: space-between; }
}
