/* bercov.ro — fereastra „Coșul tău” / „Comanda ta” (port din lahi.ro / ababi.ro), în culorile Bercov.
   Se încarcă pe /cos/ și /finalizare-comanda/; în rest, assets/js/cos.js o aduce la prima deschidere. */

html.bercov-om-lock, html.bercov-om-lock body { overflow: hidden; }
.bercov-om, .bercov-om * { box-sizing: border-box; }
.bercov-om[hidden] { display: none !important; }
.bercov-om { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; font-family: var(--wp--preset--font-family--inter, Inter, sans-serif); color: #16151d; }
body.admin-bar .bercov-om { top: 32px; }
/* deschiderea și închiderea animate (ca pe ababi): .is-open pornește tranzițiile, închiderea așteaptă 350 ms */
.bercov-om__backdrop { position: absolute; inset: 0; background: rgba(22,21,29,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .35s; }
.bercov-om__box { position: relative; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 10px; padding: 0 10px 0 0; width: min(1040px, calc(100vw - 48px)); height: min(860px, calc(100vh - 48px)); background: #f5f5f8; border-radius: 28px; overflow: hidden; box-shadow: 0 40px 120px rgba(0,0,0,.45); opacity: 0; transform: translateY(24px) scale(.98); transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .35s; }
.bercov-om.is-open .bercov-om__backdrop { opacity: 1; }
.bercov-om.is-open .bercov-om__box { opacity: 1; transform: none; }

/* stânga: placa Laborator.ai (coral + personajul) și sumarul pe Ink */
.bercov-om__side { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: #ff5436; color: #fff; }
.bercov-om__visual { flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; padding: 28px 28px 0; }
.bercov-om__visual img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.bercov-om__info { padding: 26px 30px 30px; background: #16151d; }
.bercov-om__eyebrow { display: block; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: #ffb020; }
.bercov-om__title { margin: 8px 0 16px; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: #fff; }
.bercov-om__sum { display: none; }
.bercov-om__items { list-style: none; margin: 0 0 10px; padding: 0; max-height: 132px; overflow-y: auto; }
.bercov-om__items li, .bercov-om__totals div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 14px; line-height: 1.4; }
.bercov-om__items li span:last-child, .bercov-om__totals dd { white-space: nowrap; }
.bercov-om__totals { margin: 0; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.14); }
.bercov-om__totals [hidden] { display: none; }
.bercov-om__totals dt { color: #a9a9b6; }
.bercov-om__totals dd { margin: 0; }
.bercov-om__totals .is-total { padding-top: 8px; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 20px; font-weight: 700; }
.bercov-om__totals .is-total dt { color: #fff; }
.bercov-om__line { margin: 16px 0 0; font-size: 13.5px; line-height: 1.5; color: #c9c9d1; }
.bercov-om__line:empty { display: none; }
.bercov-om.is-done .bercov-om__items, .bercov-om.is-done .bercov-om__totals { opacity: .55; }

/* dreapta: checkout-ul în iframe sau coșul, pe o placă albă rotunjită (ca pe ababi) */
.bercov-om__main { position: relative; min-height: 0; margin: 10px 0; background: #fff; border-radius: 20px; overflow: hidden; }
.bercov-om__frame { display: block; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .3s; background: #fff; }
.bercov-om.is-ready .bercov-om__frame { opacity: 1; }
.bercov-om__loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; font: 600 15px/1.4 var(--wp--preset--font-family--poppins, Poppins, sans-serif); color: #16151d; }
.bercov-om.is-ready .bercov-om__loading { display: none; }
.bercov-om__spin { width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid rgba(255,84,54,.2); border-top-color: #ff5436; animation: bercov-om-spin .9s linear infinite; }
.bercov-om__close { position: absolute; top: 16px; right: 16px; z-index: 3; width: 42px; height: 42px; padding: 0; border-radius: 50%; background: #fff; border: 1px solid #d9d9e1; font-size: 24px; line-height: 1; color: #16151d; cursor: pointer; transition: background .15s, color .15s; }
.bercov-om__close:hover { background: #16151d; color: #fff; border-color: #16151d; }
.bercov-om__close:focus-visible, .bercov-om__back:focus-visible { outline: 2px solid #ff5436; outline-offset: 2px; }
.bercov-om__back { position: absolute; top: 18px; left: 22px; z-index: 2; padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid #d9d9e1; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #16151d; cursor: pointer; }
.bercov-om__back[hidden] { display: none; }
.bercov-om__back:not([hidden]) ~ .bercov-om__frame { height: calc(100% - 60px); margin-top: 60px; }

@keyframes bercov-om-spin { to { transform: rotate(360deg); } }

/* coșul în fereastră */
.bercov-om__cart { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 44px 48px 40px; background: #fff; }
.bercov-om__cart[hidden] { display: none; }
.bercov-om.is-cart .bercov-om__frame, .bercov-om.is-cart .bercov-om__loading, .bercov-om.is-cart .bercov-om__items { display: none; }
.bercov-om.is-busy .bercov-cl__list, .bercov-om.is-busy .bercov-cl__total { opacity: .55; transition: opacity .15s; }
.bercov-om .bercov-co-intro { margin: 0 0 24px; padding-right: 48px; }
.bercov-om .bercov-co-eyebrow { display: block; margin: 0 0 10px; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: #ff5436; }
.bercov-om .bercov-co-intro h2 { margin: 0 0 8px; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: #16151d; }
.bercov-om .bercov-co-intro p { margin: 0; color: #6b6b7b; font-size: 15px; }
.bercov-cl { max-width: 600px; }
.bercov-cl__list { list-style: none; margin: 0 0 8px; padding: 0; }
.bercov-cl__item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto 32px; gap: 16px; align-items: center; padding: 16px; margin-bottom: 10px; background: #f5f5f8; border: 1px solid rgba(22,21,29,.04); border-radius: 18px; transition: opacity .2s; }
.bercov-cl__item.is-leaving { opacity: .3; }
.bercov-cl__img { display: flex; align-items: flex-end; justify-content: center; width: 64px; height: 64px; overflow: hidden; border-radius: 14px; background: #ff5436; }
.bercov-cl__img img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.bercov-cl__name { display: block; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 15px; font-weight: 700; line-height: 1.3; color: #16151d; }
.bercov-cl__info small { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: #6b6b7b; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bercov-qty { display: flex; align-items: center; height: 40px; border: 1px solid #d9d9e1; border-radius: 999px; background: #fff; overflow: hidden; }
.bercov-qty button { width: 36px; height: 100%; padding: 0; background: none; border: 0; font-size: 18px; color: #16151d; cursor: pointer; }
.bercov-qty button:disabled { opacity: .3; cursor: default; }
.bercov-qty span { min-width: 24px; text-align: center; font-weight: 600; }
.bercov-cl__price { min-width: 84px; text-align: right; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 16px; font-weight: 700; white-space: nowrap; }
.bercov-cl__rm { width: 32px; height: 32px; padding: 0; border-radius: 50%; background: none; border: 0; font-size: 22px; line-height: 1; color: #6b6b7b; cursor: pointer; }
.bercov-cl__rm:hover { background: #f5f5f8; color: #ff5436; }
.bercov-cl__coupons { list-style: none; margin: 0; padding: 0; }
.bercov-cl__coupons li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; font-size: 14px; }
.bercov-cl__link { padding: 0; background: none; border: 0; font: inherit; font-size: 13px; color: #6b6b7b; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bercov-cl__link:hover { color: #ff5436; }
.bercov-cl__coupon { margin: 14px 0 0; }
.bercov-cl__coupon summary { cursor: pointer; font-size: 14px; color: #6b6b7b; text-decoration: underline; text-underline-offset: 4px; }
.bercov-cl__coupon-form { display: flex; gap: 8px; margin-top: 10px; }
.bercov-cl__coupon-form input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; font: 16px/1.4 var(--wp--preset--font-family--inter, Inter, sans-serif); color: #16151d; background: #fff; border: 1px solid #d9d9e1; border-radius: 12px; }
.bercov-cl__coupon-form input:focus { outline: 2px solid #16151d; outline-offset: 1px; }
.bercov-om .bercov-btn { border: 0; cursor: pointer; justify-content: center; }
.bercov-btn.bercov-btn--line { background: transparent; color: #16151d; border: 1.5px solid #16151d; padding: 11px 20px; }
.bercov-btn.bercov-btn--line::after { color: #ff5436; }
.bercov-btn.bercov-btn--line:hover { background: #16151d; color: #fff; }
.bercov-cl__msg { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: #b3261e; }
.bercov-cl__msg:empty { display: none; }
.bercov-cl__foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(22,21,29,.12); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bercov-cl__total { display: flex; justify-content: space-between; align-items: baseline; width: 100%; font-size: 15px; color: #6b6b7b; }
.bercov-cl__total strong { font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 26px; font-weight: 800; color: #16151d; }
.bercov-cl__go { width: 100%; padding: 18px 20px !important; font-size: 15px !important; }
.bercov-cl__empty { margin: 40px 0 24px; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 26px; font-weight: 700; }

/* telefon: foaie de jos, cu margini vizibile (ca pe ababi) */
@media (max-width: 782px) { body.admin-bar .bercov-om { top: 46px; } }
@media (max-width: 767px) {
	.bercov-om { align-items: flex-end; }
	/* foaia urcă de jos, lipită de margine, cu 5 px liberi stânga-dreapta; antetul și formularul = 2 plăci cu 10 px între ele (ca pe ababi) */
	.bercov-om__box { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 0; width: calc(100% - 10px); height: 94%; /* % din fereastra fixă: fără svh/dvh — pe iOS strică elementele fixed */ border-radius: 24px 24px 0 0; box-shadow: 0 -10px 50px rgba(0,0,0,.35); opacity: 1; transform: translateY(100%); }
	.bercov-om__side { flex-direction: row; align-items: center; gap: 12px; padding: 14px 64px 14px 14px; background: #16151d; border-radius: 0 0 20px 20px; }
	.bercov-om__main { margin: 0; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
	.bercov-om__visual { flex: 0 0 56px; height: 56px; padding: 4px 4px 0; border-radius: 14px; background: #ff5436; }
	.bercov-om__info { min-width: 0; padding: 0; background: none; }
	.bercov-om__eyebrow { font-size: 10px; }
	.bercov-om__title { margin: 3px 0 1px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.bercov-om__sum { display: block; margin: 0; font-family: var(--wp--preset--font-family--poppins, Poppins, sans-serif); font-size: 13px; font-weight: 600; color: #ffb020; }
	.bercov-om__items, .bercov-om__totals, .bercov-om__line { display: none; }
	.bercov-om__close { top: 14px; right: 12px; width: 40px; height: 40px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
	.bercov-om__cart { padding: 24px 16px 28px; }
	.bercov-om .bercov-co-intro { padding-right: 0; }
	.bercov-cl__item { grid-template-columns: 56px minmax(0, 1fr) auto 28px; grid-template-areas: "img info info rm" "img qty price price"; gap: 8px 12px; padding: 14px; }
	.bercov-cl__img { grid-area: img; width: 56px; height: 56px; align-self: start; }
	.bercov-cl__info { grid-area: info; }
	.bercov-cl__item > .bercov-qty, .bercov-cl__item > span:empty { grid-area: qty; justify-self: start; }
	.bercov-cl__price { grid-area: price; align-self: center; }
	.bercov-cl__rm { grid-area: rm; align-self: start; width: 28px; height: 28px; }
	.bercov-om__back { top: 10px; left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.bercov-om__backdrop, .bercov-om__box { transition: none; }
}
