/*
Theme Name: Alipharma
Theme URI: https://alipharma.com.mx
Description: Child theme of Teenglow for Alipharma. Houses customer-facing UI customizations, including the bundle-promotion helper cards on product pages.
Author: Alipharma
Author URI: https://alipharma.com.mx
Template: teenglow
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alipharma
*/

/* -------------------------------------------------------------------------
 * Brand tokens (sampled from the Alipharma product page) — available site-wide
 * for any child-theme customization. The bundle-helper cards ship their own
 * scoped copy so they render correctly even before this theme is activated.
 * ---------------------------------------------------------------------- */
:root {
	--alp-navy: #0e1b54;
	--alp-ink: #16205a;
	--alp-blue: #1f2ad6;
	--alp-blue-600: #1a23bd;
	--alp-lavender: #c9a9e2;
	--alp-muted: #6b7280;
	--alp-line: #ececf3;
}

/* Child-theme global tweaks can go below. */

/* ===========================================================================
 * Single-product summary polish
 * Scoped to the summary column (.qodef-woo-single-inner .entry-summary) so it
 * never leaks elsewhere. Refines typography, spacing and the price/stock, and
 * settles the bundle cards into the column.
 * ======================================================================== */

/* Title */
.qodef-woo-single-inner .entry-summary .qodef-woo-product-title.product_title {
	margin: 0 0 10px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.15;
	color: var(--alp-navy);
}

/* Price */
.qodef-woo-single-inner .entry-summary .price {
	margin: 0 0 10px;
	font-size: 1.4em;
	font-weight: 700;
	color: var(--alp-blue);
}
.qodef-woo-single-inner .entry-summary .price del {
	margin-right: 9px;
	font-size: .62em;
	font-weight: 600;
	color: #9aa0b3;
	opacity: 1;
}
.qodef-woo-single-inner .entry-summary .price del .woocommerce-Price-amount {
	color: #9aa0b3;
}
.qodef-woo-single-inner .entry-summary .price ins {
	text-decoration: none;
}

/* Stock → subtle status pill */
.qodef-woo-single-inner .entry-summary .stock {
	display: inline-block;
	margin: 0 0 22px;
	padding: 4px 13px;
	border-radius: 999px;
	background: #e9f7ef;
	color: #1a8f54;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.5;
}
.qodef-woo-single-inner .entry-summary .stock.out-of-stock {
	background: #fdecec;
	color: #c0392b;
}

/* Add-to-cart block + the in-cart badge breathing room */
.qodef-woo-single-inner .entry-summary form.cart {
	margin: 0 0 8px;
}
.qodef-woo-single-inner .entry-summary .alp-incart {
	margin-top: 14px;
}

/* Bundle cards settle under the add-to-cart, before the meta */
.qodef-woo-single-inner .entry-summary .alp-bundles {
	margin: 18px 0 22px;
}

/* Product meta (category / brand) set off with a divider */
.qodef-woo-single-inner .entry-summary .product_meta {
	margin: 0;
	padding-top: 20px;
	border-top: 1px solid var(--alp-line);
	font-size: 13.5px;
	line-height: 2;
	color: var(--alp-muted);
}
.qodef-woo-single-inner .entry-summary .product_meta > span {
	display: block;
}

/* ===========================================================================
 * Header mini-cart (dropdown) — tighter rows so more items show at a glance.
 * The mu-plugin sets the base look; these `body`-scoped rules win the cascade
 * regardless of stylesheet order and only trim the vertical rhythm.
 * ======================================================================== */
body .qodef-widget-dropdown-cart-content .qodef-woo-mini-cart-item {
	gap: 11px;
	padding: 9px 24px 9px 0;
}
body .qodef-widget-dropdown-cart-content .qodef-woo-mini-cart-item .qodef-e-image {
	flex: 0 0 44px;
	width: 44px;
}
body .qodef-widget-dropdown-cart-content .qodef-woo-mini-cart-item .qodef-e-image img {
	width: 44px;
	height: 44px;
	border-radius: 8px;
}
body .qodef-widget-dropdown-cart-content .qodef-woo-mini-cart-item .qodef-e-title {
	margin: 0 0 1px;
	font-size: 13px;
	line-height: 1.25;
}
body .qodef-widget-dropdown-cart-content .qodef-woo-mini-cart-item .qodef-e-price {
	font-size: 12.5px;
}

/* ===========================================================================
 * Cart page — modern, two-column layout + refined table & totals.
 * The cart form and totals live inside Teenglow's #qodef-woo-page.qodef--cart
 * wrapper (not directly under .woocommerce), so that wrapper is the flex
 * container. Everything else is scoped to the cart's own structural classes
 * (.woocommerce-cart-form, .cart_totals, .cart-collaterals).
 * ======================================================================== */

