/* Page layouts for Голос Маркет. Every colour, font, radius and shadow comes from tokens.css. */

.narrow { max-width: 760px; }
.sec { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.sec-note { margin-top: var(--space-4); }
.lead { font-size: var(--text-xl); line-height: var(--line-text); margin: var(--space-3) 0; }
.note { color: var(--accent-ink); background: var(--accent-soft); border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.code { font-family: var(--font-mono); background: var(--surface-2); border: var(--border-width) solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); overflow-wrap: anywhere; margin: var(--space-2) 0 var(--space-4); }
.bullets { padding-left: var(--space-5); line-height: var(--line-text); margin: 0 0 var(--space-5); }
.stack { display: grid; gap: var(--space-4); }
.stack-s { display: grid; gap: var(--space-2); }
.fld { display: grid; gap: var(--space-1); }
.fset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.fset legend { padding: 0; margin-bottom: var(--space-1); }

/* Home */
.hero { padding: var(--space-7) 0; }
.hero-in { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-6); align-items: center; }
.hero-title { font-size: var(--text-hero); color: var(--accent-ink); }
.hero-lead { font-size: var(--text-xl); margin: var(--space-3) 0 var(--space-5); color: var(--muted); }
.hero-search { display: flex; gap: var(--space-2); max-width: 520px; }
.hero-search .field { height: var(--control-h); }
.voice-cta { height: 72px; font-size: var(--text-2xl); gap: var(--space-3); justify-self: center; padding: 0 var(--space-6); }
.voice-cta svg { width: 32px; height: 32px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.tile { display: grid; justify-items: center; align-content: center; gap: var(--space-3); min-height: 170px; padding: var(--space-4); text-align: center; border-radius: var(--radius); border: var(--border-width) solid var(--line-soft); background: radial-gradient(circle at 50% 35%, var(--slot-bg-2), var(--slot-bg) 75%); color: var(--slot-ink); font-size: var(--text-lg); }
.tile svg { width: 64px; height: 64px; opacity: .85; }
.tile:hover { border-color: var(--accent); color: var(--accent-ink); }

/* Photo slots keep the Eco size; the category icon is large */
.photo-slot svg { width: 72px; height: 72px; }
.photo-slot .slot-name { font-size: var(--text-lg); }
.pcard-photo .photo-slot { min-height: 0; }
.pcard-info .muted { font-size: var(--text-sm); }
@media (max-width: 760px) {
  .photo-slot svg { width: 48px; height: 48px; }
  .photo-slot .slot-name { font-size: var(--text-sm); }
  .pcard-buy { flex-wrap: wrap; gap: var(--space-2); }
  .pcard-buy .counter { display: inline-flex; height: 36px; }
  .pcard-buy .counter input { width: 40px; }
}
@media (hover: none) {
  .pcard-more { position: static; visibility: visible; opacity: 1; }
}

/* Grid: four columns on desktop, two on phones */
.pgrid { --cols: 4; }
@media (max-width: 1100px) { .pgrid { --cols: 3; } }
@media (max-width: 760px) { .pgrid { --cols: 2; } .hero-in { grid-template-columns: 1fr; } .hero { padding: var(--space-5) 0; } }
.voice-right .pgrid { --cols: 2; }

/* Catalog */
.cat-page { padding-top: var(--space-6); padding-bottom: var(--space-7); }
.cat-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); }
.cat-layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-5); align-items: start; }
.cat-main > p { margin-bottom: var(--space-3); }
.filters { background: var(--surface); border: var(--border-width) solid var(--line); border-radius: var(--radius); padding: var(--space-4); }
.filters form { display: grid; gap: var(--space-3); }
.filters-head { display: flex; justify-content: space-between; align-items: center; }
.filters-actions { display: flex; gap: var(--space-2); }
.filters .fset { max-height: 280px; overflow: auto; }
.filter-btn { display: none; gap: var(--space-2); }
.filter-btn svg { width: 20px; height: 20px; }
@media (max-width: 980px) {
  .cat-layout { grid-template-columns: 1fr; }
  .filter-btn { display: inline-flex; }
  .filters { position: fixed; z-index: 62; top: 0; bottom: 0; left: 0; width: min(340px, 90vw); overflow: auto; border-radius: 0; transform: translateX(-100%); visibility: hidden; box-shadow: var(--shadow-pop); }
  .filters.open { transform: none; visibility: visible; transition: transform .2s; }
  #filterScrim { z-index: 61; }
}

