/* ===========================
   SHOP – GRID I KARTICE
   =========================== */

/* Naslovi grupa i podgrupa */
.product-group h2 {
  text-align: center;
  font-size: 28px;
  margin: 2rem 0 1.5rem;
  color: var(--accent);
}

.product-subgroup h3 {
  margin: 1rem 0 .5rem 1rem;
  font-size: 20px;
  color: var(--accent);
}

/* === GRID: 1 / 2 / 3 kartice u redu === */

/* Mobitel – 1 kartica */
.product-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 0 20px 40px;
  align-items: stretch;
}

/* Tablet – 2 kartice */
@media (min-width: 768px) {
  .product-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop – 3 kartice */
@media (min-width: 1200px) {
  .product-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===========================
   KARTICA PROIZVODA
   =========================== */

.product-card {
  background: #fde9e6;
  border-radius: 16px;
  border: 4px solid #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  align-items: stretch;

  padding: 16px 18px 18px;

  /* stabilna visina na desktopu */
  min-height: 540px;
}

/* na jako širokim ekranima malo veća minimalna visina */
@media (min-width: 1400px) {
  .product-card {
    min-height: 560px;
  }
}

/* na manjim ekranima neka kartica bude “normalna” */
@media (max-width: 767px) {
  .product-card {
    min-height: 0;
  }
}

/* GLAVNA SLIKA */

.main-image {
  width: 100%;
  max-width: 260px;
  margin: 0 auto 12px;
  border-radius: 10px;
  overflow: hidden;
  background: #fde9e6;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1/1;   /* rezervira prostor prije učitavanja */
}

.main-image img,
.main-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* TEKSTUALNI DIO */

.product-right {
  width: 100%;
  padding: 4px 4px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.product-right h4 {
  font-size: 1rem;
  color: #333;
  margin: 4px 0 6px;
  text-align: center;
  width: 100%;
}

.product-right p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 15;
  line-clamp: 15;
  line-height: 1.5;
  max-height: calc(15 * 1.5em);
}

.meta-row {
  margin: .25rem 0;
  color: #333;
  font-size: 0.7rem;
}

.meta-label {
  font-weight: 700;
}

/* CIJENE */

.price-block {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.old-price {
  text-decoration: line-through;
  color: #999;
  font-size: .9rem;
}

.new-price {
  color: #e65100;
  font-weight: 700;
  font-size: 1.1rem;
}

.discount-pill {
  background: #ff5252;
  color: #fff;
  font-size: .8rem;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ===========================
   THUMB STRIP ISPOD OGLASA
   =========================== */

.thumb-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0;
  margin: 10px 0 8px;
  width: 100%;
  scrollbar-width: none;
  min-height: var(--thumb-h); /* rezervira visinu */
}

.thumb-strip::-webkit-scrollbar {
  display: none;
}

.thumb {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #ddd;
}

.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb:hover {
  opacity: .75;
}

/* ===========================
   GUMBI U KARTICI
   =========================== */

.shop-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 0;
}

.product-left .btn {
  width: 80%;
  max-width: 260px;
}

/* osnovni stil gumba */
.btn {
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    opacity .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

/* Dodaj u košaricu */
.btn-cart {
  background: #FFD166;
  color: #3b3b3b;
}

/* Više slika / galerija */
.btn-more-photos {
  background: #F5D7FF;
  color: #555;
  border: 1px solid #e6d6ea;
}

/* rasprodan / rezerviran */
.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===========================
   SHELL + THUMB KARTICA
   =========================== */

.product-shell {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
}

/* glavna kartica */
.product-shell .product-card {
  flex: 0 0 auto;
}

/* mala kartica za thumbove ispod oglasa */
.thumb-card {
  background: #fde9e6;
  border-radius: 16px;
  border: 4px solid #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,0.07);
  padding: 6px 10px 8px;
}

/* unutar thumb-kartice, traka niska */
.thumb-card .thumb-strip {
  margin-top: 0;
  padding: 4px 0;
}

/* malo manji thumbovi u shellu */
.thumb-card .thumb {
  width: 54px;
  height: 54px;
}

/* na vrlo uskim ekranima malo zraka ispod */
@media (max-width: 768px) {
  .product-shell {
    margin-bottom: 1rem;
  }
}

/* ===========================
   MOBITEL TWEAKOVI
   =========================== */

@media (max-width: 768px) {
  .product-card {
    padding: 14px 12px 16px;
  }

  .main-image {
    max-width: 100%;
  }
}

/* Poruka kad nema proizvoda */
.empty {
  color: #999;
  font-size: .95rem;
  padding: 0 20px 20px;
  text-align: center;
}
/* ⭐ Zvjezdica za favorite na kartici */
.product-card {
  position: relative; /* ako već nije definirano */
}

.fav-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

.fav-toggle.fav-active {
  background: #ffd54f;
}

