/* =====================================================================
   03 – TERMÉKKÁRTYA (minden listában) + KARUSSZEL (közös)
   Jelvények: inc/home.php (bv-badges) – a Blocksy saját címkéje ki van kapcsolva
   ===================================================================== */

/* ---------- Kártya ---------- */
.woocommerce ul.products li.product {
	position: relative;
	display: flex !important; flex-direction: column;
	min-width: 0; /* a tartalom (pl. töltő gomb) ne szélesíthesse ki a kártyát */
	padding: 8px 8px 16px !important;
	background: var(--bv-white); border: 1px solid var(--bv-line); border-radius: var(--bv-radius);
	text-align: left;
}
.woocommerce ul.products li.product a { text-decoration: none; }

/* Kép: négyzetes, fehér háttéren (--bv-card-bg). A "multiply" keverés miatt a fotók
   fehér háttere bármilyen kártyaszínbe beleolvad. */
.woocommerce ul.products li.product figure,
.woocommerce ul.products li.product .ct-media-container {
	display: block !important; aspect-ratio: 1 / 1; margin: 0 0 12px !important;
	background: var(--bv-card-bg); border-radius: 12px; overflow: hidden;
}
/* A kép kitölti a négyzetet (a kártyakép a WooCommerce-ben 1:1-re vágott, inc/shop.php), így a
   lekerekítés a fotó sarkán van – a háttérrel készült fotóknál is –, és a jelvények a képen ülnek. */
.woocommerce ul.products li.product img {
	display: block; width: 100% !important; height: 100% !important; aspect-ratio: auto !important;
	object-fit: cover; margin: 0 !important; mix-blend-mode: multiply; border-radius: 12px;
}
/* Régebbi böngészők (iOS 14 előtt) nem ismerik az aspect-ratio-t: ott a négyzetet a ::before tartja ki */
@supports not (aspect-ratio: 1 / 1) {
	.woocommerce ul.products li.product .ct-media-container { position: relative; }
	.woocommerce ul.products li.product .ct-media-container::before { content: ""; display: block; padding-top: 100%; }
	.woocommerce ul.products li.product .ct-media-container img { position: absolute; top: 0; left: 0; }
}
/* A Blocksy saját "SOLD OUT" címkéje helyett a .bv-badges "Elfogyott" jelvénye (inc/stock.php) */
.out-of-stock-badge { display: none !important; }

/* Kívánságlista szív a kép jobb felső sarkában (inc/wishlist.php) */
.bv-wish {
	display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
	border: 0; border-radius: 50%; background: var(--bv-white); color: var(--bv-text);
}
.bv-wish svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; transition: fill .15s ease; }
.bv-wish:hover { color: var(--bv-brown); }
.bv-wish[aria-pressed="true"] { color: var(--bv-brown); }
.bv-wish[aria-pressed="true"] svg { fill: currentColor; }
.bv-wish.is-pop svg { animation: bv-pop .35s ease; }
@keyframes bv-pop { 50% { transform: scale(1.25); } }
.bv-wish--card { position: absolute; top: 14px; right: 18px; z-index: 3; width: 36px; height: 36px; box-shadow: 0 2px 8px rgba(61,43,36,.12); }

/* Jelvények: Újdonság / Kedvenc + kedvezmény */
.bv-badges { position: absolute; top: 14px; left: 18px; right: 60px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; }
.bv-badge { padding: 2px 8px; border-radius: var(--bv-pill); font-size: 11px; font-weight: 700; line-height: 1.6; }
.bv-badge--new { background: var(--bv-white); color: var(--bv-text); box-shadow: 0 0 0 1px var(--bv-line); }
.bv-badge--sale { background: var(--bv-brown); color: var(--bv-white); }
.bv-badge--stock { background: var(--bv-text); color: var(--bv-white); }  /* Elfogyott / Beszerzés alatt */
.bv-badge--preorder { background: var(--bv-white); color: var(--bv-brown); box-shadow: 0 0 0 1px var(--bv-brown); }

/* Név, kiszerelés, ár */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	min-height: 2.7em; margin: 0 0 auto !important; padding: 0 8px !important;
	font-family: var(--bv-font-body); font-feature-settings: normal;
	font-size: 15px !important; font-weight: 700; line-height: 1.35; letter-spacing: 0;
	color: var(--bv-text) !important;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bv-loop-size { display: block; padding: 12px 8px 2px; font-size: 11px; text-transform: uppercase; color: var(--bv-text); }