/* Cart */
.cart-box { max-width: 900px; }
.cart-list { border: var(--border-width) solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }
.cart-row { display: grid; grid-template-columns: 90px 1fr auto 130px 40px; gap: var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); }
.cart-row + .cart-row { border-top: var(--border-width) solid var(--line-soft); }
.cart-ph { width: 90px; height: 90px; }
.cart-ph .photo-slot { min-height: 0; padding: var(--space-1); }
.cart-ph .photo-slot svg { width: 40px; height: 40px; }
.cart-ph .slot-name { display: none; }
.cart-name { display: grid; gap: var(--space-1); }
.cart-sum { text-align: right; }
.cart-foot { display: grid; gap: var(--space-3); margin-top: var(--space-4); justify-items: end; }
.cart-foot .note { justify-self: stretch; }
.cart-total { display: flex; gap: var(--space-4); align-items: baseline; font-size: var(--text-xl); }
.cart-total b { color: var(--price); }
.cart-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: flex-end; }
.mini-lines { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-2); }
.mini-lines li { display: flex; justify-content: space-between; gap: var(--space-4); border-bottom: var(--border-width) solid var(--line-soft); padding-bottom: var(--space-2); }
@media (max-width: 760px) {
  .cart-row { grid-template-columns: 64px 1fr auto; grid-template-areas: "ph name del" "ph qty sum"; gap: var(--space-2) var(--space-3); padding: var(--space-3); }
  .cart-ph { grid-area: ph; width: 64px; height: 64px; }
  .cart-name { grid-area: name; }
  .cart-row > .icon-btn { grid-area: del; }
  .cart-row .counter { grid-area: qty; justify-self: start; }
  .cart-sum { grid-area: sum; }
  .cart-ph .photo-slot svg { width: 28px; height: 28px; }
  .cart-actions { justify-content: stretch; }
}

/* Toast */
.toast { position: fixed; left: 50%; bottom: var(--space-5); transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); padding: var(--space-3) var(--space-4); border-radius: var(--radius); box-shadow: var(--shadow-pop); max-width: 90vw; }

/* Voice page */
.voice { display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--space-6); padding-top: var(--space-6); padding-bottom: var(--space-7); align-items: start; }
.voice-left, .voice-right { display: grid; gap: var(--space-4); align-content: start; }
.mic { display: grid; place-items: center; align-content: center; gap: var(--space-2); width: 220px; height: 220px; margin: var(--space-3) auto; border-radius: var(--radius-round); border: var(--border-width) solid var(--accent); background: var(--accent); color: var(--accent-fg); cursor: pointer; font-size: var(--text-lg); text-align: center; padding: var(--space-4); transition: background .15s, box-shadow .15s; }
.mic svg { width: 64px; height: 64px; }
.mic:hover { background: var(--accent-hover); }
.mic[data-state="listening"] { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-card); }
.mic[data-state="speaking"] { background: var(--accent-soft); color: var(--accent-ink); }
.mic[data-state="connecting"] { background: var(--surface-2); color: var(--muted); border-color: var(--line); cursor: progress; }
.mic[data-state="listening"] svg { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .mic[data-state="listening"] svg { animation: none; } }
#endBtn { justify-self: center; }
#voiceNote { text-align: center; }
.transcript { display: grid; gap: var(--space-2); max-height: 320px; overflow: auto; border: var(--border-width) solid var(--line-soft); border-radius: var(--radius); padding: var(--space-3); background: var(--surface); min-height: 80px; }
.line { display: grid; gap: 2px; }
.line b { font-size: var(--text-sm); color: var(--muted); font-weight: 400; }
.line.olya b { color: var(--accent-ink); }
.typed { display: grid; gap: var(--space-1); }
.typed-row { display: flex; gap: var(--space-2); }
.typed-row .btn { gap: var(--space-2); }
.typed-row svg { width: 18px; height: 18px; }
.shown { min-height: 80px; }
.box { border: var(--border-width) solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-4); display: grid; gap: var(--space-3); }
.voice-right .cart-row { grid-template-columns: 64px 1fr; grid-template-areas: "ph name" "ph qty" "ph sum"; }
.voice-right .cart-row > .icon-btn { display: none; }
.voice-right .cart-name { grid-area: name; }
.voice-right .cart-ph { grid-area: ph; width: 64px; height: 64px; }
.voice-right .cart-row .counter { grid-area: qty; justify-self: start; }
.voice-right .cart-sum { grid-area: sum; text-align: left; }
@media (max-width: 980px) { .voice { grid-template-columns: 1fr; } .mic { width: 180px; height: 180px; } }

/* shop.css .sec resets the side padding of a container that is also a section */
.container.sec { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
@media (max-width: 760px) { .container.sec { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); } }

.demo-note { border-left: 4px solid var(--warn); background: var(--accent-soft); color: var(--ink); font-size: var(--text-lg); }
.test-banner { border-left: 4px solid var(--warn); background: var(--accent-soft); color: var(--ink); font-size: var(--text-xl); text-align: center; }
.charge-line { margin: var(--space-2) 0 0; font-size: var(--text-xl); }
.table-wrap { overflow-x: auto; }
.otable { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
.otable th, .otable td { text-align: left; padding: var(--space-3) var(--space-3); border-bottom: var(--border-width) solid var(--line-soft); vertical-align: middle; }
.otable th { color: var(--muted, var(--ink)); font-size: var(--text-sm); }
.otable td[data-status="paid"] { color: var(--accent-ink); font-weight: 700; }
