/* =====================================================================
   08 – FELSŐ SZÁLLÍTÁSI SÁV (inc/freebar.php) + OLDALSÓ PANELEK: kosár, fiók
   (inc/drawers.php, js/drawers.js, woocommerce/cart/mini-cart.php)
   ===================================================================== */

/* ---------- Felső sáv: görgetéskor csak a csík marad, egérre lenyílik ----------
   A sáv helye az oldalon minden állapotban ugyanakkora (a margó pótolja az összecsukott szöveget),
   így görgetéskor nem ugrik meg az oldal (--bv-freebar-text: a szöveg magassága, a JS méri). */
.bv-freebar {
	position: -webkit-sticky; position: sticky; top: 0; z-index: 1001; background: var(--bv-cream); color: var(--bv-brown); font-size: 13px;
	transition: margin-bottom .3s ease, padding-bottom .3s ease;   /* a szöveggel együtt mozog → a hely állandó */
}
body.admin-bar .bv-freebar { top: 32px; }
/* Viszonteladói fiók jelzése (inc/reseller.php) */
.bv-reseller-bar { padding: 7px 16px; background: var(--bv-brown); color: var(--bv-white); font-size: 12px; letter-spacing: .04em; text-align: center; }
.bv-freebar.bv-open-cart { cursor: pointer; }
.bv-freebar:focus { outline: none; }
.bv-freebar:focus-visible { outline: 2px solid var(--bv-brown); outline-offset: -2px; }
.bv-freebar__text { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s ease, opacity .25s ease; }
.bv-freebar__text > span { overflow: hidden; padding: 10px 16px 8px; text-align: center; line-height: 1.4; transition: padding .3s ease; }
.bv-freebar__text .woocommerce-Price-amount { color: var(--bv-brown); }
.bv-freebar__track { height: 6px; background: rgba(141,63,43,.15); }
.bv-freebar__track span { display: block; height: 100%; background: var(--bv-brown); transition: width .6s ease; }
.bv-freebar.is-free .bv-freebar__track span { background: var(--bv-rust); }
.bv-freebar.is-empty .bv-freebar__track { display: none; }

body.bv-scrolled .bv-freebar { margin-bottom: calc(var(--bv-freebar-text, 37px) - 6px); padding-bottom: 6px; background: transparent; }  /* +6 px célterület */
body.bv-scrolled .bv-freebar.is-empty { visibility: hidden; }
body.bv-scrolled .bv-freebar__text { grid-template-rows: 0fr; opacity: 0; }
body.bv-scrolled .bv-freebar__text > span { padding-top: 0; padding-bottom: 0; }
body.bv-scrolled .bv-freebar__track { background: var(--bv-cream); }
body.bv-scrolled .bv-freebar:hover,
body.bv-scrolled .bv-freebar:focus { margin-bottom: 0; padding-bottom: 0; background: var(--bv-cream); box-shadow: 0 8px 20px -12px rgba(61,43,36,.4); }
body.bv-scrolled .bv-freebar:hover .bv-freebar__text,
body.bv-scrolled .bv-freebar:focus .bv-freebar__text { grid-template-rows: 1fr; opacity: 1; }
body.bv-scrolled .bv-freebar:hover .bv-freebar__text > span,
body.bv-scrolled .bv-freebar:focus .bv-freebar__text > span { padding-top: 10px; padding-bottom: 8px; }

/* ---------- Panel (közös) ---------- */
html.bv-drawer-lock, html.bv-drawer-lock body { overflow: hidden; }
.bv-drawer-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 99998; background: rgba(61,43,36,.45); opacity: 0; transition: opacity .3s ease; }
.bv-drawer-overlay.is-open { opacity: 1; }
.bv-drawer {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 99999;
	display: flex; flex-direction: column; width: min(440px, 100vw);
	background: var(--bv-bg); box-shadow: -20px 0 40px -20px rgba(61,43,36,.4);
	transform: translateX(100%); transition: transform .3s ease;
}
.bv-drawer.is-open { transform: none; }
.bv-drawer[hidden], .bv-drawer-overlay[hidden] { display: none; }
body.admin-bar .bv-drawer { top: 32px; }

