/* ============================================
   WELCOME — первый экран по референсу
   ============================================ */

.welcome-screen {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  background: #071313;
  color: #fff;
}

.welcome-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.welcome-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 11, 12, 0.18) 0%, rgba(2, 11, 12, 0.06) 36%, rgba(2, 11, 12, 0.78) 74%, rgba(2, 11, 12, 0.96) 100%),
    radial-gradient(circle at 50% 72%, rgba(33, 135, 129, 0.2), transparent 45%);
}

.welcome-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
}

.welcome-content {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: max(22px, env(safe-area-inset-bottom));
  padding: 0 8px;
}

.welcome-kicker {
  margin: 0 0 9px;
  padding-left: 2px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-content h1 {
  max-width: 330px;
  margin: 0 0 6px;
  color: #fff;
  font-size: clamp(34px, 11vw, 52px);
  line-height: 0.96;
  font-weight: 900;
  text-shadow: 0 2px 18px rgba(0,0,0,0.5);
}

.welcome-content p {
  max-width: 300px;
  margin: 0 0 30px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}

.welcome-cta {
  width: 100%;
  height: 55px;
  display: grid;
  grid-template-columns: 49px 1fr 58px;
  align-items: center;
  padding: 3px 8px 3px 3px;
  border: 1px solid rgba(132, 225, 218, 0.25);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 94, 93, 0.88), rgba(6, 47, 52, 0.9));
  color: #fff;
  box-shadow: 0 16px 34px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 800;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.welcome-cta:active {
  transform: scale(0.98);
  box-shadow: 0 10px 22px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.14);
}

.welcome-cta-icon {
  width: 47px;
  height: 47px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(132, 225, 218, 0.15);
}

.welcome-cta-icon svg {
  width: 20px;
  height: 20px;
}

.welcome-cta-arrows {
  justify-self: end;
  color: rgba(255, 255, 255, 0.5);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.16em;
}

@media (min-width: 768px) {
  .welcome-screen {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  }
}

/* ============================================
   HOME — главный экран marketplace
   ============================================ */

.home-screen {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 14px 0 calc(var(--header-height) + 38px);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(237, 242, 240, 0.9) 0%, #f7f8f5 42%, #ffffff 100%);
}

.app-container {
  max-width: 420px;
}

.home-scenic {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 165px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(247,248,245,0.98)),
    url("../images/hero/nalchik-location.webp") center 34% / cover;
  opacity: 0.84;
  filter: saturate(0.92);
}

