/* =============================================================================
   Brixies Cart Coupon Nudge — minimal
   CSS custom props set inline by PHP:
     --cn-bg, --cn-fg, --cn-bar, --cn-btn-bg, --cn-btn-fg
   ============================================================================= */

#brixies-coupon-nudge {
	margin    : 6px 0 8px;
	color     : var(--cn-fg, #0c4a6e);
	font-size : 12px;
	line-height: 1.35;
	animation : brixies-cn-fadein 0.2s ease both;
}
#brixies-coupon-nudge .brixies-cn-bar {
	background    : var(--cn-bg, #f0f9ff);
	padding       : 8px 10px;
	border-radius : 6px;
}

li.brixies-cn-li {
	list-style : none !important;
	padding    : 0 !important;
	margin     : 0 !important;
	border     : none !important;
	background : none !important;
	width      : 100%;
}

#brixies-coupon-nudge .brixies-cn-text {
	margin     : 0 0 6px;
	text-align : center;
}
#brixies-coupon-nudge .brixies-cn-text--applied {
	margin : 0;
	color  : #15803d;
}
#brixies-coupon-nudge .brixies-cn-text--applied .dashicons {
	vertical-align : middle;
	margin-right   : 2px;
	font-size      : 14px;
	width          : 14px;
	height         : 14px;
}

#brixies-coupon-nudge .brixies-cn-progress-wrap {
	background    : rgba(0,0,0,0.08);
	border-radius : 999px;
	height        : 3px;
	overflow      : hidden;
}
#brixies-coupon-nudge .brixies-cn-progress-bar {
	height        : 100%;
	border-radius : 999px;
	background    : var(--cn-bar, #0ea5e9);
	transition    : width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	min-width     : 2%;
}

#brixies-coupon-nudge .brixies-cn-apply {
	display       : block;
	width         : 100%;
	margin-top    : 2px;
	padding       : 7px 10px;
	background    : var(--cn-btn-bg, #0ea5e9);
	color         : var(--cn-btn-fg, #fff);
	border        : 0;
	border-radius : 4px;
	font-weight   : 600;
	font-size     : 12px;
	cursor        : pointer;
	transition    : filter 0.15s ease;
}
#brixies-coupon-nudge .brixies-cn-apply:hover   { filter: brightness(1.05); }
#brixies-coupon-nudge .brixies-cn-apply:disabled { opacity: 0.6; cursor: wait; }
#brixies-coupon-nudge .brixies-cn-bar.is-applied {
	background : #ecfdf5;
	color      : #14532d;
}

/* ── Related products ─────────────────────────────────────────────────────── */

details.brixies-cn-related {
	margin  : 6px 0 2px;
	padding : 0;
	border  : 0;
}
details.brixies-cn-related summary {
	list-style : none;
	cursor     : pointer;
}
details.brixies-cn-related summary::-webkit-details-marker { display: none; }
.brixies-cn-related__title {
	display        : flex;
	align-items    : center;
	justify-content: space-between;
	gap            : 6px;
	font-size      : 10px;
	font-weight    : 600;
	text-transform : uppercase;
	letter-spacing : 0.04em;
	opacity        : 0.65;
	margin         : 0 0 4px;
	padding        : 2px 2px;
	user-select    : none;
}
.brixies-cn-related__title:hover { opacity: 0.9; }
.brixies-cn-related__caret {
	width      : 0;
	height     : 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top : 5px solid currentColor;
	transition : transform 0.2s ease;
	flex-shrink: 0;
}
details.brixies-cn-related:not([open]) .brixies-cn-related__caret { transform: rotate(-90deg); }
details.brixies-cn-related:not([open]) { margin-bottom: 0; }
.brixies-cn-related__track {
	display                   : grid;
	grid-auto-flow            : column;
	grid-auto-columns         : calc(25% - 5px);
	gap                       : 6px;
	overflow-x                : auto;
	scroll-snap-type          : x mandatory;
	-webkit-overflow-scrolling: touch;
	padding                   : 2px 2px 4px;
	scrollbar-width           : none;
}
.brixies-cn-related__track::-webkit-scrollbar { display: none; }