.bv-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; background: var(--bv-white); border-bottom: 1px solid var(--bv-cream); }
.bv-drawer__head h2 { margin: 0; font-family: var(--bv-font-body); font-feature-settings: normal; font-size: 18px; font-weight: 600; color: var(--bv-brown); }
.bv-drawer__close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer; background: var(--bv-cream-light); color: var(--bv-brown); }
.bv-drawer__close:hover { background: var(--bv-cream); }
.bv-drawer__added { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--bv-brown); color: var(--bv-white); font-size: 14px; font-weight: 500; }
.bv-drawer__added[hidden] { display: none; }
.bv-drawer__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- Kosárpanel ---------- */
.bv-drawer__body .widget_shopping_cart_content,
.bv-mc { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.bv-mc__scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 16px 20px; }
.bv-mc__scroll > * { flex: none; }
.bv-mc__items { display: grid; gap: 12px; margin: 0 !important; padding: 0 !important; list-style: none; }
.bv-mc__item { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 14px; margin: 0 !important; padding: 12px 40px 12px 12px !important; background: var(--bv-white); border-radius: 14px; }
.bv-mc__thumb { display: block; border-radius: 10px; background: var(--bv-card-bg); }
.bv-mc__thumb img { width: 84px !important; height: 84px !important; margin: 0 !important; object-fit: contain; mix-blend-mode: multiply; }
.bv-mc__info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bv-mc__name {
	font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--bv-text); text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bv-mc__name:hover { color: var(--bv-brown); }
.bv-mc__price { font-size: 13px; font-weight: 600; color: var(--bv-brown); }
.bv-mc__price del { margin-left: 6px; font-weight: 400; color: #9a8a82; }
.bv-mc__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.bv-mc__line { font-size: 14px; font-weight: 600; color: var(--bv-text); white-space: nowrap; }
.bv-mc__remove {
	position: absolute; top: 10px; right: 10px; display: inline-flex !important; align-items: center; justify-content: center;
	width: 30px; height: 30px; border-radius: 50%; color: #9a8a82 !important; background: transparent !important; font-size: 0 !important;
}
.bv-mc__remove:hover { color: var(--bv-rust) !important; background: var(--bv-cream-light) !important; }

.bv-qty { display: inline-flex; align-items: center; overflow: hidden; background: var(--bv-white); border: 1px solid var(--bv-cream); border-radius: var(--bv-pill); }
.bv-qty__btn { width: 34px; height: 34px; padding: 0; border: 0; cursor: pointer; background: transparent; color: var(--bv-brown); font-size: 18px; line-height: 1; }
.bv-qty__btn:hover:not([disabled]) { background: var(--bv-cream-light); }
.bv-qty__btn[disabled] { opacity: .35; cursor: default; }
.bv-qty__val { min-width: 28px; text-align: center; font-size: 14px; font-weight: 600; }
.bv-qty.is-loading { opacity: .5; pointer-events: none; }

/* Termékajánló a termékek alatt (inc/drawers.php): kevés terméknél a szabad hely aljára kerül */
.bv-mc-reco { margin-top: auto; padding-top: 18px; }
.bv-mc-reco__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.bv-mc-reco__title { margin: 0; font-family: var(--bv-font-body); font-feature-settings: normal; font-size: 15px; font-weight: 700; color: var(--bv-text); }
.bv-mc-reco__nav { display: flex; gap: 6px; }
.bv-mc-reco__arrow {
	display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
	border: 1px solid var(--bv-cream); border-radius: 50%; cursor: pointer; background: var(--bv-white); color: var(--bv-text); font-size: 18px; line-height: 1;
}
.bv-mc-reco__arrow:hover { border-color: var(--bv-brown); color: var(--bv-brown); }
.bv-mc-reco__track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.bv-mc-reco__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.bv-mc-reco__track img { pointer-events: none; }
.bv-mc-reco__track::-webkit-scrollbar { display: none; }
.bv-mc-reco__card { flex: 0 0 148px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; background: var(--bv-white); border-radius: 14px; }
.bv-mc-reco__img { position: relative; display: block; border-radius: 10px; background: var(--bv-card-bg); }
.bv-mc-reco__img img { display: block; width: 100% !important; height: 92px !important; margin: 0 !important; object-fit: contain; mix-blend-mode: multiply; }
.bv-mc-reco__badge { position: absolute; top: 6px; left: 6px; z-index: 2; padding: 2px 7px; border-radius: var(--bv-pill); background: var(--bv-brown); color: var(--bv-white); font-size: 11px; font-weight: 700; }
.bv-mc-reco__name {
	min-height: 2.7em; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--bv-text); text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bv-mc-reco__name:hover { color: var(--bv-brown); }
.bv-mc-reco__add { display: inline-flex !important; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; min-height: 36px; margin-top: auto; padding: 6px 10px; font-size: 13px; }
.bv-mc-reco__add.loading { opacity: .5; pointer-events: none; }

.bv-mc__foot { display: grid; gap: 10px; padding: 16px 20px 20px; background: var(--bv-white); border-top: 1px solid var(--bv-cream); }
.bv-mc__total { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; }
.bv-mc__total strong { font-size: 20px; color: var(--bv-brown); }
.bv-mc__note { margin: -4px 0 4px; font-size: 12px; color: #9a8a82; }
.bv-mc__checkout, .bv-mc__cart { display: inline-flex !important; align-items: center; justify-content: center; width: 100%; min-height: 50px; }

.bv-mc--empty { align-items: center; justify-content: center; gap: 6px; padding: 40px 28px; text-align: center; }
.bv-mc__empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; margin-bottom: 10px; border-radius: 50%; background: var(--bv-cream); color: var(--bv-brown); }
.bv-mc__empty-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--bv-brown); }
.bv-mc__empty-text { margin: 0 0 16px; font-size: 14px; color: var(--bv-muted); }

