/* Cofactor - window after "Į krepšelį" */
.cf-cp { --cf-blue: #234D9C; --cf-sky: #229AC8; --cf-text: #1d2433; --cf-muted: #6b7280; --cf-line: #e5e7eb;
	position: fixed; inset: 0; z-index: 1000010; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--cf-text); }
.cf-cp[hidden] { display: none; }
.cf-cp-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .55); opacity: 0; transition: opacity .2s; }
.cf-cp-box { position: relative; width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; background: #fff; border-radius: 12px;
	padding: 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); transform: translateY(12px); opacity: 0; transition: transform .2s, opacity .2s; outline: none; }
.cf-cp.is-open .cf-cp-backdrop { opacity: 1; }
.cf-cp.is-open .cf-cp-box { transform: none; opacity: 1; }
html.cf-cp-lock, html.cf-cp-lock body { overflow: hidden; }

.cf-cp-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: none; font-size: 28px; line-height: 1; color: var(--cf-muted); cursor: pointer; border-radius: 50%; }
.cf-cp-x:hover { background: #f3f4f6; color: var(--cf-text); }
.cf-cp-title { font-size: 18px; font-weight: 700; margin: 0 40px 16px 0; display: flex; align-items: center; gap: 8px; }
.cf-cp-title i { color: #16a34a; font-size: 22px; }

.cf-cp-item { display: flex; gap: 16px; align-items: center; min-height: 80px; }
.cf-cp-item img { width: 80px; height: 80px; object-fit: contain; border: 1px solid var(--cf-line); border-radius: 8px; flex: 0 0 80px; background: #fff; }
.cf-cp-info { min-width: 0; }
.cf-cp-name { display: block; font-weight: 600; color: var(--cf-text); text-decoration: none; line-height: 1.35; }
.cf-cp-name:hover { color: var(--cf-blue); text-decoration: underline; }
.cf-cp-opt { font-size: 13px; color: var(--cf-muted); }
.cf-cp-qty { margin-top: 4px; }
.cf-cp-price s { color: var(--cf-muted); font-size: .9em; margin-right: 2px; }
.cf-cp-price b { color: var(--cf-text); }
.cf-cp-price s + b { color: #d61f26; }
.cf-cp-loading { width: 100%; height: 80px; border-radius: 8px; background: linear-gradient(90deg, #f3f4f6 25%, #e9ebef 50%, #f3f4f6 75%); background-size: 200% 100%; animation: cf-cp-shine 1.2s infinite linear; }
@keyframes cf-cp-shine { to { background-position: -200% 0; } }

.cf-cp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.cf-cp-buy, .cf-cp-more { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; }
.cf-cp-buy { background: var(--cf-blue); border: 2px solid var(--cf-blue); color: #fff; }
.cf-cp-buy:hover, .cf-cp-buy:focus { background: #1a3b7a; border-color: #1a3b7a; color: #fff; }
.cf-cp-more { background: #fff; border: 2px solid var(--cf-line); color: var(--cf-text); }
.cf-cp-more:hover, .cf-cp-more:focus { border-color: var(--cf-blue); color: var(--cf-blue); }
.cf-cp-cart { margin-top: 10px; text-align: center; font-size: 13px; color: var(--cf-muted); min-height: 1em; }

.cf-cp-xs { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--cf-line); }
.cf-cp-xs[hidden] { display: none; }
.cf-cp-xs-title { font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.cf-cp-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cf-cp-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--cf-line); border-radius: 10px; min-width: 0; }
.cf-cp-card-img { display: block; text-align: center; }
.cf-cp-card-img img { width: 100%; max-width: 120px; height: auto; aspect-ratio: 1; object-fit: contain; }
.cf-cp-card-name { color: var(--cf-text); text-decoration: none; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.9em; }
.cf-cp-card-name:visited, .cf-cp-card-name:focus { color: var(--cf-text); text-decoration: none; }
@media (hover: hover) { .cf-cp-card-name:hover { color: var(--cf-blue); text-decoration: underline; } }
.cf-cp-card .cf-cp-price { font-size: 14px; margin-top: auto; }
.cf-cp-add { min-height: 40px; border: 2px solid var(--cf-sky); background: #fff; color: var(--cf-blue); border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; padding: 6px 8px; }
.cf-cp-add:hover { background: var(--cf-sky); color: #fff; }
.cf-cp-add.is-loading { opacity: .6; cursor: progress; }
.cf-cp-add.is-added { border-color: #16a34a; background: #16a34a; color: #fff; cursor: default; }

/* Phone: bottom sheet, cross-sell scrolls sideways */
@media (max-width: 575.98px) {
	.cf-cp { align-items: flex-end; }
	.cf-cp-box { width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(40px); }
	.cf-cp-title { font-size: 17px; }
	.cf-cp-item img { width: 64px; height: 64px; flex-basis: 64px; }
	.cf-cp-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
	.cf-cp-list::-webkit-scrollbar { display: none; }
	.cf-cp-card { flex: 0 0 42%; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
	.cf-cp-backdrop, .cf-cp-box { transition: none; }
	.cf-cp-loading { animation: none; }
}

/* Preview link only (module still off) */
.cf-preview-badge { position: fixed; top: 8px; left: 8px; z-index: 1000011; padding: 4px 10px; border-radius: 999px; background: #f59e0b; color: #1d2433; font: 700 12px/1.4 system-ui, sans-serif; text-decoration: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.cf-preview-badge:hover { background: #d97706; color: #1d2433; }

/* Mini cart (header dropdown): list scrolls, total and button always visible */
#cart .dropdown-menu { --cf-blue: #234D9C; --cf-text: #1d2433; --cf-muted: #6b7280; --cf-line: #e5e7eb;
	width: 400px; max-width: calc(100vw - 16px); padding: 0 !important; border: 1px solid #c9d1de !important; border-top: 4px solid var(--cf-blue) !important; border-radius: 12px !important; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); overflow: hidden; color: var(--cf-text); }
#cart .dropdown-menu.show { display: flex; flex-direction: column; max-height: calc(100vh - var(--cf-mc-top, 120px) - 12px); max-height: calc(100dvh - var(--cf-mc-top, 120px) - 12px); }
#cart .dropdown-menu > li { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
#cart .dropdown-menu > li > ul.list-unstyled { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; margin: 0; padding: 12px 14px 0 !important; }
#cart .dropdown-menu > li > ul > li.row { flex-wrap: nowrap; margin: 0 0 10px !important; padding-bottom: 10px; border-bottom: 1px solid var(--cf-line) !important; --bs-gutter-x: 12px; }
#cart .dropdown-menu > li > ul > li.row:last-child { border-bottom: 0 !important; margin-bottom: 0 !important; }
#cart .dropdown-menu > li > ul > li.row > div:first-child { flex: 0 0 64px; width: 64px; }
#cart .dropdown-menu > li > ul > li.row > div:first-child img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px !important; }
#cart .dropdown-menu > li > ul > li.row > div:nth-child(2) { flex: 1 1 auto; width: auto; min-width: 0; }
#cart .dropdown-menu > li > ul > li.row > div:nth-child(2) > a { font-size: 14px; line-height: 1.3; font-weight: 600 !important; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2px !important; }
#cart .dropdown-menu > li > ul > li.row > div:nth-child(2) .badge { display: none; }
#cart .dropdown-menu > li > ul > li.row > div:nth-child(2) .mt-1 { font-size: 14px; }
#cart .dropdown-menu > li > ul > li.row > div:last-child { flex: 0 0 40px; width: 40px; }
#cart .dropdown-menu .btn-outline-danger, #cart .dropdown-menu .btn-outline-danger i { color: #9ca3af !important; background: none !important; }
#cart .dropdown-menu .btn-outline-danger:hover i, #cart .dropdown-menu .btn-outline-danger:focus i { color: #d61f26 !important; }
#cart .dropdown-menu > li > div { flex: none; padding: 12px 14px 14px; background: #fff; border-top: 1px solid var(--cf-line); box-shadow: 0 -6px 14px rgba(16, 24, 40, .05); }
#cart .dropdown-menu .cart-total-footer { border: 0 !important; padding: 0 !important; margin: 0 !important; }
#cart .dropdown-menu .cart-total-footer .fs-4 { color: var(--cf-text) !important; font-size: 22px !important; }
#cart .dropdown-menu .cf-minicart-actions { margin-top: 12px !important; }
#cart .dropdown-menu .cf-minicart-actions .btn { min-height: 50px; border-radius: 8px; background: var(--cf-blue); font-size: 17px; }

/* While the mini cart is open: dim the page, hide the phone and chat buttons */
body.cf-minicart-open::after { content: ""; position: fixed; inset: 0; z-index: 1010; background: rgba(17, 24, 39, .45); }
body.cf-minicart-open #phone-widget,
body.cf-minicart-open #min-widget,
body.cf-minicart-open #message-preview,
body.cf-minicart-open iframe[title="Pokalbio valdiklis"] { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }

/* Phone: full width panel under the header bar */
@media (max-width: 767.98px) {
	#cart .dropdown-menu.show { position: fixed !important; top: var(--cf-mc-top, 120px) !important; left: 8px !important; right: 8px !important; bottom: auto !important; transform: none !important; width: auto; max-width: none; margin: 0 !important; }
}
