/**
 * PixelBorsch Core - Side Mini-Cart & Floating Actions Styles
 * Luxury slide-out drawer, glassmorphism overlays, free shipping progress bar,
 * floating cart & conditional search trigger, and instant search modal.
 */

:root {
	--pb-side-cart-width: 440px;
	--pb-side-cart-primary: #c5a059;
	--pb-side-cart-primary-hover: #b08d46;
	--pb-side-cart-dark: #0f172a;
	--pb-side-cart-text: #1e293b;
	--pb-side-cart-muted: #64748b;
	--pb-side-cart-border: #e2e8f0;
	--pb-side-cart-bg: #ffffff;
	--pb-side-cart-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ─────────────────────────────────────────────────────────────
   1. BACKDROP OVERLAY
   ───────────────────────────────────────────────────────────── */
.pb-side-cart-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 999990;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
	cursor: pointer;
}

.pb-side-cart-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

/* ─────────────────────────────────────────────────────────────
   2. SLIDE-OUT DRAWER
   ───────────────────────────────────────────────────────────── */
.pb-side-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: var(--pb-side-cart-width);
	max-width: 92vw;
	height: 100vh;
	height: 100dvh;
	background: var(--pb-side-cart-bg);
	box-shadow: -10px 0 35px rgba(15, 23, 42, 0.18);
	z-index: 999999;
	transform: translateX(100%);
	transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	flex-direction: column;
	font-family: var(--pb-side-cart-font);
	box-sizing: border-box;
}

.pb-side-cart-drawer *,
.pb-side-cart-drawer *::before,
.pb-side-cart-drawer *::after {
	box-sizing: border-box;
}

.pb-side-cart-drawer.is-open {
	transform: translateX(0);
}

.pb-side-cart-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────
   3. DRAWER HEADER
   ───────────────────────────────────────────────────────────── */
.pb-side-cart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid var(--pb-side-cart-border);
	background: #fafafa;
}

.pb-side-cart-title-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pb-side-cart-header-icon {
	font-size: 1.35rem;
}

.pb-side-cart-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--pb-side-cart-dark);
	display: flex;
	align-items: center;
	gap: 6px;
	line-height: 1.2;
}

.pb-side-cart-header-badge {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--pb-side-cart-primary);
}

.pb-side-cart-close {
	background: transparent;
	border: 1px solid transparent;
	color: #64748b;
	cursor: pointer;
	padding: 6px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.pb-side-cart-close:hover {
	background: #f1f5f9;
	color: #0f172a;
	transform: rotate(90deg);
}

/* ─────────────────────────────────────────────────────────────
   4. FREE SHIPPING PROGRESS BAR
   ───────────────────────────────────────────────────────────── */
.pb-shipping-bar-wrap {
	background: #f8fafc;
	padding: 14px 24px;
	border-bottom: 1px solid var(--pb-side-cart-border);
}

.pb-shipping-bar-desc {
	font-size: 0.85rem;
	color: #334155;
	margin-bottom: 8px;
	line-height: 1.35;
	display: flex;
	align-items: center;
	gap: 6px;
}

.pb-shipping-bar-desc strong {
	color: #0f172a;
}

.pb-shipping-bar-congrats {
	color: #059669;
	font-weight: 600;
}

.pb-shipping-bar-track {
	width: 100%;
	height: 7px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
	position: relative;
}

.pb-shipping-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, #c5a059 0%, #10b981 100%);
	border-radius: 999px;
	transition: width 0.4s ease;
	position: relative;
}

.pb-shipping-bar-fill.is-complete {
	background: #10b981;
	box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

/* ─────────────────────────────────────────────────────────────
   5. DYNAMIC CONTENT & ITEMS LIST
   ───────────────────────────────────────────────────────────── */
.pb-side-cart-content {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	position: relative;
}

/* Scrollbar */
.pb-side-cart-content::-webkit-scrollbar {
	width: 5px;
}

.pb-side-cart-content::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 4px;
}

