:root{
  /* Colors */
  --bg: #F5F6F9;
  --card: #FFFFFF;
  --text: #0C0D0F;
  --muted: #7C828C;
  --muted2: #A1A6AE;
  --line: #E7E9EE;
  --primary: #2252EB;
  --primary-2: #3667F3;
  --primary-3: #1C49E2;

  /* Radii + shadow */
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow: 0 12px 28px rgba(17, 24, 39, 0.08);

  /* Layout */
  --tabbar-h: 70px;
  --content-pad: 16px;

  /* Typography (mobile-first) */
  --fs-header-title: 21px;
  --fs-section-title: 28px;
  --fs-section-action: 15px;

  --fs-card-title: 17px;
  --fs-card-sub: 15px;

  --fs-btn: 15px;
  --btn-h: 54px;

  --fs-search: 14px;

  --fs-tile: 14px;
  --fs-page-title: 21px;

  --fs-empty-title: 22px;
  --fs-empty-text: 15px;

  --fs-profile-name: 19px;
  --fs-list-row: 15px;

  --fs-chip: 13px;
  --fs-order-items: 14px;
  --fs-cart-title: 14px;

  --tab-icon: 22px;
  --fs-tab-label: 11px;

  /* Extra sizes */
  --fs-support-title: 28px;
  --fs-support-text: 15px;
  --fs-store-city: 19px;
  --fs-store-text: 14px;
  --fs-orders-empty-title: 17px;
  --fs-orders-empty-sub: 14px;
}

/* Slightly bigger phones / small tablets */
@media (min-width: 430px){
  :root{
    --content-pad: 18px;
    --tabbar-h: 70px;
  }
}

/* Large tablets */
@media (min-width: 768px){
  :root{
    --content-pad: 20px;
    --fs-section-title: 28px;
    --fs-section-action: 15px;
    --fs-card-title: 17px;
    --fs-btn: 15px;
    --tab-icon: 30px;
    --fs-tab-label: 13px;
  }
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }
html, body{ overscroll-behavior: none; }

