/* Базовые стили — максимально лёгкие */
  *{box-sizing:border-box}
  html,body{height:100%}
  body{
    margin:0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
    color:#eee;
    background: linear-gradient(302deg, rgb(9 64 85) 0%, rgb(86 30 78) 50%, rgb(103 93 8) 100%);
 
    background-attachment: fixed;   /* фиксируем фон */
    background-repeat: no-repeat;   /* не дублируем */
    background-size: cover;    
  }


  header{
    position:sticky; top:0; z-index:10;
    background: #0b0b0bde;
    border-bottom:1px solid #111;
  }
  .wrap{max-width:980px; margin:0 auto; padding:12px}
  .brand{display:flex; align-items:center; gap:10px}
  .logo{width:16px; height:16px; border-radius:4px; background:#ff4f8b}
  .brand h1{margin:0; font-size:16px; font-weight:700}
  .brand small{display:block; margin-top:2px; color:#9aa; font-size:12px}

  /* Сетка: всегда 2 товара в ряд */
  .grid-wrap{max-width:980px; margin:8px auto 24px; padding: 12px 12px 92px;}
  .grid{
    display:grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap:10px;
  }

  /* Карточка списка — без тяжёлых теней и эффектов */
  .card{
    background:#0b0b0b;
    border:1px solid #151515;
    border-radius:12px;
    overflow:hidden;
    cursor:pointer;
    outline:none;
    content-visibility:auto;       /* не рендерить пока вне вьюпорта */
    contain-intrinsic-size: 300px; /* приблизительная высота для экономии layout до загрузки */
  }
  .card:focus-visible{ outline:2px solid #2a2; outline-offset:2px }

  .thumb{position:relative; background:#0a0a0a}
  .thumb img{
    display:block; width:100%; height:auto;
    background:#0a0a0a;
  }

  /* Бейджи на превью — простые, без блюра и теней */
  .titleTag{
    position:absolute; top:8px; right:8px; max-width:70%;
    padding:4px 8px; border-radius:10px;
    background:rgba(0,0,0,.7); border:1px solid #222; color:#eaeaea;
    font-size:12px; font-weight:700; line-height:1.2;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .chip{
    position:absolute; top:8px; left:8px;
    padding:3px 7px; border-radius:999px;
    background:#ff4f8b; color:#000; font-size:10px; font-weight:800;
    border:1px solid #aa2e5a;
  }
  .priceTag{
    position:absolute; left:8px; bottom:8px;
    padding:5px 8px; border-radius:10px;
    background:#000; border:1px solid #222; color:#fff; font-weight:800; font-size:13px;
  }

  .priceTag.in-cart-style, .titleTag.in-cart-style {
    background: linear-gradient(298deg, rgba(228, 92, 255, 1) 0%, rgba(214, 60, 153, 1) 78%);
  }
  .name{display:none} /* подпись снизу не нужна — есть titleTag */

  /* Модалка — строго по центру, без блюров */
  .modal{
    position:fixed; top:0; left:0; right:0; bottom:0;
    display:none;
    background:rgba(0,0,0,.7);
    padding:0;
    z-index:100;
    transform: translateY(100%); /* Start off-screen below */
    transition: transform 0.3s ease-out; /* Smooth transition */
  }
  .modal.show{
    display:flex;
    transform: translateY(0); /* Slide up */
  }
  .modal.hide {
    transform: translateY(100%); /* Slide down */
  }

  .sheet{
    display:grid; grid-template-columns: 1fr 340px;
    width:100vw; height:100dvh; overflow:auto;
    background:#0b0b0b; border:1px solid #151515; border-radius:0;
    margin: 0; padding-bottom: 80px;
  }
  @media (max-width:840px){ .sheet{ grid-template-columns: 1fr; } }

  .hero{padding:12px; display:flex; align-items:center; justify-content:center; background:#000}
  .hero img{width:100%; height:auto; border-radius:8px}

  .info{padding:16px}
  .title{margin:0 0 6px; font-size:20px; font-weight:800}
  .sku{color:#9aa; font-size:12px; margin:0 0 10px}
  .price{font-size:22px; font-weight:900; margin:10px 0 16px}
  .buy{
    display:inline-flex; align-items:center; gap:8px;
    border: 1px solid #cd9dff; background:#0f0f0f; color:#e8ffe8;
    border-radius:10px; padding:10px 14px; font-weight:800; font-size:14px;
    cursor:pointer;
  }

  .buy.in-cart {
    background: #e45cff;
    background: linear-gradient(298deg,rgba(228, 92, 255, 1) 0%, rgba(214, 60, 153, 1) 78%);
    color: #fff;
  }

  .x{
    position:absolute; top:10px; right:10px; width:36px; height:36px;
    border-radius:10px; border:1px solid #222; background:#0f0f0f; color:#fff;
    display:grid; place-items:center; cursor:pointer;
  }

  #modal .x {
    background: #ff4f8b;
    color: #000;
  }

  /* Тост — простой, без анимаций */
  .toast{
    position:fixed; left:50%; bottom:16px; transform:translateX(-50%);
    background:#0f0f0f; border:1px solid #222; color:#fff;
    padding:8px 12px; border-radius:10px; font-size:13px; z-index:120; display:none;
  }
  .toast.show{ display:block }

  .buy-buttons {
    display: flex;
    gap: 10px;
  }

.fixed-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: #0b0b0bde;
  border-top: 1px solid #4c2882;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 110;
}

.icon-button {
  background: linear-gradient(45deg, #107067, #593393);
  border: none;
  cursor: pointer;
  border-radius: 5px;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative; /* Added for counter positioning */
  transition: background 0.3s ease; /* Add transition for smooth color change */
}

.icon-button.active {
  background: linear-gradient(45deg, #F44336, #593393);
}

#wa-button {
  background: linear-gradient(199deg, #54c36d, #026e1a);
}

.icon-button img {
  width: 40px;
  height: 40px;
}

.info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #151515;
    flex-shrink: 0;
    height: 70px;
}

.info-modal-header .x {
    position: static;
    background: #ff4f8b;
    color: #000;
}

.info-modal .sheet {
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.info-modal-content {
  padding: 30px 16px;
  overflow-y: auto;
  flex-grow: 1;
}

.info-modal-footer {
  border-top: 1px solid #151515;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.cart-counter {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: red;
  color: white;
  border-radius: 50%;
  width: 20px; /* Increased size for better visibility */
  height: 20px; /* Increased size for better visibility */
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px; /* Adjusted font size */
  font-weight: bold;
}

.cart-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #222;
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 15px;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-info p {
  margin: 0;
  font-size: 16px;
}

.delete-item {
  background: #ff4f8b;
  color: #000;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
}

.cart-total {
}

.total-price-btn {
  background: #2a2;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px 15px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 62px;
  width: 50%;
}

.order-text {
  /* Inherits font-size from .total-price-btn (18px) */
  /* Inherits font-weight from .total-price-btn (bold) */
}

.total-price-text {
  font-size: 16px; /* Smaller font size */
  font-weight: normal; /* Normal weight */
}

.share-list-btn {
  background: #ccc;
  color: #333;
  border: none;
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  height: 62px;
  width: 50%;
}

.info-modal-content.empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-cart-message {
  font-size: 22px;
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}
.hero-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 1.2em;
  color: #ccc;
}

/* Postcard feature styles */
.postcard-block {
  margin-top: 20px;
  border-top: 1px solid #222;
  padding-top: 15px;
}

.postcard-header {
  display: flex;
  /*align-items: center;*/
  width: 100%;
}

.postcard-icon {
  width: 10%;
  text-align: center;
}

.postcard-icon img {
  width: 20px;
  height: 20px;
}

.postcard-text {
  width: 60%;
  font-size: 16px;
}

.postcard-toggle {
  width: 30%;
  display: flex;
  justify-content: flex-end;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* убираем обводку и подсветку при фокусе */
.switch input:focus {
  outline: none;
  box-shadow: none;
}

/* отключаем синий хайлайт при тапе на iOS */
.switch {
  -webkit-tap-highlight-color: transparent;
}


.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background: linear-gradient(211deg,rgba(22, 181, 128, 1) 0%, rgba(39, 10, 201, 1) 100%);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.postcard-content {
  display: none;
  padding-top: 15px;
}

textarea.postcard-input {
  width: 100%;
  font-size: 16px;
  height: 100px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 5px;
  color: #eee;
  padding: 10px;
  font-family: inherit;
  resize: vertical;
}

.delivery-time-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
}
.delivery-time-inputs input {
  flex-grow: 1;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 5px;
  color: #eee;
  padding: 10px;
  font-family: inherit;
  color-scheme: dark;
}

.phone-delivery-content {
  display: none;
  padding-top: 15px;
}

.phone-delivery-content label {
  display: block;
  margin-bottom: 5px;
  color: #aaa;
  font-size: 14px;
}

.phone-delivery-content input {
  font-size: 16px;
  width: 100%;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 5px;
  color: #eee;
  padding: 10px;
  font-family: inherit;
}

.categories-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* for smooth scrolling on iOS */
  scrollbar-width: none; /* for Firefox */
}
.categories-container::-webkit-scrollbar {
  display: none; /* for Chrome, Safari, and Opera */
}
.categories {
  display: flex;
  flex-wrap: nowrap;
  padding: 10px;
  gap: 10px;
}
.category-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px;
  border-radius: 10px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  white-space: nowrap;
  cursor: pointer;
  color: #000;
  -webkit-tap-highlight-color: transparent;
}
.category-button.active {
  background: linear-gradient(110deg, rgb(0 0 0) 0%, rgb(129 46 173) 100%);
  color: white;
  border-color: #333;
}
.category-button img {
  width: 20px;
  height: 20px;
}