.pb-side-cart-items {
	padding: 16px 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Item Row */
.pb-side-cart-item {
	display: flex;
	gap: 14px;
	padding-bottom: 16px;
	border-bottom: 1px solid #f1f5f9;
	align-items: flex-start;
	position: relative;
	transition: opacity 0.2s ease;
}

.pb-side-cart-item.is-updating {
	opacity: 0.45;
	pointer-events: none;
}

/* Thumbnail */
.pb-side-cart-item-thumb {
	width: 68px;
	height: 68px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pb-side-cart-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Info */
.pb-side-cart-item-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.pb-side-cart-item-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.pb-side-cart-item-name {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--pb-side-cart-dark);
}

.pb-side-cart-item-name a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.pb-side-cart-item-name a:hover {
	color: var(--pb-side-cart-primary);
}

/* Remove button */
.pb-side-cart-item-remove {
	background: transparent;
	border: none;
	color: #94a3b8;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	border-radius: 4px;
	transition: color 0.15s ease, background 0.15s ease;
}

.pb-side-cart-item-remove:hover {
	color: #ef4444;
	background: #fee2e2;
}

/* Pack tag */
.pb-side-cart-item-pack-tag {
	font-size: 0.76rem;
	font-weight: 500;
	color: #059669;
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	padding: 2px 7px;
	border-radius: 4px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	width: fit-content;
}

/* Variations meta */
.pb-side-cart-item-variations {
	font-size: 0.78rem;
	color: #64748b;
	line-height: 1.3;
}

.pb-side-cart-item-variations dl {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
}

.pb-side-cart-item-variations dt,
.pb-side-cart-item-variations dd {
	display: inline;
	margin: 0;
}

.pb-side-cart-item-variations dt {
	font-weight: 600;
}

/* Bottom Row: Stepper + Price */
.pb-side-cart-item-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 6px;
}

/* Quantity Stepper */
.pb-side-cart-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #ffffff;
	overflow: hidden;
}

.pb-stepper-btn {
	background: transparent;
	border: none;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 1rem;
	color: #334155;
	font-weight: 600;
	transition: background 0.15s ease, color 0.15s ease;
	user-select: none;
}

.pb-stepper-btn:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.pb-stepper-btn:active {
	background: #e2e8f0;
}

.pb-stepper-input {
	width: 36px;
	height: 28px;
	border: none;
	text-align: center;
	font-size: 0.88rem;
	font-weight: 600;
	color: #0f172a;
	background: transparent;
	padding: 0;
	-moz-appearance: textfield;
}

.pb-stepper-input::-webkit-outer-spin-button,
.pb-stepper-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Subtotal Price per Item */
.pb-side-cart-item-price {
	font-size: 0.98rem;
	font-weight: 700;
	color: #0f172a;
	letter-spacing: -0.01em;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.pb-price-updating {
	opacity: 0.45;
	filter: blur(0.5px);
}

.pb-price-updated {
	animation: pbPriceFlash 0.4s ease;
}

@keyframes pbPriceFlash {
	0% {
		color: #c5a059;
		transform: scale(1.08);
	}
	100% {
		transform: scale(1);
	}
}

/* Empty State */
.pb-side-cart-empty {
	padding: 60px 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin: auto 0;
}

.pb-side-cart-empty-icon {
	font-size: 3.5rem;
	margin-bottom: 14px;
	opacity: 0.85;
	animation: pbBounce 2s infinite ease-in-out;
}

.pb-side-cart-empty-title {
	margin: 0 0 8px;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--pb-side-cart-dark);
}

.pb-side-cart-empty-desc {
	margin: 0 0 22px;
	font-size: 0.88rem;
	color: #64748b;
	max-width: 260px;
	line-height: 1.45;
}

.pb-side-cart-btn-catalog {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 22px;
	background: var(--pb-side-cart-primary);
	color: #ffffff !important;
	font-size: 0.9rem;
	font-weight: 600;
	border-radius: 8px;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.15s ease;
	box-shadow: 0 4px 12px rgba(197, 160, 89, 0.35);
}