.discover-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.discover-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discover-avatar {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #124c50, #d7b17b);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.discover-profile strong,
.discover-profile span {
  display: block;
}

.discover-profile strong {
  color: #111;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 900;
}

.discover-profile span {
  margin-top: 2px;
  color: #4e5a58;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 600;
}

.discover-alert {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #21494b;
  box-shadow: 0 12px 28px rgba(19, 69, 72, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.discover-alert svg {
  width: 19px;
  height: 19px;
}

.discover-title {
  position: relative;
  z-index: 1;
  margin-bottom: 17px;
}

.discover-title h1 {
  margin: 0;
  color: #101414;
  font-size: 31px;
  line-height: 0.96;
  font-weight: 900;
}

.discover-title p {
  margin-top: 6px;
  color: rgba(16, 28, 29, 0.66);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}

.discover-search {
  position: relative;
  z-index: 1;
  height: 55px;
  display: grid;
  grid-template-columns: 39px 1fr 49px;
  align-items: center;
  margin-bottom: 16px;
  padding-left: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 36px rgba(22, 63, 65, 0.12);
}

.discover-search-icon {
  justify-self: center;
  width: 20px;
  height: 20px;
  color: #13818a;
}

.discover-search input {
  width: 100%;
  min-width: 0;
  color: #182021;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.discover-search input::placeholder {
  color: rgba(30, 41, 42, 0.46);
  opacity: 1;
}

.discover-search button {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f7d86, #0b5960);
  color: #fff;
  box-shadow: 0 10px 22px rgba(13, 104, 112, 0.24);
}

.discover-search button svg {
  width: 20px;
  height: 20px;
}

.home-block.compact {
  margin-bottom: 16px;
}

.home-brand-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.home-brand-line span,
.home-brand-line small {
  display: block;
  color: var(--color-text-secondary);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  text-transform: uppercase;
}

.home-brand-line strong {
  display: block;
  margin-top: 3px;
  color: var(--color-text-primary);
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.home-brand-line small {
  max-width: 88px;
  text-align: right;
  color: var(--color-link);
}

.home-topbar {
  display: grid;
  grid-template-columns: 1fr 43px;
  gap: 9px;
  align-items: center;
  margin-bottom: 18px;
}

.home-search {
  height: 35px;
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  background: #fff;
  border: 1px solid #d9d9d9;
}

.home-search input {
  width: 100%;
  height: 100%;
  padding: 0 11px;
  color: var(--color-text-primary);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
}

.home-search input::placeholder {
  color: #222;
  opacity: 1;
}

.home-search-button,
.home-quick-action {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 35px;
  color: #111;
  transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.home-search-button svg {
  width: 19px;
  height: 19px;
}

.home-quick-action {
  width: 43px;
  height: 43px;
  background: var(--color-accent);
  color: #fff;
}

.home-quick-action svg {
  width: 19px;
  height: 19px;
}

.home-search-button:active,
.home-quick-action:active {
  transform: scale(0.96);
}

.home-block {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
}

.home-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.home-section-heading h2 {
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
  color: var(--color-text-primary);
  text-transform: none;
}

.home-section-heading button {
  color: #1b747a;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 2px;
}

.home-categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 1px 2px;
  scrollbar-width: none;
}

.home-categories::-webkit-scrollbar {
  display: none;
}

.home-category {
  height: 37px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(16, 68, 72, 0.06);
  color: rgba(30, 44, 45, 0.58);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(24, 69, 72, 0.08);
}

.home-category span {
  font-size: 15px;
  line-height: 1;
}

.home-category.active,
.home-category:active {
  background: linear-gradient(135deg, #0f7d86, #0a565d);
  color: #fff;
  border-color: transparent;
}

.location-card {
  position: relative;
  z-index: 1;
  min-height: 177px;
  margin-bottom: 26px;
  overflow: hidden;
  border-radius: 24px;
  background: #123b3e;
  box-shadow: 0 20px 42px rgba(18, 67, 70, 0.22);
  cursor: pointer;
}

.location-card img {
  width: 100%;
  height: 100%;
  min-height: 177px;
  object-fit: cover;
  display: block;
}

.location-card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 18, 20, 0.04) 0%, rgba(5, 18, 20, 0.32) 50%, rgba(5, 18, 20, 0.74) 100%),
    radial-gradient(circle at 82% 72%, rgba(255,255,255,0.2), transparent 22%);
}

.location-card-copy {
  position: absolute;
  left: 17px;
  right: 78px;
  bottom: 17px;
  color: #fff;
}

.location-card-copy h2 {
  margin: 0 0 3px;
  font-size: 19px;
  line-height: 1.05;
  font-weight: 900;
  text-shadow: 0 2px 16px rgba(0,0,0,0.28);
}

.location-card-copy span,
.location-card-copy strong {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.location-card-copy strong {
  color: #f5d06b;
}

.location-card button {
  position: absolute;
  right: 15px;
  bottom: 17px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.location-card button svg {
  width: 21px;
  height: 21px;
}

.home-size-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 1px 10px;
  scrollbar-width: none;
}

.home-size-cards::-webkit-scrollbar {
  display: none;
}

.home-size-cards button {
  min-width: 124px;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px;
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(255,255,255,0.95), rgba(239,245,244,0.9));
  border: 1px solid rgba(17, 76, 80, 0.06);
  box-shadow: 0 15px 34px rgba(28, 81, 84, 0.1);
  color: #102224;
}

.home-size-cards small,
.home-size-cards span {
  color: rgba(16, 34, 36, 0.56);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
}

.home-size-cards strong {
  color: #0c4248;
  font-size: 28px;
  line-height: 0.95;
  font-weight: 900;
}

.home-products-grid {
  display: flex;
  gap: 13px;
  overflow-x: auto;
  padding: 2px 1px 10px;
  scrollbar-width: none;
}

.home-products-grid::-webkit-scrollbar {
  display: none;
}

.home-product-card {
  min-width: 156px;
  max-width: 156px;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(18, 78, 82, 0.07);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 15px 32px rgba(21, 70, 74, 0.12);
}

.home-product-card:active {
  transform: scale(0.98);
}

.home-product-image {
  position: relative;
  aspect-ratio: 1 / 0.82;
  overflow: hidden;
  background: #d9d9d9;
}

.home-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(255,255,255,0.58);
  border-radius: 50%;
  background: rgba(255,255,255,0.84);
  color: #253133;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,0.13);
  backdrop-filter: blur(12px);
  transition: transform var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.home-favorite-btn svg {
  width: 16px;
  height: 16px;
}

.home-favorite-btn:active {
  transform: scale(0.92);
}

.home-favorite-btn.active {
  background: rgba(255,255,255,0.96);
  color: #d8315b;
}

.home-favorite-btn.active svg {
  fill: currentColor;
}

.home-product-info {
  padding: 9px 11px 12px;
}

.home-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.home-product-badge {
  min-width: 39px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #0f7d86;
  color: #fff;
  font-size: 7px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
}

.home-product-stock {
  color: #555;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.home-product-name {
  color: #202020;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 800;
  min-height: 25px;
  overflow: hidden;
}

.home-product-price {
  color: #111;
  font-size: 15px;
  line-height: 1.05;
  font-weight: 800;
  margin-top: 2px;
}

.home-size-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.home-size-row button {
  height: 34px;
  background: #fff;
  border: 1px solid #dedede;
  color: #222;
  font-size: 11px;
  font-weight: 800;
}

.home-size-row button:active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.product-photo-fallback {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.product-photo-fallback::before,
.product-photo-fallback::after {
  content: '';
  position: absolute;
  z-index: -1;
}

.product-photo-fallback::before {
  width: 78%;
  height: 44%;
  left: 8%;
  bottom: 18%;
  background: rgba(255, 255, 255, 0.34);
  transform: rotate(-12deg);
}

.product-photo-fallback::after {
  width: 48%;
  height: 12%;
  left: 26%;
  bottom: 17%;
  background: rgba(0, 0, 0, 0.18);
  filter: blur(7px);
}

.product-fallback-icon {
  width: 62%;
  color: #111;
  transform: rotate(-12deg);
  filter: drop-shadow(0 12px 12px rgba(0,0,0,0.16));
}

.product-fallback-icon svg {
  display: block;
  width: 100%;
  height: auto;
}

.product-tone-0 { background: linear-gradient(135deg, #EFE3D2 0%, #C38C57 100%); }
.product-tone-1 { background: linear-gradient(135deg, #D8E6E8 0%, #567C8B 100%); }
.product-tone-2 { background: linear-gradient(135deg, #F2DAD8 0%, #AE4E55 100%); }
.product-tone-3 { background: linear-gradient(135deg, #E5E3F4 0%, #6E6699 100%); }
.product-tone-4 { background: linear-gradient(135deg, #E0E8D9 0%, #5D7B59 100%); }
.product-tone-5 { background: linear-gradient(135deg, #ECECEC 0%, #656565 100%); }

@media (min-width: 768px) {
  .app-container {
    max-width: 560px;
  }

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