/* ==========================================================================
   Elan — WooCommerce commerce surfaces

   Cart, checkout, my-account, order-received and the notice system.

   The reference pages draw none of these, so nothing here is transcribed — it is
   the brand's own vocabulary applied to WooCommerce's classic markup: hairline
   rules instead of boxes, one tinted summary panel, ALL-CAPS 14px table heads,
   Marcellus only for headings, and the same .btn geometry as the rest of the site.

   Woo's own stylesheets stay dequeued (see inc/woocommerce.php). The cart and
   checkout pages were switched from the Cart/Checkout BLOCKS to the classic
   shortcodes so this markup is server-rendered and styleable at all; the original
   block content is kept in each page's _elan_block_content_backup meta.
   ========================================================================== */

/* page.php wraps the_content() in `.entry`, whose prose rules are meant for an
   article: a 760px measure, 24px between every sibling, and underlined links.
   None of that belongs on a checkout grid, so the commerce pages opt out. */
.woocommerce-cart .entry,
.woocommerce-checkout .entry,
.woocommerce-account .entry,
.woocommerce-order-received .entry { max-width: none; }

.woocommerce-cart .entry > * + *,
.woocommerce-checkout .entry > * + *,
.woocommerce-account .entry > * + *,
.woocommerce-order-received .entry > * + * { margin-top: 0; }

.entry .woocommerce a { text-decoration: none; }
.entry .woocommerce a.woocommerce-Button,
.entry .woocommerce .button { text-decoration: none; }

/* WooCommerce marks up screen-reader-only labels — the cart's "Thumbnail image"
   and "Remove item" column headings, quantity labels — and relies on its own
   stylesheet to hide them. That stylesheet is dequeued, so without this they are
   painted onto the page. They stay in the accessibility tree, as intended. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* --------------------------------------------------------------------------
   Notices
   -------------------------------------------------------------------------- */
.woocommerce-notices-wrapper:empty { display: none; }

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin: 0 0 33px;
	padding: 18px 24px;
	list-style: none;
	border-radius: var(--radius-sm);
	font-size: var(--type-body);
	line-height: 150%;
	background: var(--elan-green-tint);
	box-shadow: var(--ring-brand-half);
	color: var(--elan-ink);
}

.woocommerce-error {
	background: #FBF1EE;
	box-shadow: inset 0 0 0 .5px var(--elan-clay);
	color: var(--elan-clay);
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.woocommerce-message .button,
.woocommerce-info .button { margin-left: auto; }

/* --------------------------------------------------------------------------
   Buttons

   Woo emits `.button` on its own controls. They take the site's primary button
   geometry; `.alt` is the emphasised one (checkout, place order).
   -------------------------------------------------------------------------- */
.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button,
.woocommerce-page .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	height: 50px;
	padding: 0 26px;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--elan-green);
	color: var(--elan-white);
	font-family: inherit;
	font-size: var(--type-body);
	line-height: 100%;
	text-align: center;
	cursor: pointer;
	transition: background var(--dur-base) var(--ease-brand);
}

.woocommerce .button:hover,
.woocommerce-page .button:hover { background: var(--elan-green-hover); opacity: 1; }

.woocommerce .button:disabled,
.woocommerce .button[disabled] { opacity: .45; cursor: default; }

/* The secondary action on a row — "Ažuriraj korpu" — is the hairline variant. */
.woocommerce button[name="update_cart"],
.woocommerce .button.wc-backward {
	background: transparent;
	color: var(--elan-green);
	box-shadow: var(--ring-brand-half);
}

.woocommerce button[name="update_cart"]:hover,
.woocommerce .button.wc-backward:hover { background: var(--elan-green-tint); }

/* --------------------------------------------------------------------------
   Form controls

   One field style across cart, checkout and account: white fill, hairline ring,
   radius 3, 48px tall. Focus is the brand ring, never a removed outline.
   -------------------------------------------------------------------------- */
.woocommerce .input-text,
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="tel"],
.woocommerce input[type="password"],
.woocommerce input[type="number"],
.woocommerce select,
.woocommerce textarea,
.woocommerce .select2-selection--single {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	border: 0;
	border-radius: var(--radius-xs);
	background: var(--elan-white);
	box-shadow: inset 0 0 0 1px var(--elan-border);
	font-family: inherit;
	font-size: var(--type-body);
	color: var(--elan-ink);
	appearance: none;
}