/* --- Two columns on desktop: cart table (fluid) | totals (fixed, narrower) - */
@media (min-width: 1000px) {
	#qodef-woo-page.qodef--cart {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 30px;
	}
	/* Notices / banners / stray hooks span the full width on their own row. */
	#qodef-woo-page.qodef--cart > * {
		flex-basis: 100%;
	}
	#qodef-woo-page.qodef--cart > form.woocommerce-cart-form {
		flex: 1 1 0;
		min-width: 0;
		margin: 0;
	}
	#qodef-woo-page.qodef--cart > .cart-collaterals {
		flex: 0 0 360px;
		max-width: 360px;
		margin: 0;
	}
}
/* Keep the right column focused on the totals. */
.cart-collaterals .cross-sells {
	display: none;
}
.cart-collaterals .cart_totals {
	width: 100% !important;
	float: none !important;
}

/* --- Cart table: lighter, smaller, more modern ---------------------------- */
.woocommerce-cart-form .shop_table {
	border: 1px solid var(--alp-line);
	border-radius: 16px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	font-size: 12.5px;
	background: #fff;
	box-shadow: 0 8px 30px rgba(16, 27, 84, .05);
}
.woocommerce-cart-form .shop_table thead th {
	padding: 14px 14px;
	background: #f7f8fc;
	border: 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--alp-muted);
}
.woocommerce-cart-form .shop_table tbody td {
	padding: 14px 14px;
	border: 0;
	border-top: 1px solid var(--alp-line);
	vertical-align: middle;
}
.woocommerce-cart-form .shop_table tbody tr:first-child td {
	border-top: 0;
}
.woocommerce-cart-form .product-thumbnail img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid var(--alp-line);
}
.woocommerce-cart-form .product-name,
.woocommerce-cart-form .product-name a {
	font-weight: 600;
	color: var(--alp-ink);
}
.woocommerce-cart-form .product-name a:hover {
	color: var(--alp-blue);
}

/* All struck-through (was-)prices in gray, regardless of column. */
.woocommerce-cart-form .shop_table del,
.woocommerce-cart-form .shop_table del .woocommerce-Price-amount,
.woocommerce-cart-form .shop_table del bdi {
	color: #9aa0b3 !important;
	font-weight: 400;
	opacity: 1;
}
.woocommerce-cart-form .shop_table ins {
	text-decoration: none;
	font-weight: 700;
	color: var(--alp-ink);
}

/* --- Remove control: one trash icon -----------------------------------------
 * Teenglow draws a masked "×" on a.remove::after. Rather than fight to hide it
 * (and add our own pseudo, which left two marks), we REPURPOSE that same ::after
 * by overriding its mask with a trash glyph — guaranteeing a single icon. The
 * "×" text node is hidden via font-size:0. !important beats Teenglow's id rule. */
.woocommerce-cart-form td.product-remove a.remove {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 30px !important;
	height: 30px !important;
	border-radius: 8px;
	font-size: 0 !important;
	line-height: 0 !important;
	color: transparent !important;
	background: transparent;
	transition: background .15s ease;
}
.woocommerce-cart-form td.product-remove a.remove::after {
	content: "" !important;
	display: block !important;
	width: 18px !important;
	height: 18px !important;
	background-color: #9aa0b3 !important;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E") !important;
	        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E") !important;
	-webkit-mask-repeat: no-repeat !important;
	        mask-repeat: no-repeat !important;
	-webkit-mask-position: center !important;
	        mask-position: center !important;
	-webkit-mask-size: contain !important;
	        mask-size: contain !important;
	transition: background-color .15s ease;
}
.woocommerce-cart-form td.product-remove a.remove:hover {
	background: #fdecec;
}
.woocommerce-cart-form td.product-remove a.remove:hover::after {
	background-color: #c0392b !important;
}

/* --- In-line bundle note kept tidy under the product name ----------------- */
.woocommerce-cart-form .product-name .alp-line-note {
	display: block;
	margin-top: 4px;
}

/* --- Actions row: coupon field + update button --------------------------- */
.woocommerce-cart-form td.actions {
	padding: 18px 14px;
	border-top: 1px solid var(--alp-line);
}
.woocommerce-cart-form td.actions .coupon {
	display: inline-flex;
	gap: 8px;
}
.woocommerce-cart-form td.actions .coupon input#coupon_code {
	min-width: 200px;
	padding: 11px 16px;
	border: 1px solid var(--alp-line);
	border-radius: 10px;
	background: #fff;
	font-size: 13.5px;
	color: var(--alp-ink);
}
.woocommerce-cart-form td.actions .coupon input#coupon_code::placeholder {
	color: #aab0c2;
}
.woocommerce-cart-form td.actions .coupon input#coupon_code:focus {
	outline: none;
	border-color: var(--alp-blue);
	box-shadow: 0 0 0 3px rgba(31, 42, 214, .12);
}
.woocommerce-cart-form td.actions .coupon button[name="apply_coupon"] {
	padding: 11px 20px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	background: #eef0fc;
	color: var(--alp-blue-600);
	border: 0;
}
.woocommerce-cart-form td.actions .coupon button[name="apply_coupon"]:hover {
	background: #e3e6fb;
}
.woocommerce-cart-form td.actions button[name="update_cart"] {
	padding: 11px 22px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	background: var(--alp-navy);
	color: #fff;
	border: 0;
}
.woocommerce-cart-form td.actions button[name="update_cart"][disabled] {
	opacity: .45;
}

