/* Medcom-SG mini-app styles (styles.css)
   Обновлено под:
   - карточки товаров с like (like1/like2) и кнопкой корзины в круге
   - аккуратная карточка товара (detail) с back и действиями
   - профиль с верхней плашкой и белыми карточками "Избранное" / "Мои заказы"
*/

:root{
  --bg:#f3f3f3;
  --card:#ffffff;
  --text:#111;
  --muted:#6d6d6d;
  --orange:#ff7a00;
  --orange2:#ff9a2e;
  --radius:18px;
}

*{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--card);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.topbar h1{
  margin:0;
  font-size: 28px;
  font-weight: 800;
}

#content{
  padding: 16px 16px 110px; /* чтобы не перекрывалось нижним меню */
}

/* bottom nav */
.bottom-nav{
  position: fixed;
  bottom: 14px;
  left: 14px;
  right: 14px;
  z-index: 10;
  background: var(--orange);
  border-radius: 22px;
  padding: 12px;
  display:flex;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
}

.nav-btn{
  flex:1;
  border:0;
  background: rgba(255,255,255,.20);
  border-radius: 18px;
  padding: 14px 0;
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
  cursor:pointer;
}

.nav-btn.active{
  background: rgba(255,255,255,.30);
}

.nav-btn img{
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
}

.badge{
  position:absolute;
  top: 6px;
  right: 12px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background:#fff;
  color: var(--orange);
  border-radius: 999px;
  display:none;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* common */
.section{
  background: transparent;
  margin-bottom: 18px;
}
.section h2{
  margin: 0 0 10px;
  font-size: 18px;
}

.muted{ color: var(--muted); line-height: 1.5; }
.loading{ color: var(--muted); padding: 8px 0; }
.empty{
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--muted);
}

/* HOME */
.service-cards{
  display:flex;
  gap: 12px;
  overflow:auto;
  padding-bottom: 6px;
}
.service-card{
  min-width: 220px;
  height: 140px;
  border-radius: var(--radius);
  background: var(--card);
  overflow:hidden;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}
.service-card img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

/* SHOP toolbar */
.shop-toolbar{
  display:flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.search input{
  width:100%;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  background: #fff;
}

.filters select{
  width:100%;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  background:#fff;
}

.breadcrumbs{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  min-height: 16px;
}

/* PRODUCTS grid (одна колонка на мобиле) */
.products-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 520px){
  .products-grid{ grid-template-columns: 1fr 1fr; }
}

/* PRODUCT CARD */
.product-card{
  position: relative;
  background: var(--card);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 22px rgba(0,0,0,.06);
  overflow: hidden;
}

.product-image{
  width: 100%;
  height: 190px;
  border-radius: 18px;
  background: #f6f6f6;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  cursor:pointer;
}

.product-image img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}

.img-ph{
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f2f2f2, #fafafa, #f2f2f2);
}

.product-info{
  margin-top: 12px;
  cursor:pointer;
}

.product-title{
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}

.product-price{
  font-size: 20px;
  font-weight: 900;
  color: var(--orange);
}

/* like button top-right */
.like-btn{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.95);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index: 2;
}

.like-btn img{
  width: 22px;
  height: 22px;
  display:block;
}

/* cart button bottom-right */
.cart-btn{
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 0;
  background: var(--orange);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(255,122,0,.35);
}

.cart-btn img{
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  display:block;
}

/* click feedback */
.pulse{ transform: scale(1.03); }

/* PRODUCT DETAIL */
.product-page{
  display:flex;
  flex-direction: column;
  gap: 14px;
}

.back-link{
  border:0;
  background: transparent;
  display:flex;
  align-items:center;
  gap: 10px;
  color: var(--muted);
  font-size: 16px;
  padding: 0;
  cursor:pointer;
}

.back-ico{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  display:flex;
  align-items:center;
  justify-content:center;
}

.back-ico img{
  width: 18px;
  height: 18px;
  opacity: .85;
}

.product-hero{
  background: var(--card);
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  overflow:hidden;
}

.product-hero img{
  width:100%;
  height: 320px;
  object-fit: contain;
  display:block;
}

.img-ph.big{
  height: 320px;
}

.product-h1{
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}

