/* =====================================================================
   Care4Everyday · продуктова страница, количка, поръчка, потвърждение
   Правило: бутоните за покупка са най-контрастният елемент и стоят
   винаги на едно и също място (вдясно горе на компютър, долу на телефон).
   ===================================================================== */
html.view-open, html.view-open body { overflow: hidden; }
html.view-modal .hdr, html.view-modal .cursor { visibility: hidden; }
#views:empty { display: none; }

.v { position: fixed; inset: 0; z-index: 80; overflow-y: auto; overscroll-behavior: contain; background: var(--milk); color: var(--wine); animation: vIn .55s var(--ease); }
@keyframes vIn { from { opacity: 0; transform: translateY(24px); } }
.v h2 { font: 400 clamp(28px, 3vw, 44px)/1 var(--display); text-transform: uppercase; color: var(--wine-deep); }

/* горна лента на изгледите */
.v-top, .co-top {
	position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
	padding: 14px var(--pad); background: rgba(245, 245, 245, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(47, 43, 54, .12);
}
.v-top .cart-pill, .co-lock { justify-self: end; }
.v-back { font: 600 13px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; min-height: 44px; display: inline-flex; align-items: center; }
.v-back:hover { color: var(--red); }
.co-lock { font: 600 12px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; opacity: .75; }

/* ---------- бутони за покупка ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 26px;
	border-radius: 999px; border: 0; font: 700 15px/1 var(--ui); letter-spacing: .04em; text-align: center;
	transition: background .25s, transform .15s, box-shadow .25s; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-buy { background: var(--red); color: #fff; box-shadow: 0 10px 24px rgba(123, 94, 140, .32); }
.btn-buy:hover { background: #684d78; }
.btn-add { background: var(--wine-deep); color: var(--milk); }
.btn-add:hover { background: var(--wine); }
.btn.sm { min-height: 48px; padding: 0 18px; font-size: 14px; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; font: 600 13px/1 var(--ui); text-decoration: underline; text-underline-offset: 3px; color: var(--red); min-height: 32px; }

/* =====================================================================
   1. ПРОДУКТОВА СТРАНИЦА
   ===================================================================== */
.pd { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: clamp(20px, 3vw, 56px); padding: clamp(16px, 2vw, 30px) var(--pad) 0; align-items: start; }
.pd-media { position: sticky; top: 90px; }
.pd-tile { position: relative; aspect-ratio: 1; max-height: calc(100svh - 120px); width: 100%; border-radius: var(--r); background: var(--tile); display: grid; place-items: center; overflow: hidden; }
.pd-tile .badge { top: 20px; left: 20px; }
.pd-img { max-height: 76%; max-width: 70%; width: auto; filter: drop-shadow(0 34px 30px rgba(34, 31, 40, .25)); animation: pdIn 1s var(--ease); }
.pd-img.wide { max-width: 90%; transform: rotate(-8deg); }
@keyframes pdIn { from { opacity: 0; transform: translateY(40px) rotate(-6deg); } }
.pd-tile .card-noimg { width: 46%; }

.bb { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.bb-cat { font: 600 12px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.bb-cat:hover { color: var(--red); opacity: 1; }
.bb-name { font: 400 clamp(30px, 3vw, 48px)/1 var(--display); color: var(--wine-deep); text-wrap: balance; }
.bb-rating { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; opacity: .8; min-height: 32px; }
.bb-rating:hover { color: var(--red); opacity: 1; }
.stars { color: var(--sun); letter-spacing: 2px; font-size: 16px; }
.bb-pricebox { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 16px 0; border-block: 1px solid rgba(47, 43, 54, .16); }
.bb-price { font: 400 clamp(40px, 4vw, 58px)/1 var(--display); color: var(--wine-deep); }
.bb-price del { font: 500 17px var(--ui); opacity: .5; margin-right: 10px; vertical-align: middle; }
.bb-price.soon { font: italic 500 34px/1 var(--accent); }
.bb-save { font: 700 12px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; background: var(--red); color: #fff; padding: 7px 10px; border-radius: 999px; }
.bb-pricebox small { flex-basis: 100%; font-size: 13px; opacity: .65; }
.bb-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bb-facts li { display: grid; gap: 2px; font-size: 15px; }
.bb-facts li b { font-weight: 700; color: var(--wine-deep); }
.bb-facts li span { font-size: 13.5px; opacity: .72; }
.bb-facts li.ok b { color: #1d7a45; }
.bb-qty { display: flex; align-items: center; justify-content: space-between; gap: 14px; font: 600 13px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; }
.qty { display: inline-flex; align-items: center; border: 1px solid rgba(47, 43, 54, .3); border-radius: 999px; }
.qty button { width: 44px; height: 44px; border: 0; background: none; font: 400 22px/1 var(--ui); border-radius: 50%; }
.qty button:hover { background: rgba(47, 43, 54, .08); }
.qty output { min-width: 28px; text-align: center; font: 600 16px/1 var(--ui); }
.qty.sm button { width: 34px; height: 34px; font-size: 18px; }
.bb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bb-actions .btn:only-child { grid-column: 1 / -1; }
.bb-note { font-size: 13px; opacity: .65; margin-top: -4px; }
.bb-soon { font-size: 15px; opacity: .85; }

.trust { list-style: none; margin: 6px 0 0; padding: 14px 0 0; border-top: 1px solid rgba(47, 43, 54, .16); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: 12.5px; opacity: .85; }
.trust li { display: grid; gap: 2px; }
.trust b { font-size: 13px; color: var(--wine-deep); }

.pd-more { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 90px); padding: clamp(50px, 6vw, 100px) var(--pad) 0; }
.pd-more h2 { margin-bottom: 18px; }
.pd-list { margin: 0; padding: 0; list-style: none; display: grid; }
.pd-list li { padding: 14px 0; border-top: 1px solid rgba(47, 43, 54, .16); font-size: 16px; }
.pd-list li::before { content: "◆"; color: var(--red); font-size: 9px; margin-right: 12px; vertical-align: 2px; }
.pd-empty { font-size: 15px; opacity: .75; max-width: 46ch; }
.pd-rel { padding: clamp(50px, 6vw, 100px) var(--pad) 120px; }
.pd-rel h2 { margin-bottom: 22px; }
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 24px); }
.mini { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.mini-tile { aspect-ratio: 4 / 3; border-radius: var(--r); background: var(--tile); display: grid; place-items: center; margin-bottom: 8px; transition: transform .6s var(--ease); }
.mini:hover .mini-tile { transform: rotate(-1.4deg); }
.mini-tile { overflow: hidden; }
.mini-tile img { max-height: 76%; max-width: 64%; width: auto; min-width: 0; filter: drop-shadow(0 16px 14px rgba(34, 31, 40, .2)); }
.mini-tile img.wide { max-width: 84%; }
.mini-tile .card-noimg { width: 34%; font-size: 9px; }
.mini-b { font: 700 11px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.mini-n { font: 400 18px/1.15 var(--display); color: var(--wine-deep); }
.mini-p { font: 400 20px/1 var(--display); }

/* лента за покупка — само на телефон (видима без скрол) */
.buybar { display: none; }

/* =====================================================================
   КОЛИЧКА (чекмедже)
   ===================================================================== */
.v-drawer { background: transparent; overflow: hidden; animation: none; }
.v-scrim { position: absolute; inset: 0; background: rgba(34, 31, 40, .5); animation: fade .4s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--milk); display: flex; flex-direction: column; animation: slide .6s var(--ease); }
@keyframes slide { from { transform: translateX(100%); } }
.drawer-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid rgba(47, 43, 54, .14); }
.drawer-h h2 { font-size: 30px; }
.drawer-h small { font: 600 14px var(--ui); color: var(--red); vertical-align: 6px; }
.cl-list { list-style: none; margin: 0; padding: 8px 22px; flex: 1 1 auto; overflow-y: auto; }
.cl { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(47, 43, 54, .12); align-items: start; }
.cl-tile { width: 76px; height: 76px; border-radius: 12px; background: var(--tile); display: grid; place-items: center; }
.cl-tile img { max-height: 80%; max-width: 70%; width: auto; }
.cl-tile .card-noimg { width: 60%; font-size: 7px; padding: 2px; }
.cl-info { display: grid; gap: 6px; font-size: 14px; }
.cl-info a { font: 400 17px/1.15 var(--display); color: var(--wine-deep); }
.cl-p { display: grid; justify-items: end; gap: 8px; font: 400 19px/1 var(--display); }
.cl-x { background: none; border: 0; font: 500 12px var(--ui); text-decoration: underline; opacity: .6; padding: 4px 0; }
.cl-empty { padding: 40px 0; text-align: center; opacity: .7; }
.drawer-f { padding: 16px 22px 22px; border-top: 1px solid rgba(47, 43, 54, .14); display: grid; gap: 10px; }
.drawer-cont { text-align: center; font: 600 13px/1 var(--ui); padding: 10px; opacity: .75; }
.sum-row { display: flex; justify-content: space-between; gap: 14px; font-size: 15px; }
.sum-row b { font: 400 22px/1 var(--display); }
.sum-row.muted { font-size: 13px; opacity: .7; }
.sum-row.total { padding-top: 12px; border-top: 1px solid rgba(47, 43, 54, .16); font-weight: 700; }
.sum-row.total b { font-size: 30px; }
.sum-row small { font: 500 12px var(--ui); opacity: .7; }

/* =====================================================================
   2. ПОРЪЧКА — без меню, без банери
   ===================================================================== */
.co { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: clamp(20px, 3vw, 56px); padding: clamp(18px, 2.4vw, 36px) var(--pad) 120px; max-width: 1180px; margin: 0 auto; align-items: start; }
.co-main { display: grid; gap: 16px; }
.co-welcome { font: italic 500 22px/1.25 var(--accent); color: var(--wine); }
.co-card { background: var(--white); border: 1px solid rgba(47, 43, 54, .12); border-radius: var(--r); padding: clamp(18px, 2vw, 26px); display: grid; gap: 14px; }
.co-card h2 { font-size: 24px; display: flex; align-items: center; gap: 12px; }
.co-card .n { width: 28px; height: 28px; border-radius: 50%; background: var(--wine); color: var(--milk); display: inline-grid; place-items: center; font: 700 13px/1 var(--ui); }
.co-card-h { display: flex; justify-content: space-between; align-items: center; }
.co-known { font-size: 15.5px; line-height: 1.5; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld { display: grid; gap: 6px; font: 600 12px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; }
.fld input, .fld select {
	min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid rgba(47, 43, 54, .28); background: #fff;
	font: 500 16px var(--ui); color: var(--wine-deep); letter-spacing: 0; text-transform: none; width: 100%;
}
.fld input:focus, .fld select:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(47, 43, 54, .14); }
.fld.err input { border-color: var(--red); box-shadow: 0 0 0 3px rgba(123, 94, 140, .18); }
.fld.err::after { content: "Попълни това поле"; color: var(--red); font: 600 12px var(--ui); text-transform: none; letter-spacing: 0; }
.hint { font-size: 13px; opacity: .65; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.seg-o { position: relative; cursor: pointer; }
.seg-o input { position: absolute; opacity: 0; }
.seg-o span { display: grid; gap: 4px; min-height: 64px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(47, 43, 54, .28); background: #fff; transition: all .2s; }
.seg-o b { font-size: 15px; color: var(--wine-deep); }
.seg-o small { font-size: 12.5px; opacity: .7; }
.seg-o input:checked + span { border-color: var(--wine); background: rgba(47, 43, 54, .06); box-shadow: inset 0 0 0 1px var(--wine); }
.seg-o input:focus-visible + span { outline: 2px solid var(--wine); outline-offset: 2px; }

.express { display: grid; gap: 10px; }
.express-l { font: 600 12px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.express-b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xpay { min-height: 52px; border-radius: 12px; border: 0; background: #000; color: #fff; font: 600 17px/1 -apple-system, system-ui, sans-serif; }
.xpay.google { background: #fff; color: #202124; border: 1px solid #dadce0; }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; opacity: .65; margin-top: 6px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(47, 43, 54, .2); }

.co-sum { position: sticky; top: 90px; background: var(--white); border: 1px solid rgba(47, 43, 54, .12); border-radius: var(--r); padding: clamp(18px, 2vw, 26px); display: grid; gap: 12px; }
.co-sum h2 { font-size: 24px; }
.co-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.co-lines li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.co-tile { position: relative; width: 56px; height: 56px; border-radius: 10px; background: var(--tile); display: grid; place-items: center; }
.co-tile img { max-height: 80%; max-width: 70%; width: auto; }
.co-tile .card-noimg { width: 60%; font-size: 6px; padding: 1px; }
.co-tile em { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--wine); color: var(--milk); font: 700 11px/20px var(--ui); text-align: center; font-style: normal; }
.co-lines b { font: 400 18px/1 var(--display); }
.co-eta { font-size: 14px; }
.co-legal { font-size: 12px; opacity: .65; text-align: center; }
.co-legal a { text-decoration: underline; }

/* =====================================================================
   3. ПОТВЪРЖДЕНИЕ
   ===================================================================== */
.done { max-width: 720px; margin: 0 auto; padding: clamp(50px, 8vw, 120px) var(--pad) 0; text-align: center; display: grid; justify-items: center; gap: 22px; }
.done h1 { font: 400 clamp(54px, 8vw, 120px)/.9 var(--display); text-transform: uppercase; color: var(--red); }
.done h1 .it { text-transform: none; color: var(--wine); font-size: .7em; }
.done p { font-size: 17px; max-width: 48ch; }
.done-save { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; background: var(--white); border: 1px solid rgba(47, 43, 54, .14); border-radius: var(--r); padding: 18px 20px; }
.done-save div { display: grid; gap: 4px; }
.done-save span { font-size: 14px; opacity: .75; }
.done-saved { color: #1d7a45; font-weight: 600; }
.v-done .pd-rel { max-width: 1100px; margin: 0 auto; }
.pv-reset { text-align: center; padding: 0 0 40px; }

/* тост „Добавено“ */
.toast {
	position: fixed; left: 50%; top: 18px; z-index: 95; transform: translate(-50%, -140%);
	display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-radius: 16px; max-width: calc(100vw - 24px);
	background: var(--wine-deep); color: var(--milk); box-shadow: 0 16px 40px rgba(34, 31, 40, .35); transition: transform .6s var(--ease);
}
.toast.on { transform: translate(-50%, 0); }
.toast img { width: 44px; height: 44px; object-fit: contain; background: var(--milk); border-radius: 10px; padding: 4px; }
.toast span { display: grid; font-size: 13px; opacity: .9; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast b { font-size: 14px; }
.toast a { background: var(--red); color: #fff; padding: 0 16px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 10px; font: 700 13px/1 var(--ui); }

/* =====================================================================
   ТЕЛЕФОН: решението е над сгъвката, бутоните са долу и винаги там
   ===================================================================== */
@media (max-width: 860px) {
	.pd { grid-template-columns: minmax(0, 1fr); padding-top: 10px; }
	.pd-media { position: static; }
	.pd-tile { aspect-ratio: 5 / 4; max-height: 38svh; }
	.bb { gap: 10px; }
	.bb-name { font-size: 28px; }
	.bb-price { font-size: 40px; }
	.bb-pricebox { padding: 10px 0; }
	.trust { grid-template-columns: 1fr; }
	.pd-more { grid-template-columns: 1fr; }
	.minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.minis .mini:nth-child(3) { display: none; }
	.buybar {
		display: flex; position: sticky; bottom: 0; z-index: 4; align-items: center; gap: 8px;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--milk); border-top: 1px solid rgba(47, 43, 54, .14);
		box-shadow: 0 -10px 30px rgba(34, 31, 40, .1);
	}
	.buybar-p { flex: 1; display: grid; font: 400 24px/1 var(--display); color: var(--wine-deep); }
	.buybar-p small { font: 500 12px/1.4 var(--ui); opacity: .7; }
	.v-product .bb-actions, .v-product .bb-note { display: none; }
	.v-product .pd-rel { padding-bottom: 40px; }
	.co { grid-template-columns: minmax(0, 1fr); padding-bottom: 30px; }
	.co-sum { position: static; }
	.co-sum .btn.wide { display: none; }
	.f2 { grid-template-columns: 1fr; }
	.v-checkout .buybar { position: sticky; }
	.v-top, .co-top { grid-template-columns: auto 1fr auto; }
	.v-top .logo, .co-top .logo { justify-self: center; }
	.v-top .cart-pill .label { display: none; }
	.co-lock { font-size: 0; }
	.co-lock::before { content: "🔒"; font-size: 16px; }
	.done-save { flex-direction: column; align-items: stretch; }
}