html{
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Home: чуть компактнее типографика (как в остальных вкладках) */
body[data-root="home"]{
  --fs-section-title: 26px;
  --fs-section-action: 15px;
  --fs-card-title: 17px;
  --fs-card-sub: 15px;
  --fs-btn: 15px;
}

button, input, textarea{
  font: inherit;
}

a{ color: inherit; text-decoration: none; }

svg{ display: block; }

input, textarea{
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

input::placeholder, textarea::placeholder{ color: var(--muted2); }


.app{
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.header{
  padding: calc(12px + env(safe-area-inset-top, 0px)) var(--content-pad) 0 var(--content-pad);
}

.header--title{
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

.header__title{
  margin: 12px 0 8px 0;
  font-size: var(--fs-header-title);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: left;
}

.header__title--center{
  text-align: center;
  font-weight: 500;
}

.main{
  flex: 1;
  padding: 14px var(--content-pad) calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px)) var(--content-pad);
}


/* Home banner (A13-like) */
.home-hero{ margin-top: 6px; }
.home-hero__viewport{
  height: 190px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.home-hero__track{
  height: 100%;
  display: flex;
  transform: translate3d(0,0,0);
  transition: transform 0.38s ease;
  will-change: transform;
}
.home-hero__slide{ height: 100%; flex: 0 0 100%; }
.home-hero__img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.home-hero__dots{
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.home-hero__dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,0.18);
  padding: 0;
  transition: width 0.25s ease, background 0.25s ease;
}
.home-hero__dot.is-active{
  width: 18px;
  background: rgba(0,0,0,0.45);
}
@media (max-width: 380px){
  .home-hero__viewport{ height: 175px; }
}
@media (min-width: 430px){
  .home-hero__viewport{ height: 220px; }
}


.section{ margin-top: 10px; }

.section__row{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 12px;
}

.section__title{
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.section__action{
  font-size: var(--fs-section-action);
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.h-scroll{
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.h-scroll::-webkit-scrollbar{ height: 0; }

.h-scroll__inner{
  display: flex;
  gap: 14px;
  scroll-snap-type: x mandatory;
}

/* Home горизонтальная лента: 2 карточки в ряд (как на примере A13) */
.h-scroll .product-card{
  flex: 0 0 calc((100% - 14px) / 2);
  min-width: calc((100% - 14px) / 2);
  scroll-snap-align: start;
}
@media (min-width: 420px){
  .h-scroll .product-card{
    flex-basis: min(210px, calc((100% - 14px) / 2));
    min-width: min(210px, calc((100% - 14px) / 2));
  }
}
@media (min-width: 900px){
  .h-scroll .product-card{
    flex-basis: min(260px, calc((100% - 14px) / 2));
    min-width: min(260px, calc((100% - 14px) / 2));
  }
}

.product-card{
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px 16px 16px;
  min-width: 0;
}

.product-card__body{
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.product-card__media{
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.product-card__media img{
  width:100%;
  height:100%;
  object-fit: contain;
}




.product-card__name{
  font-size: 16px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.product-card__price {
  margin-top: 6px;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 16px;
}



.btn-cart{
  margin-top: 12px;
  width: 100%;
  height: 44px;
  border-radius: 14px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  font-weight: 700;
  font-size: 15px;
  box-shadow: none;
}
.btn-cart:hover{ background: rgba(43,92,255,0.06); }
.btn-cart:active{ background: rgba(43,92,255,0.10); transform: translateY(1px); }

.product-card__title {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 34px;
}


.product-card__sub{
  margin: 10px 0 14px 0;
  font-size: var(--fs-card-sub);
  line-height: 1.18;
  color: var(--primary);
  font-weight: 500;
}

.icon-btn{
  border: 0;
  background: transparent;
  padding: 8px;
  cursor: pointer;
}

.fav-btn{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.fav-btn svg{
  width: 24px;
  height: 24px;
  color: #0E1B3A;
  display: block;
}

.fav-btn.is-active svg{ color: var(--primary); }

/* Base button (used by product cards) */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Primary / filled */
.btn-primary{
  border: 0;
  width: 100%;
  height: var(--btn-h);
  border-radius: 24px;
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  color: #fff;
  font-size: var(--fs-btn);
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(34, 82, 235, 0.28);
  cursor: pointer;
}

.btn-primary:active{ transform: translateY(1px); }

.btn-secondary{
  border: 0;
  width: 100%;
  height: var(--btn-h);
  border-radius: 24px;
  background: #EAF0FF;
  color: var(--primary);
  font-size: var(--fs-btn);
  font-weight: 600;
  cursor: pointer;
}

.search-row{
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.search{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

.search svg{
  width: 22px;
  height: 22px;
  color: var(--primary);
  display: block;
}

.search input{
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: var(--fs-search);
  line-height: 1.2;
}

.search input::placeholder{ color: var(--muted2); }

.round-btn{
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: var(--card);
  border: 0;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.round-btn svg{
  width: 26px;
  height: 26px;
  color: var(--primary);
  display: block;
}

.grid{
  display: grid;
  gap: 14px;
}

.grid--2{
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.grid--3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tile{
  background: var(--card);
  border-radius: var(--radius-lg);
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
  cursor: pointer;
}

.tile__inner{ width: 100%; }

.tile__img {
  margin-bottom: 10px;
  width: 72px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}


.tile__img img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tile__label {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}


.tile__logo-text{
  font-size: var(--fs-tile);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #000;
  text-transform: none;
}

.page-title{
  text-align: center;
  font-size: var(--fs-page-title);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 18px 0 0 0;
}

.empty{
  height: calc(100vh - 220px);
  min-height: 440px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 26px 12px;
}

.empty__circle{
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: #E8ECF6;
  display: grid;
  place-items: center;
  margin: 0 auto 18px auto;
}

.empty__circle svg{
  width: 62px;
  height: 62px;
  color: var(--primary);
  display: block;
}

.empty__title{
  margin: 0;
  font-size: var(--fs-empty-title);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.empty__text{
  margin: 12px 0 28px 0;
  font-size: var(--fs-empty-text);
  line-height: 1.28;
  color: var(--muted);
  font-weight: 600;
}

/* Support screen */
.support__title{
  margin: 0;
  font-size: var(--fs-support-title);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.support__text{
  margin: 12px 0 28px 0;
  font-size: var(--fs-support-text);
  line-height: 1.3;
  color: var(--muted);
  font-weight: 600;
}

/* Stores */
.store__city{
  font-size: var(--fs-store-city);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.store__text{
  font-size: var(--fs-store-text);
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

/* Orders empty */
.orders-empty__title{
  margin: 0;
  font-size: var(--fs-orders-empty-title);
  font-weight: 600;
  color: var(--muted);
}

.orders-empty__sub{
  margin-top: 6px;
  font-size: var(--fs-orders-empty-sub);
  font-weight: 500;
  color: var(--muted2);
}

.profile{ padding-top: 14px; }

.avatar{
  width: 124px;
  height: 124px;
  border-radius: 999px;
  background: #DDE3F2;
  margin: 0 auto;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}

.avatar img{ width: 100%; height: 100%; object-fit: cover; }

.avatar__initials{
  font-size: 38px;
  font-weight: 900;
  color: #243B72;
}

.profile__name{
  text-align: center;
  margin: 14px 0 20px;
  font-size: var(--fs-profile-name);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.list{
  background: var(--card);
  border-radius: 0;
  overflow: hidden;
}

.list-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--content-pad);
  border-top: 1px solid var(--line);
  cursor: pointer;
  background: var(--bg);
}

.list-row:first-child{ border-top: 0; }

.list-row__label{
  font-size: var(--fs-list-row);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.list-row__chev{
  width: 18px;
  height: 18px;
  border-right: 3px solid var(--primary);
  border-top: 3px solid var(--primary);
  transform: rotate(45deg);
  border-radius: 2px;
}

.chips{
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0 6px;
}
.chips::-webkit-scrollbar{ height: 0; }

.chip{
  border: 0;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: var(--fs-chip);
  font-weight: 700;
  background: #EAF0FF;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}

.chip.is-active{ background: var(--primary); color: #fff; }

.order-card{
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
  margin-top: 14px;
}

.order-card__top{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.badge{
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 999px;
  background: #EAF0FF;
  color: var(--primary);
  display: block;
}

.badge--ok{ background: #EAF8EF; color: #14804A; }
.badge--progress{ background: #EAF0FF; color: var(--primary); }
.badge--ship{ background: #EEF2FF; color: #4F46E5; }
.badge--cancel{ background: #FEECEC; color: #B42318; }

.order-card__id{
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.order-card__items{
  margin-top: 10px;
  color: var(--text);
  font-size: var(--fs-order-items);
  line-height: 1.3;
  font-weight: 600;
}

.cart-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.cart-item{
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
  padding: 12px;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: center;
}

.cart-item__img{
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #F0F2F8;
  overflow: hidden;
}
.cart-item__img img{ width: 100%; height: 100%; object-fit: contain; }

.cart-item__title{
  margin: 0;
  font-size: var(--fs-cart-title);
  font-weight: 600;
  line-height: 1.18;
}

.cart-item__sub{
  margin: 6px 0 0 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.qty{
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty button{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 0;
  background: #EAF0FF;
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.qty span{
  min-width: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
}

.trash{
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  color: var(--muted);
}
.trash svg{ width: 22px; height: 22px; }

.cart-footer{ margin-top: 16px; }

.note{
  text-align: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

/* Tab bar */
.tabbar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(231,233,238,0.9);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 50;
}

.tab{
  border: 0;
  background: transparent;
  padding: 8px 6px 8px;
  display: grid;
  gap: 5px;
  justify-items: center;
  align-content: start;
  cursor: pointer;
  color: var(--muted2);
}

.tab__icon{
  width: var(--tab-icon);
  height: var(--tab-icon);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab__icon svg{ width: var(--tab-icon); height: var(--tab-icon); }

.tab__label{
  font-size: var(--fs-tab-label);
  font-weight: 500;
}

.tab.is-active{ color: var(--primary); }

.tab.is-active .tab__label{
  color: #0C0D0F;
  font-weight: 600;
}

.tabbar__active-indicator{
  position: absolute;
  top: 0;
  height: 2px;
  width: 20%;
  left: 0;
  background: var(--primary);
  border-radius: 999px;
  transition: transform 220ms ease;
}

/* Toast */
.toast{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast__inner{
  background: rgba(16, 24, 40, 0.90);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 16px 34px rgba(0,0,0,0.18);
}

.toast.is-show{
  opacity: 1;
  transform: translateY(0);
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(12, 13, 15, 0.42);
  display: none;
  z-index: 120;
  padding: 18px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

.modal.is-open{ display: grid; place-items: end center; }

.sheet{
  width: 100%;
  max-width: 620px;
  background: var(--card);
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.22);
  padding: 16px;
}

.sheet__title{
  margin: 6px 0 12px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.field{
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label{
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.field input, .field textarea{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px;
  font-size: 16px;
  outline: none;
  background: #fff;
}

.field textarea{ min-height: 84px; resize: vertical; }

.sheet__row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.sheet__row button{ height: 54px; border-radius: 18px; font-size: 16px; }



/* =========================
   Route-specific scaling
   ========================= */

/* Home (Главная): make content ~1.5x smaller like A13 */
body[data-root="home"]{
  --fs-section-title: 24px;
  --fs-section-action: 16px;

  --fs-card-title: 16px;
  --fs-card-sub: 15px;

  --fs-btn: 16px;
  --btn-h: 52px;
}

body[data-root="home"] .product-card{
  padding: 14px;
  min-width: clamp(170px, 46vw, 190px);
}

body[data-root="home"] .product-card__media{
  height: 118px;
}

/* Catalog (Каталог): keep compact sizing like Home */
body[data-root="catalog"]{
  --fs-search: 14px;
  --fs-tile: 14px;
}

body[data-root="catalog"] .grid{ gap: 16px; }

body[data-root="catalog"] .search{
  padding: 14px 16px;
}

body[data-root="catalog"] .round-btn{
  width: 54px;
  height: 54px;
}

body[data-root="catalog"] .round-btn svg{
  width: 26px;
  height: 26px;
}
/* Brand grid (A13-style): 3 columns, square tiles, centered logos */
body[data-root="catalog"] .brand-grid{
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px;

  max-width: 520px;
  margin: 0 auto;
}

/* Catalog tiles: stable stack (image сверху, текст снизу) */
body[data-root="catalog"] .tile{
  display: flex;
  align-items: stretch;
}

body[data-root="catalog"] .tile__inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 10px;
}

body[data-root="catalog"] .tile:not(.tile--brand) .tile__img{
  width: 100%;
  height: 86px;
  flex: 0 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

body[data-root="catalog"] .tile__label{
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: calc(14px * 1.2 * 2);

  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-root="catalog"] .tile--brand{
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-root="catalog"] .tile--brand .tile__inner{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-root="catalog"] .tile--brand .tile__img{
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-root="catalog"] .tile--brand .tile__img img{
  width: auto;
  height: auto;
  max-width: 58%;
  max-height: 58%;
  object-fit: contain;
  display: block;
}



html, body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, textarea, select {
  caret-color: var(--primary);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

input, textarea { -webkit-user-select: text; user-select: text; }

button, a { touch-action: manipulation; }


/* iOS WebView input caret/typing fixes (Telegram / WKWebView) */
html, body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, textarea, select {
  caret-color: var(--text) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  cursor: text;
}
input[type="search"]{ -webkit-appearance: none; appearance: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input, textarea { -webkit-user-select: text; user-select: text; }
button, a { touch-action: manipulation; }

/* Product cards in 2-col grids */
.grid--products{
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.grid--products .product-card{
  padding: 12px;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.grid--products .product-card__media{
  height: 110px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #fff;
  overflow: hidden;
}

.grid--products .product-card__media img{
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.grid--products .product-card__fav{
  top: 12px;
  right: 12px;
}

.grid--products .product-card__body{
  padding-top: 8px;
  gap: 6px;
  display: flex;
  flex-direction: column;
}

.grid--products .product-card__title,
.grid--products .product-card__name{
  font-size: 13px;
  line-height: 1.2;
  font-weight: 400;
  min-height: 32px;
  word-break: break-word;
  white-space: normal;
  text-align: left;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.grid--products .product-card__price{
  font-size: 13px;
  font-weight: 400;
}

.grid--products .btn-primary{
  height: 44px;
  font-size: 15px;
  border-radius: 18px;
}

/* Product details page */

.product{
  display: grid;
  gap: 14px;
  margin-top: 8px;
}
.product__media{
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* одинаковый размер фото в карточке товара */
  aspect-ratio: 1 / 1;
  max-height: 440px;
}

.product__media img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

/* Horizontal gallery (scroll-snap) */
.media-scroll{
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.media-scroll::-webkit-scrollbar{ height: 0; }
.media-slide{
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  display: grid;
  place-items: center;
  padding: 14px;
}
.media-slide img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--radius-lg) - 6px);
}
.product__card{
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
}
.product__row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.product__title{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.product__sub{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}
.product__price{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}


/* Product options (color/memory) */
.opt-block{ margin-top: 14px; }
.opt-title{ font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.opt-row{ display: flex; flex-wrap: wrap; gap: 10px; }
.opt-chip{
  border: 1px solid rgba(14, 27, 58, 0.14);
  background: #fff;
  padding: 9px 12px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.opt-chip.is-active{
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(43, 92, 255, 0.08);
}
.product__price--sub{
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
}
.fav-toggle{
  width: 48px;
  height: 48px;
  border-radius: 18px;
  border: 1px solid rgba(14, 27, 58, 0.12);
  display: grid;
  place-items: center;
}
.fav-toggle svg{ width: 22px; height: 22px; }
.fav-toggle.is-active{
  border-color: rgba(43, 92, 255, 0.35);
  color: var(--primary);
  background: rgba(43, 92, 255, 0.08);
}

/* Cart v2 (like screenshot) */
body[data-root="cart"] .main{
  padding-bottom: calc(var(--tabbar-h) + 120px + env(safe-area-inset-bottom, 0px));
}
.cart2{ margin-top: 10px; display: grid; gap: 12px; }
.cart-item2{
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
}
.cart-item2__img{
  width: 120px;
  height: 120px;
  border-radius: 18px;
  background: #F0F2F6;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.cart-item2__img img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cart-item2__head{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.cart-item2__title{
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.trash2{
  border: 0;
  background: transparent;
  color: #8B93A3;
  padding: 6px;
  border-radius: 12px;
  cursor: pointer;
}
.trash2 svg{ width: 26px; height: 26px; }

.cart-item2__bottom{
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.qty2{
  display: flex;
  align-items: center;
  gap: 14px;
}
.qty2__btn{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 0;
  background: #EEF1F7;
  color: #121826;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.qty2__btn--plus{
  background: var(--primary);
  color: #fff;
}
.qty2__val{
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item2__price{
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.cart2__section-title{
  margin: 18px 0 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cart2__card{
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
}
.cart2__row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}
.cart2__label{ color: var(--muted); font-weight: 600; }
.cart2__value{ font-weight: 700; font-size: 16px; }

.promo{
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  align-items: center;
}
.promo input{
  height: 56px;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: var(--card);
  font-size: 15px;
}
.btn-apply{
  height: 56px;
  border-radius: 18px;
  border: 0;
  background: #9AA1AE;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  font-size: 15px;
}

.summary-bar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 12px var(--content-pad);
  background: rgba(245, 246, 249, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(231, 233, 238, 0.9);
}
.summary-bar__label{ color: var(--muted); font-weight: 500;
  font-size: 12px;
}
.summary-bar__sum{ font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.summary-bar__count{ color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 6px; }
.summary-bar__btn{
  height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}


/* ==========================
   Support + Cart desktop tweaks
   ========================== */

/* Keep support screen tall on mobile (was inline style) */
body[data-root="support"] .empty--support{
  min-height: 640px;
}

/* Desktop (mouse/trackpad) tweaks: do NOT affect mobile */
@media (any-hover: hover) and (any-pointer: fine){
  /* Cart: slightly smaller product title on desktop */
  body[data-root="cart"] .cart-item2__title{ font-size: 14px !important; }
  body[data-root="cart"] .cart-item__title{ font-size: 13px !important; }
  body[data-root="cart"] .cart-item2__price{ font-size: 12px !important; }
  body[data-root="cart"] .cart-item__sub{ font-size: 12px !important; }

  /* Support: lift content up (don't vertically center) on desktop */
  body[data-root="support"] .empty{
    place-items: start center !important;
    padding-top: 40px !important;
    padding-bottom: 40px !important;
    min-height: 0 !important;
  }
}


/* v24: smaller typography on Home and Product cards/pages only */
body[data-root="home"] .section__title{
  font-size: 24px;
}
body[data-root="home"] .section__action{
  font-size: 14px;
}

.product-card__title{
  font-size: 15px;
  line-height: 1.16;
}
.product-card__sub{
  font-size: 13px;
  margin: 8px 0 12px 0;
}
.product-card .btn-primary{
  font-size: 14px;
  padding-top: 11px;
  padding-bottom: 11px;
}

.product__title{ font-size: 18px; }
.product__price{ font-size: 20px; }


/* ===== v28.1 card layout hard fixes ===== */
.product-card__body{
  display:flex;
  flex-direction:column;
  gap:6px;
}

/* Title: normal weight, no overlap with image */
.product-card__title,
.product-card__name{
  margin:0;
  font-size:14px;
  font-weight:400;
  line-height:1.25;
  white-space: normal;
  word-break: break-word;
}


/* Price: smaller + not bold */
.product-card__price{
  margin:0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing:-0.01em;
}

/* Optional sub line (stock, etc.) */
.product-card__sub{
  margin:0;
  font-size:12px;
  font-weight:500;
  line-height:1.2;
}

.product-card .btn-primary{
  margin-top:auto;
  height:44px;
  font-size:15px;
  border-radius:18px;
}
/* ------------------------------
   Apple catalog (compact tiles)
------------------------------ */

body[data-root="catalog"] .apple-grid{
  margin-top: 12px;
  max-width: 520px;
  margin-left:auto;
  margin-right:auto;
}



/* Apple tiles: compact, no overlap between image and label */
body[data-root="catalog"] .tile.tile--apple{
  min-height: 138px;
  padding: 14px 12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
}




body[data-root="catalog"] .tile.tile--apple .tile__img{
  width:100%;
  height: 78px;
  display:flex;
  align-items:center;
  justify-content:center;
}





body[data-root="catalog"] .tile.tile--apple .tile__img img{
  width:100%;
  height:100%;
  object-fit:contain;
}





body[data-root="catalog"] .tile.tile--apple .tile__label{
  margin:0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 400;
  text-align:center;
  white-space: normal;
  word-break: break-word;
}






body[data-root="catalog"] .grid--products{
  max-width: 520px;
  margin: 0 auto;
}

/* =========================
   FIXES (v39)
   ========================= */

/* fallback placeholder for failed images */
img.img--placeholder{
  object-fit: contain !important;
  opacity: 0.92;
}




/* ===== v50: prices bold everywhere (sizes unchanged) ===== */
.product-card__price,
.grid--products .product-card__price,
.cart-item2__price{
  font-weight: 700 !important;
}


/* Admin: order status select */
.order-admin{margin-top:10px;display:flex;align-items:center;justify-content:space-between;gap:10px;}
.order-admin__title{font-size:12px;opacity:.7;}
.order-admin__select{min-width:160px;padding:10px 12px;border-radius:14px;border:1px solid rgba(0,0,0,.12);background:#fff;}


/* Admin orders: show customer Telegram + contact */
.order-card__meta{
  margin: 6px 0 8px;
  font-size: 13px;
  line-height: 16px;
  color: rgba(10,16,28,.6);
}


/* Dyson subcategory grid (same as apple) */
.dyson-grid .tile__img{background:#fff;}
