
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #070a10;
  color: #f5f8fc;
  font-family: Inter, Arial, sans-serif;
}

.app {
  max-width: 700px;
  margin: auto;
  padding: 0 16px 90px;
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  background: #070a10;
  position: sticky;
  top: 0;
  z-index: 3;
}

header b {
  font-size: 13px;
  letter-spacing: 2px;
}

header small {
  display: block;
  color: #91a4ba;
  font-size: 9px;
  letter-spacing: 3px;
  margin-top: 5px;
}

.logo {
  width: 42px;
  height: 42px;
  border: 1px solid #26d8ff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #26d8ff;
  font-weight: 900;
}

header button {
  margin-left: auto;
  border: 1px solid #263344;
  border-radius: 12px;
  background: #101722;
  color: white;
  padding: 10px;
}

.hero {
  padding: 23px;
  border: 1px solid #1b3b5c;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 85% 30%, #17446e, transparent 50%),
    linear-gradient(135deg, #102034, #070a10);
  min-height: 185px;
}

.hero small {
  color: #26d8ff;
  letter-spacing: 3px;
  font-weight: bold;
}

.hero h1 {
  font-size: 48px;
  line-height: .86;
  margin: 16px 0;
  font-style: italic;
  letter-spacing: -3px;
}

.hero em {
  color: #168cff;
}

.hero p {
  font-size: 12px;
  color: #b6c6d8;
}

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 17px 0;
  background: #101722;
  border: 1px solid #263344;
  border-radius: 14px;
  padding: 12px;
  color: #91a4ba;
  font-size: 22px;
}

.search input {
  background: none;
  border: 0;
  outline: 0;
  color: white;
  width: 100%;
  font-size: 13px;
}

.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.heading h2,
.sheet h2 {
  font-size: 18px;
  margin: 0;
}

.heading button {
  background: none;
  border: 0;
  color: #26d8ff;
  font-size: 12px;
}

.heading small {
  color: #91a4ba;
}

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

.cat {
  background: linear-gradient(145deg, #152335, #0c121c);
  border: 1px solid #263344;
  border-radius: 14px;
  color: white;
  padding: 15px 4px;
  font-weight: bold;
  font-size: 11px;
}

.cat span {
  display: block;
  font-size: 22px;
  margin-bottom: 7px;
}

.cat.sel {
  border-color: #168cff;
}

/* Сетка товаров */

.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid #263344;
  background: #101722;
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
}

/* Область фотографии в карточке */

.art {
  height: auto;
  min-height: 140px;
  max-height: 240px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  font-size: 45px;
  background: radial-gradient(circle, #1b4265, #0b111a 70%);
  position: relative;
  border: 0;
  color: white;
  overflow: hidden;
}

/* Само изображение */

.product-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  object-position: center;
  border-radius: 9px;
}

/* Информация о товаре */

.tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #168cff;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: bold;
}

.info {
  padding: 12px;
}

.name {
  font-size: 13px;
  font-weight: 800;
}

.desc {
  font-size: 10px;
  line-height: 1.4;
  color: #91a4ba;
  margin-top: 5px;
  min-height: 28px;
}

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

.price {
  font-weight: 900;
  font-size: 14px;
}

.add {
  width: 33px;
  height: 33px;
  background: #168cff;
  border: 0;
  border-radius: 10px;
  color: white;
  font-size: 22px;
}

/* Модальные окна */

.overlay {
  position: fixed;
  inset: 0;
  background: #000b;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hidden {
  display: none !important;
}

.sheet {
  width: min(700px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #0b111a;
  border: 1px solid #263344;
  border-radius: 23px 23px 0 0;
  padding: 25px 18px calc(25px + env(safe-area-inset-bottom));
  position: relative;
}

.close {
  float: right;
  background: #101722;
  border: 1px solid #263344;
  border-radius: 50%;
  color: white;
  width: 34px;
  height: 34px;
}

/* Большая фотография в окне товара */

.detail-art {
  clear: both;
  height: 300px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  font-size: 70px;
  background: radial-gradient(circle, #1b4265, #0b111a 70%);
  border-radius: 15px;
  margin: 18px 0;
  overflow: hidden;
}

.detail-art .product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.detail-name {
  font-size: 22px;
  font-weight: 900;
}

.detail-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #b3c1d1;
}

.detail-price {
  font-size: 24px;
  font-weight: 900;
  margin: 15px 0;
}

.primary {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  background: #168cff;
  color: white;
  font-weight: 800;
  margin-top: 12px;
}

/* Корзина */

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid #263344;
  font-size: 13px;
}

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

.qty button {
  background: #172334;
  color: white;
  border: 1px solid #263344;
  border-radius: 8px;
  width: 27px;
  height: 27px;
}

.total {
  display: flex;
  justify-content: space-between;
  padding: 18px 0;
  font-size: 14px;
}

.total b {
  font-size: 20px;
}

label {
  font-size: 12px;
  color: #b3c1d1;
}

textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  background: #101722;
  border: 1px solid #263344;
  color: white;
}

.fine {
  font-size: 10px;
  line-height: 1.5;
  color: #8294a9;
}

/* Нижняя навигация */

nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 100%);
  display: flex;
  justify-content: space-around;
  background: #090d14f5;
  border-top: 1px solid #263344;
  padding: 10px 5px calc(10px + env(safe-area-inset-bottom));
  z-index: 4;
}

nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  color: #91a4ba;
  font-size: 20px;
}

nav button small {
  font-size: 10px;
}

nav button.active {
  color: #26d8ff;
}

/* Уведомления */