.bv-loop-stock { display: block; padding: 2px 8px 0; font-size: 12px; font-weight: 600; color: var(--bv-brown); }  /* előrendelhető: inc/stock.php */
.woocommerce ul.products li.product .price {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px;
	margin: 0 0 14px !important; padding: 0 8px;
	font-family: var(--bv-font-body); font-size: 17px !important; font-weight: 700; color: var(--bv-brown) !important;
}
.woocommerce ul.products li.product .price .woocommerce-Price-amount { color: inherit; }
.woocommerce ul.products li.product .price ins { order: 1; text-decoration: none; }
.woocommerce ul.products li.product .price del { order: 2; font-size: 13px; font-weight: 400; color: #6f625b !important; opacity: 1; }
.woocommerce ul.products li.product .price del .woocommerce-Price-amount { color: inherit; }
.bv-loop-pct { order: 3; }

/* Viszonteladói ár (inc/reseller.php): nettó fent, bruttó alatta – kártyán, termékoldalon, kosárpanelen */
.bv-np { display: inline-flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.bv-np__net { font-weight: 700; color: var(--bv-brown); }
.bv-np__gross { font-size: .82em; font-weight: 500; color: var(--bv-muted); }
.bv-np small { font-size: .78em; font-weight: 500; color: var(--bv-muted); }
.bv-np .woocommerce-Price-amount { color: inherit; }

/* Gomb: rövid, balra */
.woocommerce ul.products li.product .button {
	align-self: flex-start; width: auto; min-width: 118px; min-height: 40px;
	margin: 0 8px !important; padding-left: 26px !important; padding-right: 26px !important;
	font-size: 15px !important; font-weight: 700;
}
/* Kosárba rakás után a kosárpanel nyílik ki, külön "Kosár" link nem kell; a gomb a helyén marad,
   rövid ideig „Kosárban ✓” felirattal (js/cards.js) */
.woocommerce ul.products li.product .added_to_cart { display: none !important; }
.woocommerce ul.products li.product .button.added { display: inline-flex !important; }
.woocommerce ul.products li.product .button.added::after { content: none; }
/* Töltés közben a WooCommerce forgó jele helyett halványított gomb – így a gomb mérete nem változik */
.woocommerce ul.products li.product .button.loading { opacity: .65; cursor: progress; }
.woocommerce ul.products li.product .button.loading::after { content: none !important; display: none !important; }
/* Viszonteladó: mennyiségválasztó a Kosárba gomb mellett, egy sorban (inc/stock.php, js/cards.js).
   A szülőtéma (Blocksy) számmező-stílusa teljes szélességű mezőt és saját keretet adna – ezért a mező méretei itt !important. */
.bv-card-buy { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0 8px; }
.woocommerce ul.products li.product .bv-card-buy .button {
	flex: 1 1 0; min-width: 0; max-width: 150px; margin: 0 !important; padding-left: 10px !important; padding-right: 10px !important; /* a sor maradékát tölti ki (legfeljebb 150 px): a felirat nem változtat a méretén */
	justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bv-card-buy .bv-card-qty { flex: none; border: 1.5px solid var(--bv-brown); } /* a kosárpanel .bv-qty kerete helyett */
.bv-card-qty .bv-qty__btn { width: 28px; height: 38px; font-size: 17px; }
.bv-card-qty input.bv-qty__input {
	flex: none; width: 34px !important; min-width: 0 !important; height: 38px !important; min-height: 0 !important;
	margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
	font-family: var(--bv-font-body); font-size: 15px; font-weight: 600; line-height: 38px; text-align: center; color: var(--bv-text);
	-moz-appearance: textfield; appearance: textfield;
}
.bv-card-qty input.bv-qty__input::-webkit-outer-spin-button, .bv-card-qty input.bv-qty__input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.bv-card-qty input.bv-qty__input:focus { outline: none; background: var(--bv-cream-light) !important; }
/* Telefonon és tableten egymás alatt, teljes szélességben: fent a mennyiség, alatta a Kosárba gomb */
@media (max-width: 999px) {
	.bv-card-buy { flex-direction: column; align-items: stretch; gap: 8px; margin: 0 4px; }
	.bv-card-buy .bv-card-qty { justify-content: space-between; }
	.woocommerce ul.products li.product .bv-card-buy .button { display: flex; align-items: center; flex: none; box-sizing: border-box; width: 100%; max-width: none; }
}
/* Nem rendelhető termék: halvány "Elfogyott", illetve körvonalas "Értesítést kérek" (inc/stock.php) */
.woocommerce ul.products li.product .bv-btn-soldout { background: var(--bv-cream-light) !important; color: var(--bv-muted) !important; cursor: default; box-shadow: none !important; }
.woocommerce ul.products li.product .bv-btn-notify { background: transparent !important; color: var(--bv-brown) !important; box-shadow: inset 0 0 0 1.5px var(--bv-brown) !important; }
.woocommerce ul.products li.product .bv-btn-notify:hover { background: var(--bv-brown) !important; color: var(--bv-white) !important; }
.woocommerce ul.products li.product.outofstock img { opacity: .55; }
/* Kategória-lista a kártyán nem kell */
.woocommerce ul.products li.product .entry-meta,
.woocommerce ul.products li.product .ct-product-categories { display: none !important; }

/* ---------- Karusszel (főoldal, termékvonalak) – js/home.js ---------- */
.bv-carousel { position: relative; padding-bottom: 36px; }
.bv-carousel .bv-scroller {
	display: flex !important; gap: 12px; margin: 0 !important; padding: 2px !important;
	overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.bv-carousel .bv-scroller::-webkit-scrollbar { display: none; }
.bv-carousel .bv-scroller.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.bv-carousel .bv-scroller > * {
	flex: 0 0 calc((100% - 48px) / 5) !important; width: auto !important; min-width: 0 !important; margin: 0 !important;
	scroll-snap-align: start;
}
.bv-car-arrow {
	position: absolute; top: calc(50% - 60px); z-index: 3;
	display: inline-flex; align-items: center; justify-content: center;
	width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
	background: var(--bv-white); color: var(--bv-text); font-size: 22px; line-height: 1;
	box-shadow: 0 4px 14px rgba(61,43,36,.18);
}
.bv-car-arrow--prev { left: 16px; }
.bv-car-arrow--next { right: 16px; }
.bv-car-arrow[disabled] { opacity: 0; pointer-events: none; }
.bv-car-dots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 10px; }
.bv-car-dot { width: 9px; height: 9px; padding: 0; border: 1px solid var(--bv-text); border-radius: 50%; background: transparent; cursor: pointer; }
.bv-car-dot.is-active { background: var(--bv-text); }
.bv-carousel.is-single .bv-car-dots { display: none; }

/* ---------- Termékvonal kártya (főoldal karusszel, Termékvonalak oldal) ---------- */
.bv-line { display: flex; flex-direction: column; overflow: hidden; background: var(--bv-white); border: 1px solid var(--bv-line); border-radius: var(--bv-radius); }
.bv-line a { text-decoration: none; }
.bv-line__img { display: block; background: var(--bv-card-bg); }
.bv-line__img img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; mix-blend-mode: multiply; }
.bv-line__body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px 20px; }
.bv-line__body h3 { margin: 0 0 2px; font-family: var(--bv-font-body); font-feature-settings: normal; font-size: 17px; font-weight: 700; color: var(--bv-text); }
.bv-line__body p { margin: 0; font-size: 14px; }
.bv-line__from { margin: 10px 0 14px !important; font-weight: 700; }
.bv-line__body .button { margin-top: auto; }
.bv-carousel .bv-track > .bv-line { flex-basis: calc((100% - 48px) / 4.2) !important; }

.bv-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 16px; margin: 0; padding: 0; }
.bv-more { margin: 20px 0 0; text-align: center; }