.pb-side-cart-btn-catalog:hover {
	background: var(--pb-side-cart-primary-hover);
	transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────
   6. DRAWER FOOTER & ACTIONS
   ───────────────────────────────────────────────────────────── */
.pb-side-cart-footer {
	padding: 20px 24px 24px;
	border-top: 1px solid var(--pb-side-cart-border);
	background: #ffffff;
	box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04);
}

.pb-side-cart-subtotal-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 16px;
}

.pb-side-cart-subtotal-label {
	font-size: 0.95rem;
	color: #64748b;
	font-weight: 500;
}

.pb-side-cart-subtotal-val {
	font-size: 1.35rem;
	font-weight: 800;
	color: #0f172a;
	letter-spacing: -0.02em;
}

.pb-side-cart-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pb-side-cart-btn-checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 13px 20px;
	background: linear-gradient(135deg, #c5a059 0%, #b08d46 100%);
	color: #ffffff !important;
	font-size: 0.98rem;
	font-weight: 700;
	text-decoration: none;
	border-radius: 9px;
	box-shadow: 0 6px 18px rgba(197, 160, 89, 0.38);
	transition: all 0.2s ease;
}

.pb-side-cart-btn-checkout:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 22px rgba(197, 160, 89, 0.48);
	color: #ffffff !important;
}

.pb-side-cart-btn-view-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 11px 20px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #475569 !important;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: 9px;
	transition: all 0.15s ease;
}

.pb-side-cart-btn-view-cart:hover {
	background: #f1f5f9;
	color: #0f172a !important;
}

/* ─────────────────────────────────────────────────────────────
   7. FLOATING ACTION BUTTONS (Cart + Conditional Search)
   ───────────────────────────────────────────────────────────── */
.pb-floating-actions {
	position: fixed;
	bottom: 25px;
	right: 25px;
	z-index: 99998;
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
}

/* Common button style */
.pb-floating-cart-btn,
.pb-floating-search-btn {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.2s ease;
	outline: none;
}

.pb-floating-cart-btn:hover,
.pb-floating-search-btn:hover {
	transform: scale(1.08) translateY(-2px);
	box-shadow: 0 10px 26px rgba(15, 23, 42, 0.32);
}

.pb-floating-cart-btn:active,
.pb-floating-search-btn:active {
	transform: scale(0.96);
}

/* Floating Cart Button */
.pb-floating-cart-btn {
	background: #0f172a;
	color: #ffffff;
}

.pb-floating-cart-btn svg {
	stroke: #ffffff;
}

