/* Category Carousel */
.catc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.catc-title {
  margin: 0;
  font-weight: 600;
}
.catc-nav {
  display: flex;
  gap: 8px;
}
.catc-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.catc-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.catc-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.catc-viewport.dragging {
  cursor: grabbing;
}
.catc-track {
  display: flex;
  gap: 12px;
}
.catc-card {
  flex: 0 0 calc((100% - 24px) / 3); /* 3 po redu, 24px = gap*2 približno kad se prelama */
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ececec;
  scroll-snap-align: start;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.catc-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.catc-imgwrap {
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.catc-imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.catc-name {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
}

.catc-empty {
  padding: 16px;
  color: #666;
}

/* --- FORCE 3 KOCKICE UVIJEK (mob/tablet/desktop) --- */
.catc-track {
  gap: 8px !important;
}

.catc-card {
  /* 3 po redu, gap = 8px => 2*8 = 16 */
  flex: 0 0 calc((100% - 16px) / 3) !important;
  min-width: calc((100% - 16px) / 3) !important;
}

/* kvadratne slike */
.catc-imgwrap {
  aspect-ratio: 1 / 1;
}

/* naslov u sredini kocke (overlay) */
.catc-card {
  position: relative;
  overflow: hidden;
}
.catc-name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 8px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  color: #111;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.35)
  );
}

/* --- 3 u redu (ostaje) --- */
.catc-track {
  gap: 8px !important;
}
.catc-card {
  flex: 0 0 calc((100% - 16px) / 3) !important;
  min-width: calc((100% - 16px) / 3) !important;
  position: relative;
  overflow: hidden;
}

/* kvadratne slike */
.catc-imgwrap {
  aspect-ratio: 1 / 1;
}

/* makni overlay preko ikone/slike i centriraj naziv dole */
.catc-name {
  position: static !important; /* nema overlay-a */
  display: block !important;
  padding: 8px 6px !important;
  text-align: center !important; /* centriran naslov */
  font-weight: 700 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  background: transparent !important; /* bez zamućenja/zasivljenja */
  color: #111 !important;
}

/* osiguraj da slika nije siva/prozirna */
.catc-imgwrap img {
  filter: none !important;
  opacity: 1 !important;
}

/* LAST PRODUCTS GRID: 2x2 po stranici */
.lpg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 8px;
}
.lpg-title {
  margin: 0;
  font-weight: 700;
}
.lpg-nav {
  display: flex;
  gap: 8px;
}
.lpg-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.lpg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.lpg-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.lpg-viewport.dragging {
  cursor: grabbing;
}

.lpg-track {
  display: flex;
  gap: 12px; /* razmak između stranica */
}

/* Jedna “stranica” = punu širinu viewporta, pa grid 2x2 unutar nje */
.lpg-page {
  flex: 0 0 100%;
  scroll-snap-align: start;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
}

/* Kartica proizvoda (auto se rasporedi u gridu) */
.lpg-card {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.lpg-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.lpg-img {
  aspect-ratio: 1/1;
  width: 100%;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lpg-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lpg-img,
.lpg-name {
  color: inherit;
  text-decoration: none;
}

.lpg-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lpg-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
  max-height: 3.2em;
  overflow: hidden;
}
.lpg-sku {
  font-size: 11px;
  color: #666;
}
.lpg-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.lpg-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}
.lpg-price-label {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: #7b8aa5;
  text-transform: uppercase;
}
.lpg-price-value {
  color: #1f6feb;
}
.lpg-cart-form {
  margin: 0;
}
.lpg-cart-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: #1f6feb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lpg-cart-btn .lnr {
  font-size: 14px;
}
.lpg-cart-btn.is-done {
  background: #28a745;
  cursor: default;
}
.lpg-cart-check {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.lpg-cart-added {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #1f6feb;
  font-weight: 600;
  white-space: nowrap;
}

.lpg-empty {
  padding: 14px;
  color: #666;
}

/* === SUBCATEGORIES GRID (12/stranica, 2 kolone × 6 redova) === */
.cpp-head,
.cpp-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}
.cpp-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cpp-pages {
  display: flex;
  gap: 4px;
}
.cpp-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.cpp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cpp-btn_active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.cpp-body {
  margin-top: 8px;
}
.cpp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
}
.cpp-card {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.cpp-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.cpp-img {
  aspect-ratio: 1/1;
  width: 100%;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cpp-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cpp-img,
.cpp-name {
  color: inherit;
  text-decoration: none;
}

.cpp-body .cpp-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
  padding: 8px 8px 0;
}
.cpp-sku {
  font-size: 11px;
  color: #666;
  padding: 0 8px;
}
.cpp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 10px;
}
.cpp-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}
.cpp-price-label {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: #7b8aa5;
  text-transform: uppercase;
}
.cpp-price-value {
  color: #1f6feb;
}
.cpp-cart-form {
  margin: 0;
}
.cpp-cart-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: #1f6feb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cpp-cart-btn .lnr {
  font-size: 14px;
}
.cpp-cart-btn.is-done {
  background: #28a745;
  cursor: default;
}
.cpp-cart-check {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.cpp-cart-added {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #1f6feb;
  font-weight: 600;
  white-space: nowrap;
}

.cpp-empty,
.cpp-loading {
  padding: 14px;
  color: #666;
  text-align: center;
}