/* ---------- Reszponzív ---------- */
@media (max-width: 1200px) { .bv-carousel .bv-scroller > * { flex-basis: calc((100% - 36px) / 4) !important; } }
@media (max-width: 900px) {
	.bv-carousel .bv-scroller > * { flex-basis: calc((100% - 24px) / 3) !important; }
	.bv-carousel .bv-track > .bv-line { flex-basis: calc((100% - 24px) / 2.3) !important; }
}
@media (max-width: 600px) {
	.bv-carousel .bv-scroller > * { flex-basis: calc((100% - 12px) / 2.15) !important; }   /* 2 termék + a következő széle, mint a listákban */
	.bv-carousel .bv-track > .bv-line { flex-basis: 78% !important; }
	.bv-lines { grid-template-columns: 1fr 1fr; gap: 10px; }
	.bv-line__body { padding: 12px 12px 14px; }
	.bv-line__body h3 { font-size: 15px; }
	.bv-line__body .button { width: 100%; padding-left: 10px !important; padding-right: 10px !important; }
	.bv-car-arrow { display: none; }
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 13px !important; }
	.woocommerce ul.products li.product .price { font-size: 15px !important; }
	.woocommerce ul.products li.product .button { min-width: 0; padding-left: 18px !important; padding-right: 18px !important; font-size: 13px !important; }
}
