/* =====================================================================
   A&A Fence — Cart block (woocommerce/cart) tweaks.
   ===================================================================== */

:root {
	--aafc-accent: #8F775E;
	--aafc-accent-soft: #f3eee8;
	--aafc-grp-border: #e7ddcd;
	--aafc-ink: #1f2937;
	--aafc-danger: #d92d20;
	--aafc-divider: #f0f1f3;
}

/* Hide express payment buttons + the "Or" separator on the cart. */
.wc-block-cart__payment-options { display: none !important; }

/* Hide the "Shipping will be calculated at checkout" note. */
.wc-block-components-totals-footer-item-shipping { display: none !important; }

/* (1) Product title was inheriting a near-white link color — force readable ink. */
.wc-block-cart-item__product .wc-block-components-product-name { color: var(--aafc-ink) !important; }

/* (2) Wider quantity selector so up to 6 digits are visible. */
.wc-block-components-quantity-selector { width: 150px !important; max-width: 150px !important; }
.wc-block-components-quantity-selector__input { width: auto !important; min-width: 0 !important; }

/* (5) Light image border + 4px radius. */
.wc-block-cart-item__image img {
	border: 1px solid #e5e7eb !important;
	border-radius: 4px !important;
}

/* The group header conveys the fence, so hide the per-item "Fence:" line. */
.wc-block-cart-items__row .wc-block-components-product-details__fence { display: none !important; }

/* Brand the Proceed to Checkout button. */
.wc-block-cart__submit-button { background: var(--aafc-accent) !important; }

/* (3) Grouped boxes — a full border around each fence group, lighter dividers
   between items (header rows injected by cart.js). */
table.wc-block-cart-items {
	width: 100% !important;             /* ensure cells reach the right edge */
	border-collapse: separate !important;
	border-spacing: 0 !important;
}
.wc-block-cart-items__row > td { border: 0 !important; }

/* Spacer row between consecutive group boxes. */
tr.aafc-cart-group-gap > td { height: 16px; padding: 0 !important; border: 0 !important; background: transparent !important; }

/* Group header = top of the box (tinted like the checkout). */
table.wc-block-cart-items tr.aafc-cart-group-head > td {
	padding: 9px 14px !important;
	background-color: #f3eee8 !important; /* --aafc-accent-soft */
	border: 1px solid var(--aafc-grp-border) !important;
	border-bottom: 0 !important;
	border-radius: 8px 8px 0 0;
}
tr.aafc-cart-group-head > td span {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--aafc-accent);
}

/* Group item rows — side borders pinned to the real edge cells (image = left,
   total = right) so the box doesn't crop short of the totals column. Light
   inner dividers; last row closes the box. */
tr.aafc-grp > .wc-block-cart-item__image { border-left: 1px solid var(--aafc-grp-border) !important; }
tr.aafc-grp > .wc-block-cart-item__total { border-right: 1px solid var(--aafc-grp-border) !important; }
tr.aafc-grp:not(.aafc-grp--last) > td { border-bottom: 1px solid var(--aafc-divider) !important; }
tr.aafc-grp--last > td { border-bottom: 1px solid var(--aafc-grp-border) !important; }
tr.aafc-grp--last > .wc-block-cart-item__image { border-bottom-left-radius: 8px; }
tr.aafc-grp--last > .wc-block-cart-item__total { border-bottom-right-radius: 8px; }

/* (4) Delete confirmation dialog. */
.aafc-confirm-overlay {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(16, 24, 40, 0.5);
}
.aafc-confirm-overlay.is-open { display: flex; }
.aafc-confirm {
	width: 90%;
	max-width: 360px;
	padding: 22px;
	background: #fff;
	border-radius: 10px;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.aafc-confirm__msg { margin: 0 0 18px; font-size: 16px; font-weight: 600; color: var(--aafc-ink); }
.aafc-confirm__actions { display: flex; gap: 10px; justify-content: center; }
.aafc-confirm__no, .aafc-confirm__yes {
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 6px;
	border: 1px solid;
	cursor: pointer;
}
/* !important guards against the theme restyling the buttons on hover. */
.aafc-confirm__no { background: #fff !important; color: var(--aafc-ink) !important; border-color: #d0d5dd !important; }
.aafc-confirm__no:hover { background: #fff !important; color: var(--aafc-ink) !important; border-color: var(--aafc-ink) !important; }
.aafc-confirm__yes { background: var(--aafc-danger) !important; color: #fff !important; border-color: var(--aafc-danger) !important; }
.aafc-confirm__yes:hover { filter: brightness(0.95); }


@media (min-width: 700px) {
    .wc-block-cart__main .wc-block-cart-items {
		border: 0 !important; /* outer border is redundant with the group boxes */
	}
}
@media (max-width: 740px) {
    .wc-block-cart-items__row {
		padding: 8px !important;
	}
}