/* ---------- Fiókpanel ---------- */
.bv-account { gap: 18px; overflow-y: auto; padding: 22px 22px 28px; }
.bv-account p { margin: 0; }
.bv-account__intro { font-size: 15px; line-height: 1.5; }
.bv-account__error { padding: 12px 14px; border-radius: 10px; background: #FBEDE8; color: var(--bv-rust); font-size: 14px; line-height: 1.45; }
.bv-account__error a { color: inherit; text-decoration: underline; }
.bv-account__form { display: grid; gap: 14px; }
.bv-account__form .form-row { display: grid; gap: 6px; margin: 0; padding: 0; }
.bv-account__form label { font-size: 13px; font-weight: 600; color: var(--bv-text); }
.bv-account__form .input-text {
	width: 100%; height: 48px; padding: 0 16px;
	border: 1px solid var(--bv-cream); border-radius: 10px; background: var(--bv-white);
	font-family: var(--bv-font-body); font-size: 15px; color: var(--bv-text);
}
.bv-account__form .input-text:focus { outline: none; border-color: var(--bv-brown); box-shadow: 0 0 0 3px rgba(141,63,43,.12); }
.bv-account__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.bv-account__remember { display: inline-flex; align-items: center; gap: 8px; font-weight: 400 !important; cursor: pointer; }
.bv-account__remember input { width: 16px; height: 16px; accent-color: var(--bv-brown); }
.bv-account__submit, .bv-account .bv-btn-ghost { width: 100%; min-height: 50px; }
.bv-account__new { display: grid; gap: 12px; margin-top: 6px; padding: 20px; border-radius: var(--bv-radius); background: var(--bv-cream-light); }
.bv-account__new-title { font-size: 16px; font-weight: 700; color: var(--bv-text); }
.bv-account__new ul { display: grid; gap: 10px; margin: 0 0 4px; padding: 0; list-style: none; }
.bv-account__new li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.bv-account__new .bv-icon { flex: none; width: 20px; height: 20px; color: var(--bv-brown); }
.bv-account__hello { font-size: 17px; }
.bv-account__menu { display: grid; border-top: 1px solid var(--bv-line); }
.bv-account__menu a {
	display: flex; align-items: center; justify-content: space-between; padding: 15px 4px;
	border-bottom: 1px solid var(--bv-line); color: var(--bv-text); font-size: 15px; font-weight: 500; text-decoration: none;
}
.bv-account__menu a:hover { color: var(--bv-brown); }
.bv-account__menu a span { font-size: 20px; color: var(--bv-muted); }
.bv-account__logout { margin-top: auto; }

/* ---------- Reszponzív ---------- */
@media (max-width: 782px) {
	body.admin-bar .bv-freebar, body.admin-bar .bv-drawer { top: 46px; }
}
@media (max-width: 600px) {   /* telefonon a WP admin sáv nem ragad fent */
	body.admin-bar .bv-freebar, body.admin-bar .bv-drawer { top: 0; }
	.bv-freebar { font-size: 12px; }
	.bv-drawer__head { padding: 14px 16px; }
	.bv-mc__scroll { padding: 12px 14px; }
	.bv-mc__item { grid-template-columns: 72px 1fr; }
	.bv-mc__thumb img { width: 72px !important; height: 72px !important; }
	.bv-mc__foot { padding: 14px 16px 18px; }
	.bv-account { padding: 18px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) {
	.bv-freebar, .bv-freebar__text, .bv-freebar__text > span, .bv-freebar__track span, .bv-drawer, .bv-drawer-overlay { transition: none; }
}
