:root {
  --bg: #edf5ee;
  --surface: #f8fff8;
  --surface-2: #eef8e9;
  --green: #1b7c35;
  --green-2: #2f9a4e;
  --mint: #a5dfa9;
  --gold: #ffe59d;
  --pink: #fae3ec;
  --brown: #81502f;
  --text: #272f29;
  --muted: #6d766f;
  --line: #c5e6ce;
  --danger: #cc4d4f;
  font-family: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(165, 223, 169, .6), transparent 34%),
    linear-gradient(135deg, #f7fbf4 0%, #e6f0e3 48%, #f7f0e4 100%);
  color: var(--text);
}

button, input { font: inherit; }
button { cursor: pointer; }

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.phone {
  width: min(430px, 100%);
  height: min(900px, calc(100vh - 56px));
  min-height: 760px;
  border: 10px solid #1d231e;
  border-radius: 42px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(27, 124, 53, .24);
  overflow: hidden;
  position: relative;
}

.statusbar {
  height: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface);
}

.screen {
  display: none;
  height: calc(100% - 108px);
  overflow-y: auto;
  padding: 0 18px 18px;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar { display: none; }
.screen.active { display: block; }

.app-header, .detail-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 12px;
  background: rgba(248, 255, 248, .94);
  backdrop-filter: blur(14px);
}

.app-header.compact { padding-bottom: 18px; }

.eyebrow {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: 30px; letter-spacing: 0; line-height: 1.05; }
h2 { margin-bottom: 8px; font-size: 20px; line-height: 1.2; }
h3 { margin: 22px 0 8px; font-size: 14px; color: var(--green); }

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--green);
  font-weight: 900;
  display: grid;
  place-items: center;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  margin-bottom: 14px;
}

.search-row input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 23px;
  padding: 0 18px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.filter-btn {
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--green);
  font-size: 22px;
}

.hero-strip {
  min-height: 112px;
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(130deg, rgba(27, 124, 53, .96), rgba(47, 154, 78, .82)),
    url("https://prod-back.perfectoo.pro/products/picture?alias=total-energy-vanil-450") right -18px bottom -35px / 180px auto no-repeat;
  color: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.hero-strip p { margin: 0 0 4px; font-size: 12px; color: var(--gold); font-weight: 800; }
.hero-strip h2 { max-width: 220px; margin: 0; font-size: 22px; }
.hero-strip button {
  border: 0;
  border-radius: 22px;
  background: var(--gold);
  color: #312716;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 12px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--muted);
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 800;
}

.chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.quick-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.quick-stats strong { display: block; font-size: 18px; color: var(--green); }
.quick-stats span { font-size: 11px; color: var(--muted); }

.product-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 18px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-height: 312px;
  display: flex;
  flex-direction: column;
}

.product-image {
  height: 128px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex: 0 0 128px;
}

.product-image img {
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  max-width: 138px;
  max-height: 112px;
  object-fit: contain;
}

.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(201, 28, 31, .14);
  border-radius: 50%;
  background: rgba(255,255,255,.96);
  color: var(--danger);
  font-family: Arial, sans-serif;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 8px 18px rgba(27, 124, 53, .12);
}

.product-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.category-label {
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.2;
}

.product-title {
  margin: 6px 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.22;
  min-height: 49px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-subtitle {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  min-height: 28px;
}

.product-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price strong { display: block; color: var(--brown); font-size: 16px; }
.price span {
  display: block;
  max-width: 92px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  color: var(--muted);
}

.add-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.detail-header {
  padding-bottom: 10px;
}

.detail-media {
  height: 238px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f2faef, #fff);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  overflow: hidden;
  flex: 0 0 238px;
}

.detail-media img {
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  max-width: 310px;
  max-height: 210px;
  object-fit: contain;
}

.detail-body { padding: 18px 0 88px; }
.detail-category { color: var(--green); font-weight: 900; font-size: 12px; text-transform: uppercase; margin-bottom: 8px; }
#detailTitle { font-size: 24px; line-height: 1.12; }
#detailSubtitle { color: var(--muted); line-height: 1.35; }

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 8px;
}

.price-row strong { color: var(--brown); font-size: 26px; }
.price-row span { color: var(--green); font-weight: 900; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.spec-grid div {
  min-height: 76px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
}

.spec-grid span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.spec-grid strong { font-size: 12px; line-height: 1.18; display: block; }

.description { color: #38423b; line-height: 1.55; font-size: 14px; }
.description.muted { color: var(--muted); font-size: 12px; }

.sticky-action {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 74px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(248,255,248,0), var(--surface) 30%);
}

.sticky-action button, #checkoutBtn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 26px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 350px;
  padding-bottom: 14px;
}

.cart-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-item img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: 8px;
}

.cart-item h3 { margin: 0 0 5px; color: var(--text); font-size: 13px; line-height: 1.25; }
.cart-item p { margin: 0; color: var(--brown); font-weight: 900; }

.qty {
  display: grid;
  grid-template-columns: 28px 28px 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.qty button {
  height: 32px;
  border: 0;
  background: var(--surface-2);
  color: var(--green);
  font-weight: 900;
}

.qty span { text-align: center; font-size: 12px; font-weight: 900; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.55);
}

.checkout-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.checkout-line, .checkout-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.checkout-line span { color: var(--muted); }
.checkout-total { font-size: 20px; margin: 14px 0 16px; }
.checkout-total strong { color: var(--brown); }

.profile-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.profile-card h2 { margin: 0 0 6px; }
.profile-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.profile-menu {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-menu button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  color: var(--text);
  font-weight: 900;
}

.profile-menu span { color: var(--green); }

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 74px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(248,255,248,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
}

.tab span { font-size: 20px; line-height: 1; }
.tab-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
}
.tab-icon svg {
  width: 23px;
  height: 23px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab.active { color: var(--green); }

@media (max-width: 520px) {
  .stage { padding: 0; }
  .phone {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }
}


.cart-illustration {
  width: 150px;
  height: 116px;
  margin: 0 auto 12px;
}

.cart-illustration svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cart-shadow { fill: rgba(27, 124, 53, .12); }
.cart-basket { fill: #f8fff8; stroke: #1b7c35; stroke-width: 8; stroke-linejoin: round; }
.cart-handle { fill: none; stroke: #81502f; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.cart-wheel { fill: #81502f; }
.cart-leaf { fill: url(#cartLeaf); }
.cart-leaf-small { opacity: .82; }
.cart-line { fill: none; stroke: #a5dfa9; stroke-width: 7; stroke-linecap: round; }

.cart-empty h2 {
  margin: 4px 0 6px;
  font-size: 19px;
  color: var(--green);
}

.cart-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.cart-hero {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #eef8e9, #fff);
}

.cart-hero .cart-illustration {
  width: 86px;
  height: 66px;
  margin: 0;
}

.cart-hero span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cart-hero strong {
  display: block;
  color: var(--green);
  font-size: 22px;
}

.cart-item div > span {
  display: block;
  margin-top: 3px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}