/* --- "Total del carrito" card --------------------------------------------- */
/* Teenglow forces margin-top:100px on .cart_totals (id-scoped); zero it so the
   totals align with the top of the cart table in the two-column layout. */
#qodef-woo-page.qodef--cart .cart_totals {
	margin-top: 0;
}
.cart_totals {
	padding: 22px 22px 24px;
	border: 1px solid var(--alp-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 10px 34px rgba(16, 27, 84, .07);
}
.cart_totals h2 {
	margin: 0 0 12px;
	font-size: 15.5px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--alp-navy);
}
.cart_totals .shop_table {
	border: 0;
	font-size: 12px;
}
.cart_totals .shop_table th,
.cart_totals .shop_table td {
	padding: 11px 0;
	border: 0;
	border-top: 1px solid var(--alp-line);
	background: transparent;
}
.cart_totals .shop_table tr:first-child th,
.cart_totals .shop_table tr:first-child td {
	border-top: 0;
}
.cart_totals .shop_table th {
	font-weight: 600;
	color: var(--alp-muted);
}
.cart_totals .shop_table td {
	text-align: right;
	color: var(--alp-ink);
}
/* Discount + gift rows read as positive savings (green), with calm labels
   instead of the default bold-blue fee titles. */
.cart_totals .fee th,
.cart_totals .cart-discount th {
	font-weight: 600;
	color: var(--alp-muted);
}
.cart_totals .fee td,
.cart_totals .cart-discount td {
	color: #1a8f54;
	font-weight: 700;
}
/* Shipping: compact, muted secondary lines; keep the cost/address legible. */
.cart_totals .shipping td {
	font-size: 11.5px;
	line-height: 1.55;
	color: var(--alp-muted);
}
.cart_totals .shipping td strong,
.cart_totals .shipping td .amount {
	color: var(--alp-ink);
}
.cart_totals .shipping .woocommerce-shipping-destination {
	margin: 4px 0 0;
}
.cart_totals .order-total th {
	font-size: 13px;
	font-weight: 800;
	color: var(--alp-navy);
}
.cart_totals .order-total td {
	font-size: 15.5px;
	font-weight: 800;
	color: var(--alp-navy);
}
.cart_totals .wc-proceed-to-checkout {
	padding: 16px 0 0;
}
.cart_totals .wc-proceed-to-checkout a.checkout-button {
	display: block;
	width: 100%;
	padding: 13px 18px;
	border-radius: 12px;
	background: var(--alp-navy);
	color: #fff;
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: .04em;
	text-align: center;
	text-transform: uppercase;
}
.cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
	background: var(--alp-blue-600);
}

/* ===========================================================================
 * Outrank the Customizer "Additional CSS" cart block.
 * That block (#wp-custom-css, loaded AFTER this stylesheet) styles the cart with
 * !important at class-level specificity — so on ties it wins by source order,
 * leaving some text oversized, the remove "×" forced back at 24px, and the
 * shipping line overflowing the narrow totals card. Re-scoping the same intent
 * under the cart's id (#qodef-woo-page.qodef--cart) raises specificity so these
 * win cleanly. If that Additional CSS is ever trimmed, these can go too.
 * ======================================================================== */

/* Table: tighter rows + smaller text (over the block's 20px / institutional th). */
#qodef-woo-page.qodef--cart table.shop_table.cart th {
	padding: 14px 14px !important;
	font-size: 11px !important;
	color: var(--alp-muted) !important;
	text-transform: uppercase;
	letter-spacing: .05em;
}
#qodef-woo-page.qodef--cart table.shop_table.cart td {
	padding: 14px 14px !important;
	font-size: 12.5px !important;
}

/* Remove control: kill the "×" text the block re-enables at font-size:24px
   (our trash glyph lives on ::after and already wins). */
#qodef-woo-page.qodef--cart .woocommerce-cart-form td.product-remove a.remove {
	font-size: 0 !important;
	color: transparent !important;
}

