/* Trang "Tự thiết kế website" (js/builder.js) */
#builder [hidden] { display: none !important; }

/* Bước 1: chọn ngành */
.bd-start { padding: 56px 0 96px; }
.bd-start h1 { font-size: clamp(34px, 5vw, 64px); line-height: 1.05; letter-spacing: -.04em; margin: 14px 0 18px; max-width: 900px; }
.bd-lead { font-size: 17px; color: var(--sub); max-width: 680px; }
.bd-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 28px 0 40px; font-weight: 500; }
.bd-steps li { display: flex; align-items: center; gap: 10px; }
.bd-steps b { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; }
.bd-inds { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.bd-ind { text-align: left; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: transform .35s var(--ease), box-shadow .3s; }
.bd-ind:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--ink), 0 18px 40px -24px rgba(0,0,0,.4); }
.bd-ind img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; background: var(--soft); }
.bd-ind span { display: block; padding: 12px 14px 14px; font-weight: 600; font-size: 14.5px; }

/* Bước 2: trình thiết kế */
.bd-app { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 69px); height: calc(100dvh - 69px); border-top: 1px solid var(--line); }
.bd-panel { background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.bd-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.bd-head small { display: block; font-size: 12px; color: var(--mute); }
.bd-head b { font-size: 15px; }
.bd-back { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.bd-back:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.bd-tabs { display: grid; grid-template-columns: repeat(3, 1fr); position: sticky; top: 0; z-index: 2; background: var(--card); border-bottom: 1px solid var(--line); }
.bd-tabs button { padding: 13px 6px; font-size: 14px; font-weight: 600; color: var(--sub); border-bottom: 2px solid transparent; }
.bd-tabs button[aria-selected=true] { color: var(--ink); border-color: var(--ink); }
.bd-pane { padding: 18px; }
.bd-pane h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--sub); margin: 22px 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bd-pane h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--mute); }
.bd-note { font-size: 13.5px; color: var(--sub); margin-bottom: 12px; }
.bd-field { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--sub); }
.bd-field select, .bd-field input { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 0 10px; color: var(--ink); font-size: 14px; min-width: 0; }
.bd-field select:focus, .bd-field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.bd-check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-top: 4px; }

.bd-heroes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bd-hero { border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); text-align: left; background: #fff; }
.bd-hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; background: var(--soft); }
.bd-hero span { display: block; padding: 6px 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-hero-ph { display: grid; place-items: center; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--soft), #E4E6F5); font: italic 400 18px/1 "Newsreader", serif; color: var(--sub); }
.bd-hero.on { box-shadow: 0 0 0 2px var(--accent); }

.bd-blocks { list-style: none; display: grid; gap: 6px; }
.bd-blk { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 8px 8px 6px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow .2s, opacity .2s; }
.bd-blk:not(.fixed) { cursor: grab; }
.bd-blk.on { box-shadow: inset 0 0 0 2px var(--accent); }
.bd-blk.drag { opacity: .45; }
.bd-blk.over { box-shadow: inset 0 3px 0 var(--accent), inset 0 0 0 1px var(--line); }
.bd-blk.fixed { background: var(--soft); }
.bd-grip { color: var(--mute); text-align: center; font-size: 13px; letter-spacing: -2px; }
.bd-blk-b { min-width: 0; display: grid; gap: 4px; }
.bd-blk-b b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-blk-b small { font-size: 12.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-blk-b select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; padding: 0 6px; min-width: 0; width: 100%; }
.bd-blk-a { display: flex; gap: 2px; }
.bd-blk-a button { width: 28px; height: 28px; border-radius: 8px; color: var(--sub); font-size: 13px; }
.bd-blk-a button:hover { background: var(--soft); color: var(--ink); }
.bd-add { width: 100%; margin-top: 12px; height: 42px; }
.bd-lib { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--soft); }
.bd-lib-g { margin-bottom: 12px; }
.bd-lib-g b { display: block; font-size: 13px; margin-bottom: 6px; }
.bd-lib-g div { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-lib-g button { padding: 6px 10px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; text-align: left; }
.bd-lib-g button:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.bd-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bd-sw { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); text-align: left; min-width: 0; }
.bd-sw i { display: flex; flex: none; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.bd-sw em { width: 12px; height: 26px; }
.bd-sw span { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-sw.on { box-shadow: inset 0 0 0 2px var(--accent); }
.bd-more { margin-top: 10px; font-size: 13.5px; text-decoration: underline; color: var(--sub); }
.bd-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); }
.bd-seg button { padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--sub); }
.bd-seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.bd-knobs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.bd-knobs .bd-check { grid-column: 1 / -1; }

