/* PayPal WooCommerce Chatbot — styles */

#pwc-root {
	--pwc-primary:      #0070ba;
	--pwc-primary-dark: #005ea6;
	--pwc-paypal-gold:  #ffc439;
	--pwc-bg:           #ffffff;
	--pwc-bg-soft:      #f4f8fc;
	--pwc-bot-bubble:   #eef4fb;
	--pwc-text:         #1c2230;
	--pwc-text-light:   #6b7280;
	--pwc-border:       #dce7f5;
	--pwc-radius:       18px;
	--pwc-shadow:       0 16px 48px rgba(0,80,160,.18), 0 2px 8px rgba(0,80,160,.08);
	--pwc-bottom:       24px;
	--pwc-side:         24px;

	position: fixed;
	bottom: var(--pwc-bottom);
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#pwc-root.pwc-bottom-right { right: var(--pwc-side); }
#pwc-root.pwc-bottom-left  { left:  var(--pwc-side); }

/* Toggle button */

.pwc-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	background: linear-gradient(135deg, var(--pwc-primary), var(--pwc-primary-dark));
	color: #fff;
	border: none;
	border-radius: 50px;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 20px rgba(0,112,186,.4);
	transition: transform .15s, box-shadow .15s;
	position: relative;
	z-index: 2;
}
.pwc-toggle:hover { transform: scale(1.04); box-shadow: 0 6px 28px rgba(0,112,186,.5); }
.pwc-toggle-icon  { font-size: 20px; }
.pwc-cta-label    { font-size: 13.5px; white-space: nowrap; }

.pwc-pulse { animation: pwcPulse 2.5s ease-in-out infinite; }
#pwc-root.pwc-open .pwc-pulse { animation: none; }

@keyframes pwcPulse {
	0%, 100% { box-shadow: 0 4px 20px rgba(0,112,186,.4); }
	50%       { box-shadow: 0 4px 32px rgba(0,112,186,.65); }
}

/* Panel */