.pb-floating-cart-badge {
	position: absolute;
	top: -3px;
	right: -3px;
	background: linear-gradient(135deg, #c5a059 0%, #d4af37 100%);
	color: #ffffff;
	font-size: 0.72rem;
	font-weight: 800;
	min-width: 21px;
	height: 21px;
	border-radius: 999px;
	padding: 0 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	border: 2px solid #ffffff;
}

/* Floating Search Button - STRICTLY CONDITIONAL */
.pb-floating-search-btn {
	background: #ffffff;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	animation: pbSlideUpFade 0.3s ease;
}

.pb-floating-search-btn svg {
	stroke: #c5a059;
}

.pb-floating-tooltip {
	position: absolute;
	right: calc(100% + 12px);
	background: rgba(15, 23, 42, 0.9);
	color: #ffffff;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translateX(6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	backdrop-filter: blur(4px);
}

.pb-floating-search-btn:hover .pb-floating-tooltip {
	opacity: 1;
	transform: translateX(0);
}

/* ─────────────────────────────────────────────────────────────
   8. INSTANT SEARCH MODAL
   ───────────────────────────────────────────────────────────── */
.pb-quick-search-modal {
	position: fixed;
	inset: 0;
	z-index: 999995;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 80px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pb-quick-search-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.pb-quick-search-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.pb-quick-search-card {
	position: relative;
	width: 580px;
	max-width: 92vw;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
	overflow: hidden;
	z-index: 2;
	transform: translateY(-20px) scale(0.96);
	transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
	border: 1px solid rgba(226, 232, 240, 0.8);
}

.pb-quick-search-modal.is-open .pb-quick-search-card {
	transform: translateY(0) scale(1);
}

.pb-quick-search-header {
	padding: 16px 20px;
	border-bottom: 1px solid #f1f5f9;
	display: flex;
	align-items: center;
	gap: 12px;
}

.pb-quick-search-input-wrap {
	flex: 1;
	position: relative;
	display: flex;
	align-items: center;
}

.pb-quick-search-icon {
	position: absolute;
	left: 12px;
	color: #94a3b8;
	pointer-events: none;
}

.pb-quick-search-input {
	width: 100%;
	padding: 12px 38px 12px 42px;
	font-size: 1rem;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	outline: none;
	color: #0f172a;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pb-quick-search-input:focus {
	border-color: #c5a059;
	box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

.pb-quick-search-clear {
	position: absolute;
	right: 12px;
	background: transparent;
	border: none;
	color: #94a3b8;
	font-size: 1.25rem;
	cursor: pointer;
	line-height: 1;
	padding: 2px;
}

.pb-quick-search-clear:hover {
	color: #0f172a;
}

.pb-quick-search-close-btn {
	background: #f1f5f9;
	border: none;
	color: #64748b;
	font-size: 1.35rem;
	width: 38px;
	height: 38px;
	border-radius: 9px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: background 0.15s ease, color 0.15s ease;
}

.pb-quick-search-close-btn:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.pb-quick-search-results {
	max-height: 420px;
	overflow-y: auto;
	padding: 12px 16px;
}

.pb-quick-search-placeholder {
	padding: 40px 20px;
	text-align: center;
	color: #94a3b8;
}

.pb-quick-search-placeholder span {
	font-size: 2.2rem;
	display: block;
	margin-bottom: 8px;
}

.pb-quick-search-placeholder p {
	margin: 0;
	font-size: 0.9rem;
}

/* Quick search result item */
.pb-quick-search-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	border-radius: 10px;
	transition: background 0.15s ease;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f8fafc;
}

.pb-quick-search-item:last-child {
	border-bottom: none;
}

.pb-quick-search-item:hover {
	background: #f8fafc;
}

.pb-quick-search-thumb {
	width: 52px;
	height: 52px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
}

.pb-quick-search-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pb-quick-search-info {
	flex: 1;
	min-width: 0;
}

.pb-quick-search-title {
	margin: 0 0 3px;
	font-size: 0.92rem;
	font-weight: 600;
	color: #0f172a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pb-quick-search-price {
	font-size: 0.86rem;
	font-weight: 700;
	color: #c5a059;
}

.pb-quick-search-btn-add {
	padding: 6px 14px;
	background: #0f172a;
	color: #ffffff !important;
	border-radius: 7px;
	font-size: 0.8rem;
	font-weight: 600;
	border: none;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease, transform 0.1s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.pb-quick-search-btn-add:hover {
	background: #c5a059;
}

.pb-quick-search-btn-add.is-loading {
	opacity: 0.7;
	cursor: wait;
}

.pb-quick-search-btn-add.is-added {
	background: #10b981 !important;
	color: #ffffff !important;
}

/* ─────────────────────────────────────────────────────────────
   9. ANIMATIONS & RESPONSIVE
   ───────────────────────────────────────────────────────────── */
@keyframes pbSlideUpFade {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.9);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes pbBounce {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-6px);
	}
}

/* Prevent body scroll when drawer or search modal is open */
body.pb-side-cart-open,
body.pb-quick-search-open {
	overflow: hidden !important;
}

/* Mobile adjustments */
@media (max-width: 640px) {
	:root {
		--pb-side-cart-width: 100vw;
	}
	.pb-side-cart-drawer {
		max-width: 100vw;
	}
	.pb-floating-actions {
		bottom: 18px;
		right: 18px;
	}
	.pb-floating-cart-btn,
	.pb-floating-search-btn {
		width: 48px;
		height: 48px;
	}
	.pb-quick-search-modal {
		padding-top: 20px;
	}
}