.brixies-cn-card {
	position         : relative;
	display          : block;
	background       : transparent;
	border-radius    : 4px;
	overflow         : hidden;
	text-decoration  : none;
	color            : inherit;
	scroll-snap-align: start;
}

/* Image — force-fill regardless of theme img styles */
.brixies-cn-card__img {
	display      : block;
	position     : relative;
	width        : 100%;
	aspect-ratio : 1 / 1;
	background   : #f6f7f9;
	border-radius: 4px;
	overflow     : hidden;
}
@supports not (aspect-ratio: 1 / 1) {
	.brixies-cn-card__img { padding-top: 100%; height: 0; }
}
.brixies-cn-card__img img,
.brixies-cn-card__img .wp-post-image,
.brixies-cn-card__img .attachment-woocommerce_thumbnail {
	position   : absolute !important;
	top        : 0 !important;
	left       : 0 !important;
	width      : 100% !important;
	height     : 100% !important;
	max-width  : none !important;
	max-height : none !important;
	margin     : 0 !important;
	padding    : 0 !important;
	border     : 0 !important;
	object-fit : cover !important;
	display    : block !important;
}

.brixies-cn-card__name {
	display           : -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow          : hidden;
	font-size         : 10px;
	line-height       : 1.25;
	font-weight       : 500;
	padding           : 3px 1px 0;
	color             : inherit;
}
.brixies-cn-card__price {
	font-size    : 10px;
	font-weight  : 700;
	padding      : 0 1px 2px;
	white-space  : nowrap;
	overflow     : hidden;
	text-overflow: ellipsis;
}
.brixies-cn-card__price del  { opacity: 0.5; font-weight: 400; margin-right: 3px; font-size: 10px; }
.brixies-cn-card__price ins  { text-decoration: none; }
.brixies-cn-card__price .woocommerce-Price-amount { font-size: inherit; }

.brixies-cn-add {
	position       : absolute;
	top            : 3px;
	right          : 3px;
	width          : 18px;
	height         : 18px;
	border-radius  : 50%;
	border         : 0;
	background     : var(--cn-btn-bg, #0ea5e9);
	color          : var(--cn-btn-fg, #fff);
	font-size      : 12px;
	line-height    : 1;
	font-weight    : 700;
	cursor         : pointer;
	display        : flex;
	align-items    : center;
	justify-content: center;
	text-decoration: none;
	box-shadow     : 0 1px 3px rgba(0,0,0,0.18);
	z-index        : 2;
	transition     : transform 0.15s ease;
}
.brixies-cn-add:hover   { transform: scale(1.1); }
.brixies-cn-add.loading { opacity: 0.6; pointer-events: none; }
.brixies-cn-add.added::after {
	content  : "\2713";
	font-size: 12px;
}

/* Cart-page variant — slightly larger, still minimal */
.brixies-cn-related--cart {
	margin : 32px 0;
}
.brixies-cn-related--cart .brixies-cn-related__title {
	font-size      : 14px;
	text-transform : none;
	opacity        : 1;
	letter-spacing : 0;
	text-align     : center;
	margin-bottom  : 12px;
}
.brixies-cn-related--cart .brixies-cn-related__track {
	grid-auto-columns : minmax(140px, 1fr);
	gap               : 10px;
}
.brixies-cn-related--cart .brixies-cn-card__name  { font-size: 12px; padding: 6px 4px 0; }
.brixies-cn-related--cart .brixies-cn-card__price { font-size: 13px; padding: 0 4px 4px; }
.brixies-cn-related--cart .brixies-cn-add         { width: 26px; height: 26px; font-size: 15px; top: 6px; right: 6px; }

@keyframes brixies-cn-fadein {
	from { opacity: 0; transform: translateY(-3px); }
	to   { opacity: 1; transform: translateY(0); }
}