.product-actions-row{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-price-lg{
  font-size: 22px;
  font-weight: 900;
  color: var(--orange);
  padding-top: 6px;
}

.product-actions{
  display:flex;
  gap: 12px;
  align-items:center;
}

.like-btn.lg{
  position: static;
  width: 56px;
  height: 56px;
}

.cart-btn.lg{
  position: static;
  width: 62px;
  height: 62px;
}

.product-short{
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  color: var(--muted);
  box-shadow: 0 10px 18px rgba(0,0,0,.05);
}

.product-desc{
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 18px rgba(0,0,0,.05);
}

.product-desc h3{
  margin:0 0 10px;
  font-size: 16px;
}

.desc-text{
  color: #333;
  line-height: 1.55;
}

/* PROFILE */
.profile-header{
  background: linear-gradient(135deg, var(--orange), var(--orange2));
  border-radius: 26px;
  padding: 22px 18px;
  color: #fff;
  text-align:center;
  box-shadow: 0 12px 22px rgba(255,122,0,.25);
}

.avatar{
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: rgba(255,255,255,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 22px;
  margin: 0 auto 12px;
}

.profile-name{
  font-size: 22px;
  font-weight: 900;
}

.profile-username{
  margin-top: 6px;
  opacity: .9;
  font-size: 16px;
}

.profile-cards{
  margin-top: 14px;
  display:flex;
  flex-direction: column;
  gap: 12px;
}

.profile-card{
  width:100%;
  border:0;
  background: var(--card);
  border-radius: 18px;
  padding: 16px 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  cursor:pointer;
}

.profile-card-title{
  font-size: 20px;
  font-weight: 900;
}

.profile-card-arrow{
  font-size: 22px;
  color: rgba(0,0,0,.35);
  font-weight: 900;
}

.profile-call{
  width:100%;
  border:0;
  background: var(--orange);
  color: #fff;
  border-radius: 18px;
  padding: 16px 16px;
  font-size: 16px;
  font-weight: 800;
  cursor:pointer;
  box-shadow: 0 12px 22px rgba(255,122,0,.25);
}

/* SUBPAGES */
.subpage h2{
  margin: 10px 0 0;
  font-size: 22px;
}

/* CART */
.cart-list{
  display:flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item{
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cart-item-title{
  font-weight: 900;
  margin-bottom: 6px;
}

.cart-item-sub{
  color: var(--muted);
}

.cart-item-actions{
  display:flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.qty-btn{
  width: 44px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background:#fff;
  font-size: 20px;
  cursor:pointer;
}

.remove-btn{
  border:0;
  background: rgba(0,0,0,.06);
  color: #222;
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight: 700;
  font-size: 13px;
}

.cart-total{
  margin: 14px 0 10px;
  font-size: 16px;
}

.order-form{
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}

.order-form h3{
  margin:0 0 10px;
  font-size: 16px;
}

.order-form label{
  display:block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.order-form input{
  width:100%;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  background:#fff;
}

.btn{
  width:100%;
  margin-top: 12px;
  border:0;
  background: var(--orange);
  color:#fff;
  border-radius: 16px;
  padding: 14px 14px;
  font-size: 16px;
  font-weight: 900;
  cursor:pointer;
  box-shadow: 0 12px 22px rgba(255,122,0,.25);
}
/* ===== SPLASH ===== */

.splash {
  position: fixed;
  inset: 0;
  background: #f6f6f6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.splash__logo {
  margin-bottom: 40px;
}

.brand-logo {
  width: 220px;
}

.splash__bar {
  width: 60%;
  height: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 999px;
  overflow: hidden;
}

.splash__bar-fill {
  height: 100%;
  width: 0%;
  background: #ff7a00;
  transition: width 0.3s ease;
}

.hidden {
  display: none !important;
}
/* ===========================
   GLOBAL REFINEMENT (НЕ ЛОМАЕТ СТИЛИСТИКУ)
   =========================== */

/* 2 товара в ряд всегда */
.products-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* карточка товара — одинаковая высота блоков */
.product-card{
  display:flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 320px;
}

/* кнопки избранное и корзина одинаковые */
.like-btn,
.cart-btn{
  width:44px;
  height:44px;
}

/* перенос кнопки корзины ниже цены */
.cart-btn{
  bottom: 14px;
  right: 14px;
}

/* Поиск аккуратнее */
.search{
  position: relative;
}

.search input{
  padding-left: 42px;
  border-radius: 16px;
  font-size: 15px;
}

.search::before{
  content:'';
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  width:18px;
  height:18px;
  background:url('/assets/icons/magnifier.svg') no-repeat center;
  background-size:contain;
  opacity:.5;
}

/* отступ между поиском и товарами */
.shop-toolbar{
  margin-bottom: 18px;
}

/* аккуратные отступы корзины */
.cart-list{
  margin-bottom: 16px;
}

.order-form{
  margin-top: 12px;
}

.order-form input{
  margin-bottom: 10px;
}

/* кнопка назад (универсальная) */
.back-link{
  margin-bottom: 14px;
  font-weight: 600;
}

/* страницы избранного и заказов */
.subpage{
  display:flex;
  flex-direction: column;
  gap: 14px;
}

/* описание товара */
.product-short,
.product-desc{
  font-size: 15px;
  line-height: 1.55;
}

/* кнопка читать полностью */
#readMoreBtn{
  margin-top: 8px;
}

/* небольшая аккуратность для всех карточек */
.card,
.product-card,
.cart-item,
.profile-card{
  transition: transform .15s ease;
}

.card:active,
.product-card:active{
  transform: scale(.98);
}
/* ===== HOME SERVICES FIX ===== */

.service-card-block{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.service-card-block img{
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 22px;
  display: block;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}

.service-text h3{
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.service-text p{
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}