/* Tinyplugs Gift Wrapping for WooCommerce – Cart & Checkout — front-end styles */

.cgwfw-wrap {
	margin-top: 8px;
	font-size: 0.9em;
}

.cgwfw-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	border: none;
	padding: 6px 12px;
	line-height: 1.3;
	background: var(--cgwfw-btn-bg, #1e3a5f);
	color: var(--cgwfw-btn-color, #fff);
	border-radius: var(--cgwfw-btn-radius, 4px);
	transition: background-color 0.15s ease, opacity 0.15s ease;
	/* Align with the adjacent tooltip icon (also vertical-align: middle). */
	vertical-align: middle;
}

.cgwfw-btn:hover {
	opacity: 0.9;
}

.cgwfw-btn.is-wrapped {
	background: var(--cgwfw-btn-bg-added, #2e7d32);
	color: var(--cgwfw-btn-color-added, #fff);
}

.cgwfw-btn-fee {
	opacity: 0.85;
	font-size: 0.9em;
}

.cgwfw-btn.cgwfw-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Theme compatibility: some themes (e.g. Flatsome) force uppercase text,
   their own button colours and letter-spacing onto every button. Re-assert
   the plugin's own styling so the admin colour settings always apply and the
   label/price render as intended. */
.cgwfw-wrap .cgwfw-btn,
.cgwfw-wrap .cgwfw-btn:hover,
.cgwfw-wrap .cgwfw-btn:focus {
	text-transform: none !important;
	letter-spacing: normal !important;
	color: var(--cgwfw-btn-color, #fff) !important;
	background: var(--cgwfw-btn-bg, #1e3a5f) !important;
	text-shadow: none !important;
}

.cgwfw-wrap .cgwfw-btn.is-wrapped {
	background: var(--cgwfw-btn-bg-added, #2e7d32) !important;
	color: var(--cgwfw-btn-color-added, #fff) !important;
}

.cgwfw-wrap .cgwfw-btn .cgwfw-btn-label,
.cgwfw-wrap .cgwfw-btn .cgwfw-btn-fee,
.cgwfw-wrap .cgwfw-btn .cgwfw-btn-fee * {
	color: inherit !important;
	text-transform: none !important;
}





/* Info tooltip ("?" icon with a black box / white text on hover or focus) */
.cgwfw-tip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin-left: 6px;
	border-radius: 50%;
	background: #555;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	cursor: help;
	position: relative;
	vertical-align: middle;
}

.cgwfw-tip::after {
	content: attr(data-cgwfw-tip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #000;
	color: #fff;
	padding: 7px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	white-space: normal;
	width: max-content;
	max-width: 220px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease;
	z-index: 1000;
	pointer-events: none;
}

.cgwfw-tip::before {
	content: "";
	position: absolute;
	bottom: calc(100% + 3px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease;
	z-index: 1000;
	pointer-events: none;
}

.cgwfw-tip:hover::after,
.cgwfw-tip:focus::after,
.cgwfw-tip:focus-visible::after,
.cgwfw-tip:hover::before,
.cgwfw-tip:focus::before,
.cgwfw-tip:focus-visible::before {
	opacity: 1;
	visibility: visible;
}

.cgwfw-message-wrap {
	margin-top: 6px;
}

.cgwfw-message-label {
	display: block;
	font-size: 0.95em;
}

.cgwfw-message {
	display: block;
	width: 100%;
	max-width: 320px;
	margin-top: 3px;
	box-sizing: border-box;
}

/* Per-order row inside cart totals */
.cgwfw-order-row .cgwfw-order-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: normal;
}



/* Per-order promo card */
.cgwfw-card {
	border: 1px solid #e4e7e7;
	border-radius: 12px;
	padding: 16px 18px;
	margin: 18px 0 18px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}

/* Block checkout: even spacing on all sides of the card. */
.woocommerce-checkout .cgwfw-card.cgwfw-blocks {
	width: auto;
	margin: 15px;
}

/* Classic checkout: the card renders inside the order-review column (before the
   payment box), so keep it at the column's full width with only vertical
   spacing — no horizontal inset that would misalign it with the totals table. */
.woocommerce-checkout .cgwfw-card:not(.cgwfw-blocks) {
	width: auto;
	margin: 15px 0;
}

.cgwfw-card.is-wrapped {
	border-color: var(--cgwfw-btn-bg-added, #2e7d32);
}

.cgwfw-card-main {
	display: flex;
	align-items: center;
	gap: 14px;
}

.cgwfw-card-icon {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--cgwfw-btn-bg, #1e3a5f);
	color: var(--cgwfw-btn-color, #fff);
}

.cgwfw-card.is-wrapped .cgwfw-card-icon {
	background: var(--cgwfw-btn-bg-added, #2e7d32);
	color: var(--cgwfw-btn-color-added, #fff);
}

.cgwfw-card-body {
	flex: 1 1 auto;
	min-width: 0;
}

.cgwfw-card-title {
	font-weight: 600;
	font-size: 1.02em;
	line-height: 1.25;
}

.cgwfw-card-sub {
	color: #777;
	font-size: 0.88em;
	margin-top: 1px;
}

.cgwfw-card-price {
	margin-top: 4px;
	font-weight: 700;
	color: var(--cgwfw-btn-bg, #1e3a5f);
}

.cgwfw-card.is-wrapped .cgwfw-card-price {
	color: var(--cgwfw-btn-bg-added, #2e7d32);
}

.cgwfw-card-btn {
	flex: 0 0 auto;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 0.85em;
	padding: 9px 16px;
}

.cgwfw-card .cgwfw-message-wrap {
	margin-top: 12px;
}

.cgwfw-card .cgwfw-message {
	max-width: 100%;
}

@media (max-width: 480px) {
	.cgwfw-card-main { flex-wrap: wrap; }
	.cgwfw-card-btn { width: 100%; justify-content: center; }
}

/* Block cart/checkout: card spans the full order-summary width with comfortable
   horizontal padding, and a larger white parcel icon. */
.cgwfw-card.cgwfw-blocks {
	width: 100%;
	max-width: none;
	padding: 16px 15px;
	margin: 10px 0;
	box-sizing: border-box;
}

.cgwfw-card.cgwfw-blocks .cgwfw-card-icon {
	width: 60px;
	height: 60px;
}





/* Block checkout: give the designs/checkbox wraps the same horizontal inset
   the card variant already gets — the checkout order-summary slot renders
   with no padding of its own. */
.woocommerce-checkout .cgwfw-wrap.cgwfw-blocks:not(.cgwfw-card) {
	width: auto;
	margin: 15px;
}