.woocommerce textarea { height: 120px; padding: 12px 14px; line-height: 150%; resize: vertical; }

.woocommerce select {
	background-image: linear-gradient(45deg, transparent 50%, var(--elan-ink) 50%), linear-gradient(135deg, var(--elan-ink) 50%, transparent 50%);
	background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 40px;
}

.woocommerce .input-text::placeholder,
.woocommerce textarea::placeholder { color: var(--elan-ink-soft); }

.woocommerce .input-text:focus-visible,
.woocommerce select:focus-visible,
.woocommerce textarea:focus-visible { outline: 1px solid var(--elan-green); outline-offset: 2px; }

.woocommerce .form-row { display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; padding: 0; }

.woocommerce .form-row label {
	font-size: var(--type-small);
	line-height: 100%;
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	color: var(--elan-ink-muted);
}

.woocommerce .required { color: var(--elan-clay); text-decoration: none; }
.woocommerce .optional { color: var(--elan-ink-soft); text-transform: none; letter-spacing: 0; }

.woocommerce .form-row.woocommerce-invalid .input-text,
.woocommerce .form-row.woocommerce-invalid select { box-shadow: inset 0 0 0 1px var(--elan-clay); }

/* Checkboxes sit beside their label rather than above it. */
.woocommerce .form-row.woocommerce-validated .input-text { box-shadow: inset 0 0 0 1px var(--elan-border); }

.woocommerce .woocommerce-form__label-for-checkbox,
.woocommerce .form-row label.checkbox {
	flex-direction: row;
	align-items: center;
	gap: 10px;
	display: flex;
	text-transform: none;
	letter-spacing: 0;
	font-size: var(--type-body);
	color: var(--elan-ink);
}

.woocommerce input[type="checkbox"],
.woocommerce input[type="radio"] { width: 18px; height: 18px; accent-color: var(--elan-green); flex: none; }

/* selectWoo, which Woo uses for the country field. */
.woocommerce .select2-container--default .select2-selection--single { display: flex; align-items: center; }
.woocommerce .select2-container--default .select2-selection--single .select2-selection__rendered { padding: 0; color: var(--elan-ink); line-height: inherit; }
.woocommerce .select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; right: 10px; }
.woocommerce .select2-dropdown { border: 1px solid var(--elan-border); border-radius: var(--radius-xs); }
.woocommerce .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--elan-green); }

/* --------------------------------------------------------------------------
   Tables — cart contents, order review, order details

   Depth is a hairline under each row, never a boxed grid.
   -------------------------------------------------------------------------- */
.woocommerce table.shop_table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: var(--type-body);
}

.woocommerce table.shop_table th {
	padding: 0 0 16px;
	text-align: left;
	font-family: var(--font-sans);
	font-size: var(--type-small);
	font-weight: 700;
	line-height: 100%;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--elan-ink);
	border-bottom: 1px solid var(--elan-border);
}

.woocommerce table.shop_table td {
	padding: 24px 0;
	vertical-align: middle;
	border-bottom: 1px solid var(--elan-border);
}

.woocommerce table.shop_table td:last-child,
.woocommerce table.shop_table th:last-child { text-align: right; }

/* --------------------------------------------------------------------------
   Cart
   -------------------------------------------------------------------------- */
/* Items left, summary right — the same composition the checkout already uses.
   Woo's classic cart stacks them, which left a 480px column of empty page beside
   the coupon row and pushed the total below the fold on a laptop. */
.woocommerce-cart .woocommerce {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0 64px;
}

.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper { flex: 1 0 100%; }

/* 440px is the narrowest the four-column line table stays readable at; below it
   the summary wraps underneath rather than squeezing the product names. */
.woocommerce-cart-form { flex: 1 1 440px; min-width: 0; margin-bottom: 0; }

.woocommerce table.cart .product-remove { width: 40px; }
.woocommerce table.cart .product-thumbnail { width: 110px; padding-right: 24px; }
.woocommerce table.cart .product-quantity { width: 140px; }

.woocommerce table.cart .product-thumbnail img {
	width: 88px;
	height: 110px;
	object-fit: cover;
	border-radius: var(--radius-sm);
	background: var(--elan-surface);
}