.toast {
  position: fixed;
  z-index: 20;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  background: #eaf6ff;
  color: #08111b;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

/* Адаптация под большие экраны */

@media (min-width: 600px) {
  .art {
    height: auto;
    min-height: 140px;
    max-height: 240px;
  }

  .cats {
    grid-template-columns: repeat(4, 1fr);
  }

  .detail-art {
    height: 380px;
  }
}

/* Компактные экраны */

@media (max-width: 360px) {
  .art {
    height: auto;
    min-height: 120px;
    max-height: 180px;
  }

  .detail-art {
    height: 250px;
  }

  .info {
    padding: 9px;
  }
}


/* Встроенная панель администратора */
.admin-view { position: fixed; inset: 0 0 65px; z-index: 3; background: #070a10; }
.admin-view iframe { width: 100%; height: 100%; border: 0; background: #070a10; }


/* Индикатор добавления товара в корзину */
#cartTop {
  position: relative;
}

.cart-plus-one {
  position: absolute;
  top: -10px;
  right: -9px;
  background: #f04444;
  color: #fff;
  border: 2px solid #070a10;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  pointer-events: none;
  animation: cartPlusIn 1.5s ease forwards;
}

@keyframes cartPlusIn {
  0% { opacity: 0; transform: translateY(5px) scale(.7); }
  15% { opacity: 1; transform: translateY(0) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-5px); }
}

/* Личный кабинет */
.profile-view {
  padding: 20px 16px 110px;
  min-height: 65vh;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: #111a27;
  border: 1px solid #263344;
  border-radius: 18px;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: #1c2b3d;
  border-radius: 50%;
  font-size: 27px;
}

.profile-card h2 {
  margin: 0 0 5px;
}

.profile-card p {
  margin: 0;
}

.profile-info {
  margin-top: 14px;
  padding: 17px;
  background: #111a27;
  border: 1px solid #263344;
  border-radius: 14px;
}

.profile-info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.profile-info span,
.profile-order-date {
  color: #91a4ba;
  font-size: 12px;
}

.profile-title {
  margin: 26px 0 14px;
}

.profile-order {
  margin-bottom: 12px;
  padding: 16px;
  background: #111a27;
  border: 1px solid #263344;
  border-radius: 14px;
}

.profile-order-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.profile-order-top span {
  color: #26d8ff;
  font-size: 12px;
}

.profile-order-date {
  margin-top: 8px;
}

.profile-order-details {
  margin-top: 12px;
  color: #c5d0dd;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.profile-order-total {
  margin-top: 12px;
  text-align: right;
  font-weight: bold;
  color: #26d8ff;
}

/* Исправление переполнения текста в профиле */
.profile-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 8px;
}

.profile-card h3,
.profile-card p {
  display: block !important;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* Красная подсветка незаполненного адреса */
#deliveryAddress.delivery-invalid {
  border: 1.5px solid #ff4545 !important;
  box-shadow: 0 0 0 2px rgba(255, 69, 69, 0.18);
}

/* Обновлённый личный кабинет */
#profileUsername,
#profileId {
  font-size: 12px;
  color: #91a4ba;
  line-height: 1.4;
}

#profileName {
  font-size: 19px;
  margin-bottom: 5px;
}

.history-button {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #263344;
  border-radius: 14px;
  background: #111a27;
  color: #26d8ff;
  font-size: 16px;
  font-weight: bold;
  text-align: left;
}

.history-back {
  margin: 10px 0 18px;
  padding: 10px 14px;
  border: 1px solid #263344;
  border-radius: 10px;
  background: #111a27;
  color: #26d8ff;
}

/* CHICAGO SHOP — программа лояльности */
.loyalty-card,
.loyalty-balance,
.invite-link-box {
  box-sizing: border-box;
  width: 100%;
  margin-top: 16px;
  padding: 20px;
  background: linear-gradient(145deg, #142438, #101722);
  border: 1px solid #263b50;
  border-radius: 18px;
}

.loyalty-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loyalty-top span,
.loyalty-balance > span {
  color: #91a4ba;
  font-size: 11px;
  letter-spacing: 1.5px;
}

.loyalty-top strong {
  font-size: 23px;
  color: #26d8ff;
}

.loyalty-rate {
  margin-top: 15px;
  color: #c5d0dd;
}

.loyalty-rate b {
  color: #fff;
  font-size: 30px;
}

.loyalty-progress {
  height: 9px;
  margin-top: 18px;
  overflow: hidden;
  background: #263344;
  border-radius: 20px;
}

#loyaltyProgressBar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #168cff, #26d8ff);
  border-radius: 20px;
  transition: width .35s ease;
}

#loyaltyProgressText {
  margin: 10px 0 0;
  color: #91a4ba;
  font-size: 12px;
}

.loyalty-balance {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

#loyaltyBalance {
  color: #26d8ff;
  font-size: 30px;
}

.loyalty-balance small {
  color: #91a4ba;
}

.loyalty-action,
.loyalty-menu-button {
  width: 100%;
  box-sizing: border-box;
  padding: 15px;
  border: 1px solid #263b50;
  border-radius: 13px;
  background: #172538;
  color: #26d8ff;
  font-size: 14px;
  font-weight: bold;
}

.loyalty-action:disabled {
  opacity: .45;
}

.loyalty-menu-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  text-align: left;
  font-size: 15px;
}

.invite-link-box p {
  overflow-wrap: anywhere;
  color: #26d8ff;
  line-height: 1.5;
}

.invite-link-box .loyalty-action {
  margin-top: 10px;
}

#profileFriends .profile-order {
  margin-top: 12px;
}