.bd-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--soft); }
.bd-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.bd-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-share { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #EEF0FF; font-size: 13.5px; flex-wrap: wrap; }
.bd-share input { flex: 1; min-width: 180px; height: 36px; border-radius: 9px; border: 1px solid var(--line); padding: 0 10px; background: #fff; }
.bd-frame { flex: 1; min-height: 0; padding: 16px; display: flex; justify-content: center; }
.bd-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 24px 60px -36px rgba(0,0,0,.45); transition: width .4s var(--ease); }
.bd-frame.mobile iframe { width: 390px; max-width: 100%; border-radius: 28px; box-shadow: 0 0 0 10px #111, 0 30px 60px -30px rgba(0,0,0,.5); }

@media (max-width: 900px) {
  .bd-start { padding: 36px 0 64px; }
  .bd-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; }
  .bd-stage { order: -1; height: 72vh; height: 72dvh; }
  .bd-panel { border-right: 0; overflow: visible; }
  .bd-frame { padding: 8px; }
  .bd-frame.mobile iframe { box-shadow: 0 0 0 6px #111; }
  .bd-device { display: none; }
  .bd-bar { padding: 8px 12px; }
  .bd-acts { width: 100%; }
  .bd-acts .btn { flex: 1; }
}
@media (max-width: 560px) {
  .bd-inds { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bd-ind span { font-size: 13px; padding: 10px; }
}

/* Các bước hỏi đáp (tên cửa hàng, chọn kiểu) */
.bd-q { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.15; letter-spacing: -.03em; margin: 10px 0 10px; }
.bd-start .bd-q { margin-bottom: 20px; }
.bd-step { padding: 40px 0 96px; }
.bd-narrow { max-width: 640px; }
.bd-prev { display: block; margin-bottom: 26px; color: var(--sub); font-size: 14px; }
.bd-prev:hover { color: var(--ink); }
.bd-name { margin-top: 26px; display: grid; gap: 6px; }
.bd-name .bd-field { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.bd-name .bd-field small { color: var(--mute); font-weight: 400; }
.bd-name .bd-field input { height: 54px; font-size: 17px; border-radius: 14px; padding: 0 16px; }
.bd-name-a { display: flex; align-items: center; gap: 20px; margin-top: 8px; flex-wrap: wrap; }
.bd-name-a .btn { height: 52px; padding: 0 28px; font-size: 15.5px; }
.bd-name-a .lnk { color: var(--sub); text-decoration: underline; }
.bd-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 28px; }
.bd-pick { text-align: left; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: transform .35s var(--ease), box-shadow .3s; }
.bd-pick:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--ink), 0 20px 44px -26px rgba(0,0,0,.45); }
.bd-pick img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; background: var(--soft); }
.bd-pick span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 12px 14px; }
.bd-pick b { font-size: 15px; }
.bd-pick small { color: var(--sub); font-size: 13px; }
.bd-more-picks { margin: 26px auto 0; display: flex; }

/* Chế độ đơn giản trong bảng bên trái */
.bd-simple { padding: 6px 18px 24px; }
.bd-sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.bd-sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--sub); margin-bottom: 12px; }
.bd-cur { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 12px; }
.bd-cur img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.bd-cur b { display: block; font-size: 15px; line-height: 1.3; }
.bd-cur small { color: var(--sub); font-size: 13px; }
.bd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd-row .btn { padding: 0 10px; }
.bd-all { margin-top: 10px; font-size: 13.5px; color: var(--sub); text-decoration: underline; }
.bd-dots { display: flex; flex-wrap: wrap; gap: 10px; }
.bd-dot { width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--a) 0 50%, var(--b) 50% 75%, var(--c) 75%); box-shadow: 0 0 0 1px rgba(0,0,0,.12); transition: transform .2s; }
.bd-dot:hover { transform: scale(1.08); }
.bd-dot.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
.bd-toggles { display: grid; gap: 4px; }
.bd-tog { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14.5px; cursor: pointer; }
.bd-tog:hover { background: var(--soft); }
.bd-tog input { width: 18px; height: 18px; accent-color: var(--accent); }
.bd-cta { padding-top: 18px; display: grid; gap: 8px; text-align: center; }
.bd-cta .btn { height: 52px; font-size: 15.5px; }
.bd-cta p { font-size: 13px; color: var(--sub); }
.bd-cta .lnk { font-size: 13.5px; color: var(--sub); text-decoration: underline; margin-top: 6px; }
.bd-to-simple { display: block; padding: 12px 18px 0; font-size: 13.5px; color: var(--sub); }
@media (max-width: 560px) {
  .bd-picks { grid-template-columns: minmax(0, 1fr); }
  .bd-step { padding: 28px 0 64px; }
}
.bd-offer { display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: #EEF0FF; text-align: left; margin-bottom: 4px; }
.bd-offer small { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.bd-offer b { font-size: 20px; letter-spacing: -.02em; }
.bd-offer span { font-size: 13px; color: var(--sub); }