.woocommerce table.cart .product-name a {
	font-family: var(--font-display);
	font-size: var(--type-h3);
	line-height: 120%;
	color: var(--elan-ink);
}

.woocommerce table.cart .product-name .variation {
	margin: 6px 0 0;
	font-size: var(--type-micro);
	color: var(--elan-ink-soft);
}

.woocommerce a.remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	color: var(--elan-ink-soft);
	text-decoration: none;
	transition: background var(--dur-base) var(--ease-brand), color var(--dur-base) var(--ease-brand);
}

.woocommerce a.remove:hover { background: var(--elan-surface); color: var(--elan-clay); opacity: 1; }

/* The quantity control matches the product page's stepper. */
.woocommerce .quantity { display: inline-flex; }

.woocommerce .quantity input.qty {
	width: 84px;
	height: 40px;
	padding: 0 8px;
	text-align: center;
	-moz-appearance: textfield;
}

.woocommerce .quantity input.qty::-webkit-outer-spin-button,
.woocommerce .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.woocommerce table.cart td.actions { padding: 24px 0 0; border-bottom: 0; }

.woocommerce table.cart td.actions .coupon {
	display: flex;
	gap: 14px;
	align-items: center;
	float: none;
	margin-bottom: 20px;
}

.woocommerce table.cart td.actions .coupon .input-text { width: 260px; height: 50px; }
.woocommerce table.cart td.actions .coupon label { display: none; }

/* The cart summary — the one tinted panel in the brand, radius 20. */
.cart-collaterals { flex: 0 0 400px; max-width: 100%; }

.cart_totals {
	width: 100%;
	position: sticky;
	top: 24px;
	padding: 33px;
	border-radius: var(--radius-xl);
	background: var(--elan-surface);
	box-shadow: var(--ring-tile);
}

.cart_totals h2,
.woocommerce-checkout #order_review_heading,
.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3 {
	font-family: var(--font-display);
	font-size: var(--type-h3);
	font-weight: 400;
	line-height: 100%;
	margin: 0 0 24px;
}

.cart_totals table.shop_table th,
.cart_totals table.shop_table td { border-bottom: 1px solid var(--elan-chip); padding: 16px 0; }

.cart_totals table.shop_table th { padding-bottom: 16px; font-size: var(--type-small); }
.cart_totals .order-total th,
.cart_totals .order-total td { border-bottom: 0; padding-bottom: 0; }
.cart_totals .order-total td { font-size: var(--type-price); font-weight: 500; }

.wc-proceed-to-checkout { margin-top: 24px; }
.wc-proceed-to-checkout .checkout-button { width: 100%; }

.woocommerce .cart-empty { font-family: var(--font-display); font-size: var(--type-h2); margin-bottom: 24px; }
.woocommerce .return-to-shop { margin-top: 24px; }

/* --------------------------------------------------------------------------
   Checkout
   -------------------------------------------------------------------------- */
.woocommerce-checkout .woocommerce-form-coupon-toggle { margin-bottom: 24px; }

.woocommerce .checkout_coupon {
	display: flex;
	gap: 14px;
	align-items: flex-end;
	flex-wrap: wrap;
	margin: 0 0 33px;
	padding: 24px;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--elan-surface);
}

.woocommerce .checkout_coupon .form-row { margin: 0; }
.woocommerce .checkout_coupon .form-row-first { flex: 1; min-width: 220px; }

/* `min-content` on the first row: the review heading and its panel are separate
   grid items in the right column, and without it the row stretches to match the
   billing form and leaves a hole between the two. */
.woocommerce .checkout {
	display: grid;
	grid-template-columns: 1fr 480px;
	grid-template-rows: min-content 1fr;
	gap: 24px 64px;
	align-items: start;
}
.woocommerce #customer_details { min-width: 0; }
.woocommerce .checkout > .woocommerce-checkout-review-order,
.woocommerce .checkout > #order_review_heading { grid-column: 2; }
.woocommerce .checkout > #customer_details { grid-column: 1; grid-row: 1 / span 2; }

.woocommerce #customer_details .col-1,
.woocommerce #customer_details .col-2 { width: auto; float: none; }

.woocommerce #customer_details .col2-set { display: flex; flex-direction: column; gap: 0; }

