/**
 * "Regalo incluido" gift card component for Vida Aromatica Child.
 *
 * Self-contained presentational styles. No layout, price or cart styles are
 * altered here; this only styles the component's own markup.
 */

.va-gift-card {
	background: #ffffff;
	border: 1px solid #d4af37;
	border-radius: 14px;
	box-shadow: 0 8px 24px rgba(20, 16, 8, 0.08);
	margin: 18px 0;
	max-width: 420px;
	padding: 18px 20px;
}

.va-gift-card__title {
	color: #8a6d1d;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin: 0 0 6px;
	text-transform: uppercase;
}

.va-gift-card__intro {
	color: #4a4a4a;
	font-size: 14px;
	margin: 0 0 14px;
}

.va-gift-card__row {
	align-items: center;
	display: flex;
	gap: 14px;
	margin-bottom: 16px;
}

.va-gift-card__thumb {
	align-items: center;
	background: #faf6e9;
	border-radius: 10px;
	display: flex;
	flex-shrink: 0;
	height: 80px;
	justify-content: center;
	overflow: hidden;
	width: 80px;
}

.va-gift-card__thumb-img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.va-gift-card__thumb-fallback {
	font-size: 32px;
	line-height: 1;
}

.va-gift-card__details {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.va-gift-card__name {
	color: #2c2c2c;
	font-size: 16px;
	font-weight: 700;
}

.va-gift-card__note {
	color: #8a6d1d;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.va-gift-card__cta {
	background: #ffffff;
	border: 1px solid #d4af37;
	border-radius: 999px;
	color: #8a6d1d;
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	padding: 9px 22px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.va-gift-card__cta:hover,
.va-gift-card__cta:focus-visible {
	background: #d4af37;
	color: #ffffff;
}

/**
 * "Ver regalo" modal / desplegable.
 */

.va-gift-card__modal {
	align-items: center;
	background: rgba(20, 16, 8, 0.55);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 20px;
	position: fixed;
	z-index: 9999;
}

.va-gift-card__modal[hidden] {
	display: none;
}

.va-gift-card__modal-box {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
	max-width: 360px;
	padding: 28px 24px;
	position: relative;
	text-align: center;
	width: 100%;
}

.va-gift-card__modal-close {
	background: transparent;
	border: none;
	color: #8a8a8a;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	padding: 4px;
	position: absolute;
	right: 12px;
	top: 12px;
}

.va-gift-card__modal-close:hover,
.va-gift-card__modal-close:focus-visible {
	color: #2c2c2c;
}

.va-gift-card__modal-image {
	margin: 0 auto 16px;
	max-width: 220px;
}

.va-gift-card__modal-image img {
	border-radius: 12px;
	display: block;
	height: auto;
	width: 100%;
}

.va-gift-card__modal-image--fallback {
	font-size: 56px;
	line-height: 1;
}

.va-gift-card__modal-name {
	color: #2c2c2c;
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 8px;
}

.va-gift-card__modal-description,
.va-gift-card__modal-promo {
	color: #5a5a5a;
	font-size: 14px;
	line-height: 1.5;
	margin: 0 0 8px;
}

.va-gift-card__modal-promo {
	color: #8a6d1d;
	font-weight: 600;
}

@media (max-width: 640px) {
	.va-gift-card {
		margin: 16px auto;
		max-width: 100%;
		padding: 16px;
		text-align: center;
	}

	.va-gift-card__row {
		flex-direction: column;
		text-align: center;
	}

	.va-gift-card__thumb {
		height: 70px;
		width: 70px;
	}

	.va-gift-card__cta {
		width: 100%;
	}
}

/**
 * Compact "Regalo incluido" reminder for the cart (and, later, checkout).
 * Built on <ul>/<li>/<img>/<p>/<strong>/<em> only: the WooCommerce Cart and
 * Checkout blocks sanitize cart line item HTML client-side with a strict
 * allowlist that excludes <div>/<span>/data-* attributes.
 */
.va-gift-card--cart {
	align-items: center;
	box-shadow: 0 2px 8px rgba(20, 16, 8, 0.06);
	display: flex;
	gap: 10px;
	list-style: none;
	margin: 8px 0 0;
	max-width: 320px;
	padding: 8px 12px;
}

.va-gift-card--cart .va-gift-card__cart-item {
	align-items: center;
	display: flex;
	gap: 10px;
	width: 100%;
}

.va-gift-card__cart-thumb {
	border-radius: 8px;
	flex-shrink: 0;
	height: 56px;
	object-fit: cover;
	width: 56px;
}

.va-gift-card__cart-text {
	color: #2c2c2c;
	font-size: 13px;
	line-height: 1.4;
	margin: 0;
}

.va-gift-card__cart-label {
	color: #8a6d1d;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.va-gift-card__cart-note {
	color: #8a6d1d;
	font-size: 12px;
	font-style: normal;
}

@media (max-width: 640px) {
	.va-gift-card--cart {
		max-width: 100%;
	}
}

/**
 * Compact "Regalo incluido" reminder for the "order" context: the admin
 * order edit screen and the My Account order view. Both are normal
 * server-rendered pages, so this uses plain div/span markup (no Blocks
 * sanitizer constraint here, unlike --cart).
 */
.va-gift-card--order {
	align-items: flex-start;
	background: #ffffff;
	border: 1px solid #d4af37;
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(20, 16, 8, 0.06);
	display: flex;
	gap: 8px;
	margin: 8px 0 0;
	max-width: 320px;
	padding: 8px 12px;
}

.va-gift-card__order-icon {
	flex-shrink: 0;
	font-size: 16px;
	line-height: 1.4;
}

.va-gift-card__order-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.va-gift-card__order-label {
	color: #8a6d1d;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.va-gift-card__order-thumb {
	border-radius: 6px;
	height: 40px;
	margin: 2px 0;
	object-fit: cover;
	width: 40px;
}

.va-gift-card__order-name {
	color: #2c2c2c;
	font-size: 13px;
	font-weight: 600;
}

.va-gift-card__order-note {
	color: #8a6d1d;
	font-size: 12px;
}

@media (max-width: 640px) {
	.va-gift-card--order {
		max-width: 100%;
	}
}

/**
 * "Regalo promocional" badge: identifies a gift product's own cart/checkout/
 * order line item as a promotional freebie, not a normal purchase.
 */
.va-gift-promo-badge {
	color: #2c2c2c;
	font-size: 12px;
	line-height: 1.4;
	margin: 6px 0 0;
}

.va-gift-promo-badge__label {
	color: #8a6d1d;
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.va-gift-promo-badge--order {
	align-items: flex-start;
	background: #faf6e9;
	border: 1px solid #d4af37;
	border-radius: 8px;
	display: flex;
	gap: 8px;
	margin: 8px 0 0;
	max-width: 320px;
	padding: 6px 10px;
}

.va-gift-promo-badge--order .va-gift-promo-badge__icon {
	flex-shrink: 0;
	font-size: 14px;
	line-height: 1.4;
}

.va-gift-promo-badge--order .va-gift-promo-badge__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.va-gift-promo-badge--order .va-gift-promo-badge__label {
	display: inline;
}

.va-gift-promo-badge__note {
	color: #8a6d1d;
	font-size: 12px;
}

@media (max-width: 640px) {
	.va-gift-promo-badge--order {
		max-width: 100%;
	}
}

/**
 * "Promociones y obsequios" grouping for the Cart and Checkout blocks: tints
 * a gift's own line item and labels the first one of the group, so it reads
 * as a separate block under the customer's purchased products instead of a
 * normal line among them. The line item itself is unchanged underneath -
 * still a real WooCommerce line item with its own stock, order, invoice and
 * email entry - this is presentation only.
 *
 * .va-gift-line-item is added to the row by registerCheckoutFilters()'s
 * cartItemClass filter in assets/js/components/gift-cart-blocks.js, which
 * only runs on the Cart/Checkout blocks (this site does not use the classic
 * shortcode cart/checkout templates, see gift-cart.php). Always at the
 * bottom of the list because va_reorder_gift_cart_items_to_end()
 * (gift-cart.php) sorts every va-gift-line-item line after every regular
 * line, server-side, before either page reads the cart.
 *
 * The heading is generated content on the row's own description wrapper -
 * a normal <div> in both blocks - never on the <tr> itself, which most
 * browsers do not render generated content on. The :not() + general-sibling
 * selector below matches only the first va-gift-line-item among its
 * siblings (CSS Selectors Level 4, supported by all current browsers), so
 * exactly one heading shows even when several different gifts are grouped.
 */
tr.wc-block-cart-items__row.va-gift-line-item,
div.wc-block-components-order-summary-item.va-gift-line-item {
	background-color: #faf6e9;
}

tr.wc-block-cart-items__row.va-gift-line-item:not(tr.wc-block-cart-items__row.va-gift-line-item ~ tr.wc-block-cart-items__row.va-gift-line-item) .wc-block-cart-item__wrap::before,
div.wc-block-components-order-summary-item.va-gift-line-item:not(div.wc-block-components-order-summary-item.va-gift-line-item ~ div.wc-block-components-order-summary-item.va-gift-line-item) .wc-block-components-order-summary-item__description::before {
	color: #8a6d1d;
	content: "Promociones y obsequios";
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	margin: 0 0 6px;
	text-transform: uppercase;
}
