/* ===== Продуктов грид и елементи ===== */

/* Телефони ≤ 768px */
@media (max-width: 768px) {

  /* Грид с продукти – 2 колони */
  .products {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 10px 12px 40px;
  }

  .product {
    padding: 12px;
  }

  .product h3 {
    font-size: 15px;
    line-height: 1.25;
  }

  .product .price {
    font-size: 14px;
  }

  .product input,
  .product button {
    font-size: 14px;
  }
}

/* Малки телефони ≤ 480px */
@media (max-width: 480px) {

  /* Грид с продукти – 1–2 тесни колони */
  .products {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 10px 10px 36px;
  }

  .modal-content {
    width: min(92vw, 520px);
    padding: 22px;
  }
}

/* === Центриране и визия на продуктови карти и снимки === */
.product {
  display: flex;
  flex-direction: column;
  align-items: center; /* центрира хоризонтално */
  justify-content: flex-start;
}

.product img {
  width: 80%;
  height: auto; /* без фиксирана височина */
  aspect-ratio: 3 / 4; /* стабилни карти */
  object-fit: contain; /* показвай снимката цялата */
  border-radius: 6px;
  background-color: #111;
  margin-bottom: 15px;
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}

.product img:hover {
  transform: scale(1.02);
}

/* Защита от стари правила в други файлове/медии */
@media (max-width: 480px) {
  .product img {
    height: auto !important;
    object-fit: contain !important;
    max-height: 260px; /* ограничение на височина */
  }
}

/* ===== Попъп описание – подравняване като началната страница ===== */
#modal-product .modal-content #popup-desc {
  text-align: justify;
  text-justify: inter-word;
  text-align-last: left;
  line-height: 1.6;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* Червен цвят само за опцията „Промоция“ в десктоп селекта */
#sort-select option[value="promo"]{
  color:#ff3b3b;
  font-weight:700;
}

/* Когато е избрана „Промоция“, оцвети самия select */
#sort-select.is-promo{
  color:#ff3b3b;
  font-weight:700;
}

/* мобилните sort бутони са дефинирани основно в rum.html */
/* подсилваме само следното за всеки случай */
.mobile-sort .sort-btn.promo-btn {
  color:#ff3b3b;
  border:1px solid #ff3b3b;
  font-weight:700;
}

/* Хедър мобилно поведение (за продуктови страници) */
@media (max-width: 900px){
  header{
    position: fixed;
    top:0;
    left:0;
    right:0;
    z-index: 9999;
  }

  body{
    padding-top: 70px;
  }

  header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
  }

  header .logo{
    position:absolute;
    left:50%;
    transform:translateX(-50%);
    top:6px;
  }

  header .site-logo{
    max-height:60px;
  }

  header nav{
    width:100%;
    margin-top:56px;
    display:flex;
    gap:12px;
    justify-content:flex-end;
    flex-wrap:wrap;
  }
}
/* Контейнерът на инфо-попъпите (Доставка, Плащане, За нас, Контакти) */
.modal-content.info-modal-content {
    max-width: 700px;
    text-align: left; /* насилваме да не е center */
    line-height: 1.5;

    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

/* Заглавието */
.modal-content.info-modal-content h2 {
    text-align: center;
    color: #ffeb3b; /* дръж го един и същи цвят навсякъде */
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Абзаците */
.modal-content.info-modal-content p {
    text-align: fustify; /* или left, ако искаш варианта от снимка 1 */
    line-height: 1.5;
    margin: 0 16px 16px 16px; /* въздух между абзаците и отстрани */
    white-space: normal;
    color: #fff;
}

/* Бутон "Затвори" */
.modal-content.info-modal-content button {
    display: block;
    margin: 24px auto 0; /* център */
}


/* Promo price styling in cart & checkout */
.cart-price-cell .cart-regular-price {
  font-size: 0.95em;
}

.cart-price-cell .cart-regular-price.cart-promo-active {
  text-decoration: line-through;
  opacity: 0.7;
}

.cart-price-cell .cart-promo-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.cart-price-cell .cart-promo-label {
  font-size: 0.85em;
  opacity: 0.9;
}

.cart-price-cell .cart-promo-price {
  color: #e53935;
  font-weight: 600;
}