/* The two-up name row. */
.woocommerce .form-row-first,
.woocommerce .form-row-last { width: calc(50% - 10px); display: inline-flex; vertical-align: top; }
.woocommerce .form-row-first { margin-right: 16px; }
.woocommerce .form-row-wide { width: 100%; }

.woocommerce #order_review {
	padding: 33px;
	border-radius: var(--radius-xl);
	background: var(--elan-surface);
	box-shadow: var(--ring-tile);
	position: sticky;
	top: 24px;
}

.woocommerce #order_review table.shop_table th,
.woocommerce #order_review table.shop_table td { border-bottom: 1px solid var(--elan-chip); padding: 14px 0; }

.woocommerce #order_review .order-total th,
.woocommerce #order_review .order-total td { border-bottom: 0; }
.woocommerce #order_review .order-total td { font-size: var(--type-price); font-weight: 500; }

.woocommerce #order_review .product-name { font-size: var(--type-body); }
.woocommerce #order_review .product-quantity { color: var(--elan-ink-soft); }

.woocommerce #payment { margin-top: 24px; }
.woocommerce #payment .wc_payment_methods { list-style: none; margin: 0 0 20px; padding: 0; }

.woocommerce #payment .wc_payment_method {
	padding: 14px 0;
	border-bottom: 1px solid var(--elan-chip);
}

.woocommerce #payment .wc_payment_method > label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: var(--type-body);
	color: var(--elan-ink);
	cursor: pointer;
}

.woocommerce #payment .payment_box {
	margin: 12px 0 0;
	padding: 14px;
	border-radius: var(--radius-xs);
	background: var(--elan-white);
	font-size: var(--type-small);
	line-height: 150%;
	color: var(--elan-ink-muted);
}

.woocommerce #payment .payment_box p:last-child { margin-bottom: 0; }
.woocommerce #payment .place-order { margin: 24px 0 0; padding: 0; }
.woocommerce #payment #place_order { width: 100%; }

.woocommerce-privacy-policy-text { font-size: var(--type-small); line-height: 150%; color: var(--elan-ink-muted); }
.woocommerce-terms-and-conditions-wrapper { margin-bottom: 16px; }

/* --------------------------------------------------------------------------
   My account
   -------------------------------------------------------------------------- */
.woocommerce-account .woocommerce { display: grid; grid-template-columns: 260px 1fr; gap: 64px; align-items: start; }
.woocommerce-account .woocommerce::after { content: none; }

.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; }

.woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 14px 0;
	border-bottom: 1px solid var(--elan-border);
	font-size: var(--type-body);
	color: var(--elan-ink);
}

.woocommerce-MyAccount-navigation li.is-active a { color: var(--elan-green); font-weight: 500; }
.woocommerce-MyAccount-content { min-width: 0; }
.woocommerce-MyAccount-content p { margin-bottom: 16px; }

/* Login / register sit side by side on the account page when logged out. */
.woocommerce-account:not(.logged-in) .woocommerce { grid-template-columns: 1fr; }

.woocommerce form.login,
.woocommerce form.register,
.woocommerce form.lost_reset_password {
	max-width: 520px;
	padding: 33px;
	border: 0;
	border-radius: var(--radius-xl);
	background: var(--elan-surface);
	box-shadow: var(--ring-tile);
}

.woocommerce form.login .form-row,
.woocommerce form.register .form-row { margin-bottom: 20px; }
.woocommerce .woocommerce-form-login__rememberme { margin-bottom: 16px; }
.woocommerce .lost_password { margin-top: 14px; font-size: var(--type-small); }

/* --------------------------------------------------------------------------
   Order received / order details
   -------------------------------------------------------------------------- */
.woocommerce .woocommerce-order-overview {
	display: flex;
	flex-wrap: wrap;
	gap: 33px;
	list-style: none;
	margin: 0 0 48px;
	padding: 24px 33px;
	border-radius: var(--radius-xl);
	background: var(--elan-surface);
	box-shadow: var(--ring-tile);
}

.woocommerce .woocommerce-order-overview li {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: var(--type-small);
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	color: var(--elan-ink-muted);
	border: 0;
}

.woocommerce .woocommerce-order-overview li strong {
	font-family: var(--font-display);
	font-size: var(--type-h4);
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: var(--elan-ink);
}

.woocommerce .woocommerce-column__title,
.woocommerce .woocommerce-order-details__title,
.woocommerce .woocommerce-customer-details h2 {
	font-family: var(--font-display);
	font-size: var(--type-h3);
	font-weight: 400;
	margin: 0 0 20px;
}

