/* EC Cart Sync 1.5.3 */

/* ---- Row: unsaved edit ------------------------------------------------ */
.cat-area .prdt-area .quantity { position: relative; }

.cat-area .prdt-area .prdt-table-row.ec-dirty .quantity input[type="number"],
.cat-area .prdt-area .as-row.ec-dirty .quantity input[type="number"] {
	outline: 2px solid #cfb795;
	outline-offset: -2px;
}

.cat-area .prdt-area .ec-qty-hint {
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: 3px;
	font-size: 11px;
	line-height: 1.2;
	color: #8a6d3b;
	white-space: nowrap;
	pointer-events: none;
}

/* Button reads as "update" (FontAwesome refresh) while the row is dirty. */
.cat-area .prdt-area .prdt-add-cart a.add_to_cart_button.ec-dirty-btn::before { content: '\f021'; }

.cat-area .prdt-area .prdt-add-cart a.add_to_cart_button.loading {
	pointer-events: none;
	opacity: 0.85;
}

/* Row a drawer link jumped to. */
.cat-area .prdt-area .prdt-table-row.ec-flash,
.cat-area .prdt-area .as-row.ec-flash {
	animation: ec-flash 3s ease-out;
}
@keyframes ec-flash {
	0%   { box-shadow: inset 0 0 0 3px #cfb795; background-color: #fbf6ec; }
	70%  { box-shadow: inset 0 0 0 3px #cfb795; background-color: #fbf6ec; }
	100% { box-shadow: none; }
}

/* ---- Theme cart bar: replaced by the floating cart (1.5.0) ---------- */
/* The theme's "Total Items / Total Price / View Cart" bar, both in place
   above the product list and stuck to the top while scrolling. Scoped to a
   body class the plugin adds, so deactivating the plugin brings it back. */
body.ec-cs-hide-theme-bar #cb-cart-mini { display: none !important; }

/* ---- Floating cart button: top right, every page, always visible ------ */
.ec-cart-fab {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px 10px 14px;
	background: #12454f;
	color: #fff;
	border: 0;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1;
}
.ec-cart-fab:hover { background: #01353d; }
.ec-cart-fab:focus-visible { outline: 3px solid #cfb795; outline-offset: 2px; }
.ec-cart-fab .ec-fab-icon { display: block; }
.ec-cart-fab .ec-fab-count {
	display: inline-block;
	min-width: 22px;
	padding: 0 7px;
	height: 22px;
	line-height: 22px;
	border-radius: 11px;
	background: #cfb795;
	color: #01353d;
	text-align: center;
	font-size: 13px;
	box-sizing: border-box;
}
.ec-cart-fab[data-count="0"] .ec-fab-count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.ec-cart-fab .ec-fab-total { color: #fff; }
.ec-cart-fab .ec-fab-total .woocommerce-Price-amount { color: #fff; }

/* Logged in: sit under the WordPress admin bar. */
body.admin-bar .ec-cart-fab { top: 44px; }

/* 1.5.2: arrive with the page. The theme hides its page wrapper and fades
   it in; the button sits outside that wrapper, so the script adds a body
   class as soon as the wrapper is visible (1.5s at most). The class lives
   on body because cart fragments replace the button itself. */
.ec-cart-fab { opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
body.ec-cs-ready .ec-cart-fab { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) { .ec-cart-fab, body.ec-cs-ready .ec-cart-fab { transition: none; } }
/* 1.5.3: never stuck hidden. If no script runs at all (an optimizer held it
   back), the button still appears after 1.6s through CSS alone. */
.ec-cart-fab { animation: ec-fab-fallback 0.3s ease 1.6s forwards; }
@keyframes ec-fab-fallback { to { opacity: 1; visibility: visible; } }

/* The panel has its own close button in the same corner. */
body.ec-cs-ready.ec-drawer-open .ec-cart-fab, body.ec-drawer-open .ec-cart-fab { visibility: hidden !important; } /* !important beats the fallback animation */

/* Narrower screens: icon + count only, so it stays clear of the header. */
@media (max-width: 1399px) {
	.ec-cart-fab .ec-fab-total { display: none; }
	.ec-cart-fab { padding: 10px 12px 10px 14px; }
}

/* Phones and small tablets: a round icon with the count as a corner badge. */
@media (max-width: 767px) {
	.ec-cart-fab {
		top: 12px;
		right: 12px;
		width: 48px;
		height: 48px;
		padding: 0;
		gap: 0;
		justify-content: center;
	}
	.ec-cart-fab .ec-fab-icon { width: 22px; height: 22px; }
	.ec-cart-fab .ec-fab-count {
		position: absolute;
		top: -4px;
		right: -4px;
		min-width: 20px;
		height: 20px;
		padding: 0 5px;
		font-size: 12px;
		border: 2px solid #fff;
		line-height: 16px;
	}
	.ec-cart-fab[data-count="0"] .ec-fab-count { background: #6f8f95; color: #fff; }
}
@media (max-width: 782px) {
	body.admin-bar .ec-cart-fab { top: 58px; }
}

/* ---- Drawer ----------------------------------------------------------- */
.ec-cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100000; visibility: hidden; pointer-events: none; }
.ec-cart-drawer.is-open { visibility: visible; pointer-events: auto; }

.ec-cart-drawer-overlay {
	position: absolute; top: 0; right: 0; bottom: 0; left: 0;
	background: rgba(1, 53, 61, 0.45);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.ec-cart-drawer.is-open .ec-cart-drawer-overlay { opacity: 1; }

.ec-cart-drawer-panel {
	position: absolute; top: 0; right: 0; bottom: 0;
	width: 400px; max-width: 100%;
	background: #fff;
	box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
	transform: translateX(100%);
	transition: transform 0.25s ease;
	display: flex;
	flex-direction: column;
}
.ec-cart-drawer.is-open .ec-cart-drawer-panel { transform: translateX(0); }

#ec-cart-drawer-content { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.ec-drawer-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px;
	background: #12454f;
	color: #fff;
}
.ec-drawer-head h3 { margin: 0; font-size: 18px; line-height: 1.2; color: #fff; }
.ec-drawer-close {
	background: transparent; border: 0; color: #fff;
	font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px;
}

.ec-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 20px 16px; }
.ec-drawer-empty { color: #555; font-size: 14px; margin: 16px 0; }

.ec-drawer-group { margin: 14px 0 6px; }
.ec-drawer-group h4 {
	margin: 0 0 6px; padding-bottom: 4px;
	font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase;
	color: #12454f; border-bottom: 2px solid #cfb795;
}
.ec-drawer-group h4 a { color: #12454f; text-decoration: none; }
.ec-drawer-group h4 a:hover { text-decoration: underline; }
.ec-drawer-group ul { list-style: none; margin: 0; padding: 0; }

.ec-drawer-line {
	display: flex; align-items: flex-start; justify-content: space-between;
	gap: 10px; padding: 8px 0; border-bottom: 1px solid #eee;
}
.ec-drawer-line:last-child { border-bottom: 0; }
.ec-drawer-line-main { flex: 1 1 auto; min-width: 0; }
.ec-drawer-line-link { display: block; color: #222; text-decoration: none; }
a.ec-drawer-line-link:hover .ec-drawer-name { text-decoration: underline; }
.ec-drawer-sku { display: block; font-weight: 700; font-size: 13px; color: #01353d; }
.ec-drawer-name { display: block; font-size: 12px; color: #555; line-height: 1.35; }
.ec-drawer-line-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.ec-drawer-qty { font-size: 13px; color: #555; min-width: 28px; text-align: right; }
.ec-drawer-subtotal { font-size: 13px; font-weight: 700; color: #222; min-width: 70px; text-align: right; }
.ec-drawer-remove {
	background: #eee; border: 0; border-radius: 50%;
	width: 22px; height: 22px; line-height: 22px; padding: 0;
	color: #555; font-size: 16px; cursor: pointer;
}
.ec-drawer-remove:hover { background: #cfb795; color: #01353d; }
.ec-drawer-remove.loading { opacity: 0.5; pointer-events: none; }

.ec-drawer-foot { border-top: 1px solid #ddd; padding: 12px 20px 16px; background: #f7f7f7; }
.ec-drawer-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; color: #222; margin-bottom: 10px; }
.ec-drawer-actions { display: flex; gap: 10px; }
.ec-drawer-btn {
	flex: 1 1 0; display: block; text-align: center;
	padding: 10px 12px; border-radius: 3px;
	background: #01353d; color: #fff !important; text-decoration: none !important;
	font-size: 14px; font-weight: 700;
}
.ec-drawer-btn:hover { background: #12454f; }
.ec-drawer-btn-secondary { background: #fff; color: #01353d !important; border: 2px solid #01353d; padding: 8px 12px; }
.ec-drawer-btn-secondary:hover { background: #f0ebe0; }

body.ec-drawer-open { overflow: hidden; }

@media (max-width: 600px) {
	.ec-cart-drawer-panel { width: 100%; }
	.ec-sets-chips { grid-auto-columns: 84%; }
	.cat-area .prdt-area .ec-qty-hint { font-size: 10px; }
}

/* ---- Complete this set ------------------------------------------------ */
.ec-complete { margin: 8px 0 4px; padding: 8px 10px 10px; background: #fbf6ec; border-left: 3px solid #cfb795; border-radius: 0 3px 3px 0; }
.ec-complete h5 { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: #8a6d3b; }
.ec-complete ul { list-style: none; margin: 0; padding: 0; }
.ec-complete-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid #efe3cb; }
.ec-complete-item:first-child { border-top: 0; }
.ec-complete-link { display: block; flex: 1 1 auto; min-width: 0; color: #222; text-decoration: none; }
a.ec-complete-link:hover .ec-complete-name { text-decoration: underline; }
.ec-complete-name { display: block; font-weight: 700; font-size: 13px; color: #12454f; }
.ec-complete-name::after { content: ' \2192'; color: #cfb795; }
.ec-complete-why { display: block; font-size: 12px; color: #555; line-height: 1.35; }
.ec-complete-none { margin: 0 0 6px; font-size: 12px; color: #777; }

/* Shop-manager controls */
.ec-rule-tools { flex: 0 0 auto; display: flex; gap: 4px; }
.ec-rule-tools button { width: 22px; height: 22px; padding: 0; border: 1px solid #cfb795; background: #fff; color: #8a6d3b; border-radius: 3px; font-size: 13px; line-height: 20px; cursor: pointer; }
.ec-rule-tools button:hover { background: #cfb795; color: #01353d; }
.ec-rule-add { margin-top: 6px; padding: 3px 8px; border: 1px dashed #cfb795; background: transparent; color: #8a6d3b; border-radius: 3px; font-size: 12px; cursor: pointer; }
.ec-rule-add:hover { background: #fff; }
.ec-rule-form { margin-top: 8px; padding: 8px; background: #fff; border: 1px solid #e6d5b5; border-radius: 3px; font-size: 12px; }
.ec-rule-form label { display: block; margin: 0 0 6px; color: #555; }
.ec-rule-form select, .ec-rule-form input[type="text"] { display: block; width: 100%; margin-top: 2px; font-size: 12px; padding: 4px 6px; }
.ec-rule-form-actions { display: flex; gap: 6px; }
.ec-rule-form-actions button { padding: 4px 10px; font-size: 12px; border-radius: 3px; border: 0; cursor: pointer; background: #12454f; color: #fff; }
.ec-rule-form-actions .ec-rule-cancel { background: #eee; color: #333; }

/* Cart page block */
.ec-complete-block { margin: 24px 0; padding: 16px 20px; background: #f7f7f7; border: 1px solid #ddd; }
.ec-complete-block h3 { margin: 0 0 4px; font-size: 18px; color: #12454f; }
.ec-complete-intro { margin: 0 0 12px; font-size: 13px; color: #555; }
.ec-complete-group { margin: 10px 0; }
.ec-complete-group h4 { margin: 0 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em; color: #12454f; }
.ec-complete-group h4 a { color: #12454f; text-decoration: none; }
.ec-complete-group .ec-complete { background: #fff; }
@media (min-width: 900px) {
	.ec-complete-block .ec-complete ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
	.ec-complete-block .ec-complete-item { border-top: 0; border-bottom: 1px solid #efe3cb; }
}

/* ---- Cart page: Your sets bar --------------------------------------- */
.ec-sets-bar { margin: 0 0 18px; padding: 14px 18px; background: #fff; border: 1px solid #ddd; border-left: 4px solid #12454f; }
.ec-sets-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ec-sets-title { font-size: 15px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: #12454f; }
.ec-sets-toggle { padding: 6px 12px; border: 1px solid #cfb795; background: #fbf6ec; color: #8a6d3b; border-radius: 3px; font-size: 13px; font-weight: 700; cursor: pointer; }
.ec-sets-toggle:hover { background: #cfb795; color: #01353d; }
.ec-sets-chips {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 24px) / 3);
	gap: 12px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	padding: 2px 2px 10px;
	scrollbar-width: thin;
	scrollbar-color: #cfb795 #f1f1f1;
}
.ec-sets-chips::-webkit-scrollbar { height: 8px; }
.ec-sets-chips::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.ec-sets-chips::-webkit-scrollbar-thumb { background: #cfb795; border-radius: 4px; }
.ec-set-chip {
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	padding: 12px 14px;
	background: #f7f7f7;
	border: 1px solid #e3e3e3;
	border-radius: 4px;
	font-size: 13px;
}
.ec-set-label { font-weight: 700; font-size: 15px; color: #12454f; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-set-meta { color: #666; }
.ec-set-chip .ec-set-shop, .ec-set-chip .ec-set-consider { margin-top: 2px; }
.ec-set-chip .ec-set-shop { align-self: flex-start; }
.ec-set-shop { color: #01353d; font-weight: 700; text-decoration: none; }
.ec-set-shop:hover { text-decoration: underline; }
/* Badge: override the theme's generic button sizing. */
.ec-sets-bar button.ec-set-consider {
	align-self: flex-start;
	display: inline-block;
	width: auto; height: auto; min-height: 0; min-width: 0;
	margin: 0; padding: 3px 10px;
	border: 0; border-radius: 12px;
	background: #cfb795; color: #01353d;
	font-size: 12px; font-weight: 700; line-height: 1.5;
	letter-spacing: 0; text-transform: none; box-shadow: none;
	cursor: pointer;
}
.ec-sets-bar button.ec-set-consider:hover, .ec-sets-bar button.ec-set-consider[aria-expanded="true"] { background: #12454f; color: #fff; }
.ec-sets-consider .ec-complete-group.ec-set-focus h4 { color: #01353d; }
.ec-sets-consider { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eee; }
.ec-sets-consider[hidden] { display: none; }
.ec-sets-consider .ec-complete-group h4 { margin-top: 8px; }
@media (max-width: 900px) and (min-width: 601px) {
	.ec-sets-chips { grid-auto-columns: calc((100% - 12px) / 2); }
}
@media (min-width: 900px) {
	.ec-sets-consider .ec-complete ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
	.ec-sets-consider .ec-complete-item { border-top: 0; border-bottom: 1px solid #efe3cb; }
}

/* Cart page: per-line button back to its row (own line, under the SKU) */
.woocommerce-cart .product-name .ec-line-shop-wrap { display: block; margin: 8px 0 10px; }
.woocommerce-cart .product-name .ec-line-shop {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 12px; border: 2px solid #12454f; border-radius: 3px;
	background: #fff; color: #12454f !important; text-decoration: none !important;
	font-size: 13px; font-weight: 700; line-height: 1.2;
}
.woocommerce-cart .product-name .ec-line-shop:hover { background: #12454f; color: #fff !important; }
.woocommerce-cart .product-name .ec-line-shop svg { display: block; }