.pwc-panel {
	position: absolute;
	bottom: calc(100% + 12px);
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 590px;
	max-height: 80vh;
	background: var(--pwc-bg);
	border-radius: var(--pwc-radius);
	box-shadow: var(--pwc-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: opacity .22s, transform .22s;
	transform-origin: bottom right;
}
#pwc-root.pwc-bottom-right .pwc-panel { right: 0; }
#pwc-root.pwc-bottom-left  .pwc-panel { left: 0; transform-origin: bottom left; }

.pwc-hidden { opacity: 0; pointer-events: none; transform: scale(.92) translateY(10px); }

/* Header */

.pwc-header {
	background: linear-gradient(135deg, var(--pwc-primary), var(--pwc-primary-dark));
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
.pwc-header-left { display: flex; align-items: center; gap: 10px; }
.pwc-avatar {
	width: 40px; height: 40px; border-radius: 10px;
	background: rgba(255,255,255,.2); display: flex; align-items: center;
	justify-content: center; font-size: 20px; flex-shrink: 0; overflow: hidden;
}
.pwc-avatar-img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.pwc-title    { font-weight: 700; font-size: 14.5px; }
.pwc-subtitle { font-size: 11.5px; opacity: .85; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.pwc-dot { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; flex-shrink: 0; animation: pwcDot 2s ease-in-out infinite; }
@keyframes pwcDot { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.pwc-restart { background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 18px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.pwc-restart:hover { background: rgba(255,255,255,.28); }

/* Messages */

.pwc-messages {
	flex: 1; overflow-y: auto; padding: 14px 12px;
	display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth;
}
.pwc-messages::-webkit-scrollbar { width: 4px; }
.pwc-messages::-webkit-scrollbar-thumb { background: var(--pwc-border); border-radius: 2px; }

.pwc-msg { display: flex; }

/* Sole flex-child wrapper for rich content (search, product lists, forms).
 * Keeping this as the ONLY flex item avoids multi-item flex sizing bugs
 * (e.g. align-items:stretch distorting a sibling <input>'s height/width). */
.pwc-rich-content { width: 100%; max-width: 100%; }
.pwc-bot  { justify-content: flex-start; }
.pwc-user { justify-content: flex-end; }

.pwc-bubble { max-width: 86%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.pwc-bot-bubble  { background: var(--pwc-bot-bubble); color: var(--pwc-text); border-bottom-left-radius: 4px; }
.pwc-user-bubble { background: var(--pwc-primary); color: #fff; border-bottom-right-radius: 4px; }

/* Typing */

.pwc-typing { background: var(--pwc-bot-bubble); border-radius: 14px; border-bottom-left-radius: 4px; padding: 10px 16px; display: flex; gap: 4px; align-items: center; }
.pwc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--pwc-primary); opacity: .5; animation: pwcTyping 1.2s ease-in-out infinite; }
.pwc-typing span:nth-child(2) { animation-delay: .15s; }
.pwc-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes pwcTyping { 0%, 80%, 100% { transform: scale(.8); opacity: .5; } 40% { transform: scale(1.1); opacity: 1; } }

/* Category buttons */

.pwc-cat-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.pwc-cat-btn {
	background: var(--pwc-bg-soft); color: var(--pwc-primary);
	border: 1.5px solid var(--pwc-border); border-radius: 20px;
	padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
	transition: background .15s, border-color .15s;
}
.pwc-cat-btn:hover { background: var(--pwc-primary); color: #fff; border-color: var(--pwc-primary); }
.pwc-cat-grid.pwc-locked .pwc-cat-btn { opacity: .45; pointer-events: none; }

/* Search */

.pwc-search { display: block; width: 100%; box-sizing: border-box; padding: 8px 12px; border: 1.5px solid var(--pwc-border); border-radius: 8px; font-size: 13px; margin-bottom: 10px; outline: none; }
.pwc-search:focus { border-color: var(--pwc-primary); }
.pwc-empty-search { font-size: 12px; color: var(--pwc-text-light); text-align: center; padding: 10px 0; display: none; }

/* Product cards */

.pwc-products { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.pwc-product-card {
	background: var(--pwc-bg); border: 1.5px solid var(--pwc-border); border-radius: 12px;
	padding: 10px; display: flex; align-items: flex-start; gap: 10px;
	transition: box-shadow .15s, transform .12s;
}
.pwc-product-card:hover { box-shadow: 0 4px 14px rgba(0,112,186,.1); }
.pwc-product-card.pwc-has-tag { border-left-width: 3px; }

.pwc-prod-img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--pwc-bg-soft); }

.pwc-prod-info { flex: 1; min-width: 0; }
.pwc-prod-name { font-weight: 600; font-size: 13px; color: var(--pwc-text); line-height: 1.4; word-break: break-word; }

/* Tags */

.pwc-tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.pwc-highlight-tag { display: inline-flex; align-items: center; font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* Stars */

.pwc-rating-row { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.pwc-stars { position: relative; display: inline-block; font-size: 12px; line-height: 1; letter-spacing: 1px; }
.pwc-stars-bg   { color: #d1d5db; }
.pwc-stars-fill { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: #f59e0b; }
.pwc-review-count { font-size: 11px; color: var(--pwc-text-light); }

/* Price */

.pwc-prod-price {
	margin-top: 4px;
	font-size: 13px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	min-width: 0;
	max-width: 100%;
	gap: 6px 8px;
}

/* High-specificity + !important to reliably override WooCommerce's own
 * .woocommerce-Price-amount styling, which many themes set with color
 * rules that would otherwise win over a simple element selector. */
#pwc-root .pwc-prod-price ins,
#pwc-root .pwc-prod-price ins .woocommerce-Price-amount,
#pwc-root .pwc-prod-price ins bdi {
	text-decoration: none !important;
	font-weight: 800 !important;
	font-size: 16px !important;
	color: var(--pwc-discount-price, var(--pwc-primary)) !important;
}

#pwc-root .pwc-prod-price del,
#pwc-root .pwc-prod-price del .woocommerce-Price-amount,
#pwc-root .pwc-prod-price del bdi {
	text-decoration: line-through !important;
	font-weight: 400 !important;
	font-size: 12px !important;
	color: var(--pwc-regular-price, var(--pwc-text-light)) !important;
}

#pwc-root .pwc-prod-price del { margin-right: 6px; }

/* Stepper + Select */

.pwc-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

.pwc-stepper { display: flex; align-items: center; border: 1.5px solid var(--pwc-border); border-radius: 8px; overflow: hidden; }
.pwc-stepper-btn { background: var(--pwc-bg-soft); border: none; padding: 4px 8px; font-size: 16px; cursor: pointer; color: var(--pwc-text); transition: background .1s; }
.pwc-stepper-btn:hover { background: var(--pwc-border); }
.pwc-qty { padding: 4px 8px; font-weight: 600; font-size: 13px; min-width: 24px; text-align: center; }

.pwc-select-btn { background: var(--pwc-primary); color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: opacity .15s; white-space: nowrap; }
.pwc-select-btn:hover { opacity: .88; }
.pwc-products.pwc-locked .pwc-select-btn,
.pwc-products.pwc-locked .pwc-stepper-btn { opacity: .4; pointer-events: none; }

/* Back button */

.pwc-back-btn { background: none; border: 1.5px solid var(--pwc-border); color: var(--pwc-primary); font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 20px; cursor: pointer; transition: border-color .15s; }
.pwc-back-btn:hover { border-color: var(--pwc-primary); }

/* Order form */

.pwc-form { background: var(--pwc-bg); border: 1.5px solid var(--pwc-border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; width: 100%; box-sizing: border-box; }

.pwc-order-summary { display: flex; align-items: center; gap: 10px; background: var(--pwc-bg-soft); border-radius: 10px; padding: 10px; }
.pwc-sum-img  { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.pwc-sum-info { flex: 1; min-width: 0; }
.pwc-sum-name { font-weight: 600; font-size: 13px; word-break: break-word; }
.pwc-sum-price {
	font-size: 11.5px;
	color: var(--pwc-text-light);
	margin-top: 2px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	min-width: 0;
	max-width: 100%;
	gap: 5px 8px;
}
#pwc-root .pwc-sum-price ins,
#pwc-root .pwc-sum-price ins .woocommerce-Price-amount,
#pwc-root .pwc-sum-price ins bdi {
	text-decoration: none !important;
	color: var(--pwc-discount-price, var(--pwc-primary)) !important;
	font-weight: 800 !important;
}
#pwc-root .pwc-sum-price del,
#pwc-root .pwc-sum-price del .woocommerce-Price-amount,
#pwc-root .pwc-sum-price del bdi {
	text-decoration: line-through !important;
	color: var(--pwc-regular-price, var(--pwc-text-light)) !important;
}

.pwc-form-row { display: flex; flex-direction: column; gap: 4px; }
.pwc-lbl { font-size: 11.5px; font-weight: 600; color: var(--pwc-text-light); text-transform: uppercase; letter-spacing: .04em; }
.pwc-input { border: 1.5px solid var(--pwc-border); border-radius: 9px; padding: 9px 11px; font-size: 13px; color: var(--pwc-text); background: #fff; width: 100%; box-sizing: border-box; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.pwc-input:focus { outline: none; border-color: var(--pwc-primary); box-shadow: 0 0 0 3px rgba(0,112,186,.12); }
.pwc-form-row.pwc-invalid .pwc-input { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.10); }
.pwc-inline-err { font-size: 11.5px; color: #b91c1c; }
.pwc-form-error { font-size: 12px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 7px; padding: 8px 11px; }

/* PayPal Pay button — official PayPal gold style */

.pwc-pay-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(180deg, #ffd140 0%, #ffc439 100%);
	color: #003087;
	border: none;
	border-radius: 25px;
	padding: 13px 20px;
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	cursor: pointer;
	width: 100%;
	margin-top: 6px;
	box-shadow: 0 2px 8px rgba(0,48,135,.2);
	transition: opacity .15s, transform .1s;
}
.pwc-pay-btn:hover:not(:disabled) { opacity: .92; transform: translateY(-1px); }
.pwc-pay-btn:disabled { opacity: .6; cursor: default; transform: none; }
.pwc-pay-btn svg path { fill: #003087; }

/* ── Cart bar (sticky, shown when cart has items) ──────────────── */

.pwc-cart-bar {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	background: var(--pwc-bg);
	border-top: 1.5px solid var(--pwc-border);
	padding: 12px 14px;
	flex-shrink: 0;
}

.pwc-cart-summary-text {
	text-align: center;
	font-weight: 800;
	color: #14171f;
	font-size: 14px;
}

.pwc-cart-view-btn {
	display: block;
	width: 100%;
	box-sizing: border-box;
	background: var(--pwc-primary);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 12px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: opacity .15s;
}
.pwc-cart-view-btn:hover { opacity: .9; }

/* ── Discount badge ("X% OFF") ──────────────────────────────── */

.pwc-discount-badge {
	display: inline-block;
	background: #166534;
	color: #fff;
	font-size: 10px;
	font-weight: 650;
	padding: 2px 8px;
	border-radius: 20px;
	text-transform: uppercase;
	letter-spacing: .03em;
	vertical-align: middle;
	white-space: nowrap;
	flex-shrink: 0;
}

/* ── Cart review screen — product-card style rows ───────────── */

.pwc-cart-review {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	box-sizing: border-box;
}

.pwc-cart-review-title {
	font-size: 15px;
	font-weight: 800;
	color: var(--pwc-text);
	margin-bottom: 2px;
}

.pwc-cart-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--pwc-bg);
	border: 1.5px solid var(--pwc-border);
	border-radius: 12px;
	padding: 10px;
	transition: box-shadow .15s;
}
.pwc-cart-row:hover { box-shadow: 0 3px 10px rgba(0,0,0,.06); }

.pwc-cart-row-img {
	width: 50px;
	height: 50px;
	border-radius: 9px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--pwc-bg-soft);
}

.pwc-cart-row-info { flex: 1; min-width: 0; }

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

.pwc-cart-row-name {
	font-weight: 600;
	font-size: 12.5px;
	color: var(--pwc-text);
	word-break: break-word;
	line-height: 1.35;
}

.pwc-cart-row-info .pwc-discount-badge { margin-top: 4px; }

.pwc-cart-row-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 8px;
}

.pwc-cart-stepper { transform: scale(.92); transform-origin: left center; }

.pwc-cart-row-line {
	font-weight: 800;
	font-size: 13.5px;
	color: var(--pwc-primary);
}

.pwc-cart-remove-btn {
	background: var(--pwc-bg-soft);
	border: none;
	color: #ef4444;
	font-size: 12px;
	width: 24px;
	height: 24px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s, color .15s;
}
.pwc-cart-remove-btn:hover { background: #fef2f2; color: #dc2626; }

.pwc-cart-grand-total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--pwc-bg-soft);
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 14px;
	color: var(--pwc-text);
	font-weight: 600;
}
.pwc-cart-grand-total strong { color: var(--pwc-primary); font-size: 19px; font-weight: 800; }

.pwc-cart-checkout-btn {
	display: block;
	width: 100%;
	background: linear-gradient(135deg, var(--pwc-primary), var(--pwc-primary-dark));
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 12px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 6px;
	transition: opacity .15s;
}
.pwc-cart-checkout-btn:hover { opacity: .9; }

/* ── Multi-item order summary ──────────────────────────────── */

.pwc-order-summary-multi {
	display: flex;
	flex-direction: column;
	gap: 0;
	background: var(--pwc-bg-soft);
	border-radius: 10px;
	padding: 10px;
}

.pwc-sum-item-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	border-bottom: 1px solid var(--pwc-border);
}
.pwc-sum-item-row:last-of-type { border-bottom: none; }

.pwc-sum-grand-total {
	text-align: right;
	font-size: 14px;
	color: var(--pwc-text);
	padding-top: 8px;
	margin-top: 4px;
	border-top: 1.5px solid var(--pwc-border);
}
.pwc-sum-grand-total strong { color: var(--pwc-primary); font-size: 18px; }

/* "Add to Cart" success feedback state */
.pwc-select-btn.pwc-added {
	background: #16a34a !important;
}

/* Mobile */

@media (max-width: 480px) {
	#pwc-root.pwc-bottom-right,
	#pwc-root.pwc-bottom-left {
		right: var(--pwc-side, 16px);
		left: auto;
		bottom: var(--pwc-bottom, 16px);
	}
	.pwc-panel { position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
	.pwc-toggle { position: relative; z-index: 1000000; }
}