.woocommerce .woocommerce-columns { display: flex; flex-wrap: wrap; gap: 48px; margin-top: 48px; }
.woocommerce .woocommerce-columns .woocommerce-column { flex: 1; min-width: 260px; }
.woocommerce address { font-style: normal; line-height: 170%; }

/* --------------------------------------------------------------------------
   Responsive

   Below 900 the summary panel drops under the form; below 768 Woo's responsive
   table pattern takes over — each row becomes a stacked card whose cells are
   labelled from the th text Woo copies into data-title.
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
	.woocommerce .checkout { grid-template-columns: 1fr 400px; gap: 40px; }
	.woocommerce-cart .woocommerce { gap: 0 40px; }
	.cart-collaterals { flex-basis: 340px; }
}

@media (max-width: 899px) {
	.woocommerce .checkout { grid-template-columns: 1fr; gap: 40px; }
	.woocommerce .checkout > .woocommerce-checkout-review-order,
	.woocommerce .checkout > #order_review_heading { grid-column: 1; }
	.woocommerce .checkout > #customer_details { grid-row: auto; }
	.woocommerce #order_review { position: static; }

	/* Stacked: the summary follows the lines, with room between them. */
	.cart-collaterals { flex: 1 0 100%; margin-top: 40px; }
	.cart_totals { position: static; }

	.woocommerce-account .woocommerce { grid-template-columns: 1fr; gap: 33px; }
}

@media (max-width: 767px) {
	.woocommerce table.shop_table_responsive thead { display: none; }
	.woocommerce table.shop_table_responsive tr { display: block; padding: 20px 0; border-bottom: 1px solid var(--elan-border); }
	.woocommerce table.shop_table_responsive td { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 0; border: 0; text-align: right; }

	.woocommerce table.shop_table_responsive td::before {
		content: attr(data-title);
		font-size: var(--type-micro);
		font-weight: 700;
		letter-spacing: .06em;
		text-transform: uppercase;
		color: var(--elan-ink-muted);
	}

	/* The thumbnail and the remove control have no useful label. */
	.woocommerce table.shop_table_responsive td.product-thumbnail::before,
	.woocommerce table.shop_table_responsive td.product-remove::before { content: none; }

	/* The totals tables are already th/td label pairs, so stacking them would
	   print every row's name twice ("MEĐUZBIR MEĐUZBIR"). They stay real tables. */
	.cart_totals table.shop_table_responsive tr,
	.woocommerce #order_review table.shop_table_responsive tr { display: table-row; padding: 0; border: 0; }

	.cart_totals table.shop_table_responsive th,
	.cart_totals table.shop_table_responsive td,
	.woocommerce #order_review table.shop_table_responsive th,
	.woocommerce #order_review table.shop_table_responsive td {
		display: table-cell;
		border-bottom: 1px solid var(--elan-chip);
	}

	.cart_totals table.shop_table_responsive td,
	.woocommerce #order_review table.shop_table_responsive td { text-align: right; }

	.cart_totals table.shop_table_responsive td::before,
	.woocommerce #order_review table.shop_table_responsive td::before { content: none; }
	.woocommerce table.shop_table_responsive td.product-remove { justify-content: flex-end; }
	.woocommerce table.shop_table_responsive td.product-thumbnail { justify-content: flex-start; }
	.woocommerce table.cart .product-thumbnail img { width: 72px; height: 90px; }

	.woocommerce table.cart td.actions { display: block; }
	.woocommerce table.cart td.actions .coupon { flex-wrap: wrap; }
	.woocommerce table.cart td.actions .coupon .input-text { width: 100%; }
	.woocommerce table.cart td.actions .coupon .button,
	.woocommerce table.cart td.actions .button { width: 100%; }

	.cart_totals,
	.woocommerce #order_review,
	.woocommerce form.login,
	.woocommerce form.register { padding: 20px; }

	.woocommerce .form-row-first,
	.woocommerce .form-row-last { width: 100%; margin-right: 0; }

	.woocommerce .button,
	.woocommerce-page .button { width: 100%; }
	.woocommerce .woocommerce-message .button,
	.woocommerce .woocommerce-info .button { width: auto; margin-left: 0; }
}
