/* ===========================
   SHOP - GRID I KARTICE
   =========================== */

/* Naslovi grupa i podgrupa */
.product-group h2 {
  text-align: center;
  font-size: 24px;
  margin: 2rem 0 1.5rem;
  color: var(--accent);
}

.product-subgroup h3 {
  margin: 1rem 0 .5rem 1rem;
  font-size: 20px;
  color: var(--accent);
}

body.shop-page .product-subgroup h3 {
  text-align: center;
  margin-right: 1rem;
}

/* === 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; /* jednaka visina unutar reda, prema najduljem naslovu */
}

/* 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;

  min-height: 0;
}

/* Naslov ostaje cijeli; razmak ispod određuje postojeći padding kartice. */
.product-card--grid .product-title-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.product-card--grid .product-right h4 {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}



.product-card--grid .shop-card-details {
  display: none !important;
}

/* GLAVNA SLIKA */

.main-image {
  width: 100%;
  max-width: 190px;
  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 ucitavanja */
}

.main-image img,
.main-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* TEKSTUALNI DIO */

.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 */
/* ===========================
   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;
  }

  /* manja slika na mobitelu */
  .main-image {
    max-width: 220px;   /* probaj 140; mozes kasnije 120 / 160 po osjecaju */
    margin: 0 auto 12px;
  }
}


/* Poruka kad nema proizvoda */
.empty {
  color: #999;
  font-size: .95rem;
  padding: 0 20px 20px;
  text-align: center;
}

/* ? Zvjezdica za favorite na kartici */

.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;
}