/* Totals: smaller heading (block forces 22px). */
#qodef-woo-page.qodef--cart .cart_totals h2 {
	font-size: 15.5px !important;
	margin-bottom: 12px !important;
}

/* Lay each totals row out with flexbox (label left / value right). The theme's
   table-layout never reliably constrained the columns — the value cell kept
   getting pushed past the card — so we drive the rows directly. Desktop only;
   below the two-column breakpoint the default table stacking is fine. */
@media (min-width: 1000px) {
	#qodef-woo-page.qodef--cart .cart_totals table.shop_table,
	#qodef-woo-page.qodef--cart .cart_totals table.shop_table tbody {
		display: block !important;
		width: 100% !important;
	}
	#qodef-woo-page.qodef--cart .cart_totals table.shop_table tr {
		display: flex !important;
		align-items: baseline !important;
		justify-content: space-between !important;
		gap: 14px !important;
		width: 100% !important;
		border-top: 1px solid var(--alp-line) !important;
	}
	#qodef-woo-page.qodef--cart .cart_totals table.shop_table tr:first-child {
		border-top: 0 !important;
	}
	#qodef-woo-page.qodef--cart .cart_totals table.shop_table tr th,
	#qodef-woo-page.qodef--cart .cart_totals table.shop_table tr td {
		width: auto !important;
		min-width: 0 !important;
		border: 0 !important;
		flex: 0 1 auto !important;
	}
	/* Shipping address takes its own full-width line under the "Envío" label. */
	#qodef-woo-page.qodef--cart .cart_totals tr.woocommerce-shipping-totals {
		flex-wrap: wrap !important;
	}
	#qodef-woo-page.qodef--cart .cart_totals tr.woocommerce-shipping-totals td {
		flex: 1 1 100% !important;
	}
}

/* Label cells: small, muted, no indent. Shipping th keeps font-size:0 (the
   block's "Shipping"→"Envío" swap), so only its ::before is sized. */
#qodef-woo-page.qodef--cart .cart_totals table.shop_table tr:not(.woocommerce-shipping-totals) th {
	padding: 11px 0 !important;
	font-family: inherit !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	color: var(--alp-muted) !important;
	text-align: left !important;
	letter-spacing: 0 !important;
}
#qodef-woo-page.qodef--cart .cart_totals tr.woocommerce-shipping-totals th {
	padding: 11px 0 0 !important;
	text-align: left !important;
}
#qodef-woo-page.qodef--cart .cart_totals tr.woocommerce-shipping-totals th::before {
	font-size: 12px !important;
	color: var(--alp-muted) !important;
}

/* Value cells: small, right-aligned, always wrap inside the card. */
#qodef-woo-page.qodef--cart .cart_totals table.shop_table tr td {
	padding: 11px 0 !important;
	font-size: 12.5px !important;
	color: var(--alp-ink) !important;
	text-align: right !important;
	overflow-wrap: anywhere !important;
	word-break: break-word !important;
}
/* Fee rows = savings, in green. */
#qodef-woo-page.qodef--cart .cart_totals tr.fee td {
	color: #1a8f54 !important;
}
/* Shipping value: compact, muted, left-aligned full-width line that wraps.
   Target descendants too — the address <strong>/destination span can carry a
   white-space:nowrap that otherwise pushes the line past the card edge. */
#qodef-woo-page.qodef--cart .cart_totals tr.woocommerce-shipping-totals td {
	padding: 2px 0 11px !important;
	font-size: 11.5px !important;
	color: var(--alp-muted) !important;
	text-align: left !important;
}
#qodef-woo-page.qodef--cart .cart_totals tr.woocommerce-shipping-totals td,
#qodef-woo-page.qodef--cart .cart_totals tr.woocommerce-shipping-totals td * {
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-break: break-word !important;
}
/* Grand total stands out a touch. */
#qodef-woo-page.qodef--cart .cart_totals tr.order-total th {
	font-size: 13px !important;
	color: var(--alp-navy) !important;
}
#qodef-woo-page.qodef--cart .cart_totals tr.order-total td,
#qodef-woo-page.qodef--cart .cart_totals tr.order-total .woocommerce-Price-amount {
	font-size: 16px !important;
	font-weight: 800 !important;
	color: var(--alp-navy) !important;
}

/* ===========================================================================
 * Sticky footer — keep #qodef-page-footer pinned to the bottom of the viewport
 * on short pages (e.g. the cart) instead of floating up with empty space below.
 * Make the page wrapper a full-height flex column and let the main content area
 * grow to absorb the slack. Site-wide; harmless on tall pages.
 * ======================================================================== */
#qodef-page-wrapper {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
#qodef-page-wrapper > #qodef-page-outer {
	flex: 1 0 auto;
}
#qodef-page-wrapper > #qodef-page-footer {
	flex-shrink: 0;
}
