/* AHdigital — "Sinab ko'ring" bo'limi va AI suhbat oynasi. Ranglar style.css dagi tokenlardan olinadi. */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Sinab ko'ring ---------- */
.try { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--s8); align-items: center; }
.try-copy { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; min-width: 0; }
.try-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); width: 100%; margin-top: var(--s4); }
.try-form .field:first-child, .try-form .btn { grid-column: 1 / -1; }
.try-form .label { font-weight: 600; font-size: 14px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--divider); cursor: pointer; transition: transform .15s; }
.swatch:hover { transform: scale(1.1); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--text); }
.swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Telefon ko'rinishidagi namuna — ichidagi ranglar foydalanuvchi tanlagan rang (sayt mavzusidan qat'i nazar) */
.phone { justify-self: center; width: min(100%, 320px); aspect-ratio: 9 / 18.5; max-width: 100%; border-radius: 44px; padding: 12px;
  background: #1b1a1f; box-shadow: var(--shadow), inset 0 0 0 2px #3a3940; position: relative; }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; translate: -50% 0; width: 86px; height: 22px; border-radius: 999px; background: #000; z-index: 2; }
.phone-screen { --v-main: #c67139; --v-soft: #fff2eb; height: 100%; border-radius: 34px; overflow: hidden; background: #ffffff; color: #201e1d;
  display: flex; flex-direction: column; font-family: var(--font-body); }
.phone-screen.pop { animation: vpop .35s ease; }
@keyframes vpop { from { opacity: .4; transform: scale(.985); } to { opacity: 1; transform: none; } }
.v-hero { background: var(--v-main); color: #fff; padding: 56px 20px 22px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.v-icon { font-size: 34px; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.v-name { font-family: var(--font-heading); font-size: 26px; line-height: 1.1; overflow-wrap: anywhere; }
.v-tag { font-size: 13px; opacity: .9; }
.v-list { padding: 16px 18px 8px; display: flex; flex-direction: column; gap: 8px; }
.v-title { font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--v-main); }
.v-row { display: flex; justify-content: space-between; gap: 10px; background: var(--v-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.v-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.v-btns { padding: 8px 18px; display: grid; gap: 8px; }
.v-btn { background: var(--v-main); color: #fff; border-radius: 999px; padding: 11px; text-align: center; font-weight: 700; font-size: 14px; }
.v-btn-ghost { background: transparent; color: var(--v-main); box-shadow: inset 0 0 0 2px var(--v-main); }
.v-map { margin-top: auto; padding: 12px 18px 22px; font-size: 12px; color: #6b655c; text-align: center; }

@media (max-width: 820px) { .try { grid-template-columns: 1fr; } .try-form { grid-template-columns: 1fr; } }

/* ---------- AI suhbat oynasi ---------- */
.chat { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50; font-family: var(--font-body); }
.chat-fab { display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; background: var(--accent); color: var(--on-accent);
  font: 700 15px var(--font-body); padding: 14px 20px; border-radius: 999px; box-shadow: var(--shadow); transition: transform .15s, background .15s; }
.chat-fab:hover { background: var(--accent-hover); transform: translateY(-2px); }
.chat-fab:focus-visible, .chat-close:focus-visible, .chat-send:focus-visible, .chat-quick button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.chat-panel { position: absolute; right: 0; bottom: 64px; width: min(360px, calc(100vw - 32px)); height: min(520px, calc(100vh - 120px));
  display: flex; flex-direction: column; background: var(--bg); color: var(--text); border-radius: 24px; box-shadow: var(--shadow); border: 1px solid var(--divider); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); }
.chat-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.chat-close { border: 0; background: transparent; color: var(--text); font-size: 18px; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.chat-close:hover { background: var(--divider); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.bot { background: var(--surface); align-self: flex-start; border-bottom-left-radius: 6px; }
.chat-msg.me { background: var(--accent); color: var(--on-accent); align-self: flex-end; border-bottom-right-radius: 6px; }
.chat-msg.typing { color: var(--muted); font-style: italic; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.chat-quick[hidden] { display: none; }
.chat-quick button { border: 1px solid var(--divider); background: var(--pill-bg); color: var(--text); border-radius: 999px; padding: 6px 12px; font: 600 13px var(--font-body); cursor: pointer; }
.chat-quick button:hover { background: var(--pill-hover); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--divider); }
.chat-input { flex: 1; min-width: 0; border: 1px solid var(--divider); background: var(--pill-bg); color: var(--text); border-radius: 999px; padding: 10px 14px; font: 15px var(--font-body); }
.chat-input:focus-visible { outline: none; border-color: var(--accent); }
.chat-send { border: 0; width: 42px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 16px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .phone-screen.pop { animation: none; } .chat-fab, .swatch { transition: none; } }

/* ---------- Ishlarim: Reels ---------- */
#ishlar { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.reels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); width: 100%; margin-top: var(--s4); }
.reel { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.reel video { width: 100%; max-width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 22px; background: var(--surface); cursor: pointer;
  box-shadow: var(--shadow); transition: transform .25s ease; display: block; }
.reel video:hover { transform: translateY(-4px) rotate(-.6deg); }
.reel figcaption { font-weight: 600; font-size: 14px; color: var(--muted); }
@media (max-width: 820px) { .reels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Oldin / hozir ---------- */
.ba-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--s8); align-items: center; width: 100%; margin-top: var(--s8); }
.ba-copy { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.ba-copy p { color: var(--muted); line-height: 1.6; margin: 0; }
.ba { position: relative; aspect-ratio: 3 / 4; max-width: 100%; max-height: 640px; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); justify-self: center; width: min(100%, 480px); }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; max-width: none; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 4px; translate: -2px 0; background: var(--accent); pointer-events: none; }
.ba-handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: var(--shadow); }
.ba-label { position: absolute; top: 14px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: rgba(32,30,29,.75); color: #fff; pointer-events: none; }
.ba-l { left: 14px; } .ba-r { right: 14px; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-range:focus-visible + * , .ba:has(.ba-range:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 820px) { .ba-wrap { grid-template-columns: 1fr; } }

/* ---------- Narx kalkulyatori ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .9fr); gap: var(--s6); align-items: start;
  margin-top: var(--s8); padding: var(--s6); border-radius: var(--r-lg); background: var(--surface); }
.calc[hidden] { display: none; }
.calc-title { font-family: var(--font-heading); font-weight: 400; font-size: 30px; margin: 0; text-wrap: balance; }
.calc-copy p { color: var(--muted); margin: 8px 0 0; line-height: 1.55; }
.calc-rows { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.calc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--bg); border: 2px solid transparent; transition: border-color .15s; }
.calc-row.on { border-color: var(--accent); }
.calc-name { display: flex; flex-direction: column; min-width: 0; }
.calc-name small { color: var(--muted); font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--divider); background: var(--surface); color: var(--text); font-size: 18px; cursor: pointer; }
.stepper button:hover { background: var(--accent-soft); }
.stepper button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper output { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-total { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 90px; }
.calc-total span { color: var(--muted); font-weight: 600; }
.calc-total strong { font-family: var(--font-heading); font-weight: 400; font-size: 38px; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-total small { color: var(--accent-ink); line-height: 1.45; min-height: 1em; }
@media (max-width: 980px) { .calc { grid-template-columns: 1fr; } .calc-total { position: static; } }

/* ---------- Aylantirganda chiqib kelish (kontent doim ko'rinadi) ---------- */
.rise { transform: translateY(22px); transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.rise.in { transform: none; }
.card { transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card.rise.in:hover { transform: translateY(-4px); }

/* ---------- Telefonda pastki tugma ---------- */
.m-cta { display: none; }
@media (max-width: 700px) {
  .m-cta { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; text-align: center; text-decoration: none;
    padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; box-shadow: 0 -8px 24px rgba(0,0,0,.15);
    transform: translateY(110%); transition: transform .25s ease; }
  .m-cta.show { transform: none; }
  body.has-m-cta .chat { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  /* Telefonda chat tugmasi faqat belgi — sahifadagi tugmalarni yopib qo'ymasin */
  .chat-fab { font-size: 0; gap: 0; padding: 14px; }
  .chat-fab span { font-size: 22px; line-height: 1; }

  /* Bosh sahifani telefonda ixchamlash */
  /* Xizmat kartalari — yonga suriladigan qator (keyingi karta chetdan ko'rinib turadi) */
  #service-groups .cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
    margin-inline: -16px; padding: 4px 16px 14px; scroll-padding-inline: 16px; scrollbar-width: none; }
  #service-groups .cards::-webkit-scrollbar { display: none; }
  #service-groups .card { flex: 0 0 84%; scroll-snap-align: start; }
  /* Ish jarayoni — 2 × 2 */
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .step { padding: 16px; border-radius: 20px; }
  .step h3 { font-size: 18px; }
  .step p { font-size: 14px; }
  /* Men haqimda — kichikroq rasm */
  .about-img { max-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .rise { transform: none !important; transition: none; }
  .reel video, .card, .m-cta { transition: none; }
  .reel video:hover, .card:hover { transform: none; }
}
