/**
 * WooCommerce Cart & Checkout Blocks Styling
 * Styles for block-based cart and checkout pages
 */

/* Cart Block Container */
.wc-block-cart {
	margin: 0 auto;
	max-width: 1200px;
	padding: 2rem 1rem;
}

/* Cart Items Table */
.wc-block-cart-items {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 2rem;
}

.wc-block-cart-items__header {
	background: #f8fafc;
	border-bottom: 2px solid #e2e8f0;
	padding: 0;
	margin: 0 0 1rem 0;
}

.wc-block-cart-items__header tr {
	background: #f8fafc;
}

.wc-block-cart-items__header-row {
	text-transform: uppercase;
	font-size: 0.875rem;
	font-weight: 600;
	color: #64748b;
}

.wc-block-cart-items__header th {
	padding: 1rem 0.75rem;
	text-align: left;
	border-bottom: 2px solid #e2e8f0;
	font-weight: 600;
	font-size: 0.875rem;
	text-transform: uppercase;
	color: #64748b;
	background: #f8fafc;
}

.wc-block-cart-items__header th span {
	display: block;
}

.wc-block-cart-items__header-image {
	width: 100px;
}

.wc-block-cart-items__header-product {
	width: auto;
}

.wc-block-cart-items__header-total {
	width: 150px;
	text-align: right;
}

.wc-block-cart-items__row {
	border-bottom: 1px solid #e2e8f0;
}

.wc-block-cart-items__row td {
	padding: 1.5rem 0.5rem;
	vertical-align: top;
}

/* Product Name & Image */
.wc-block-cart-item__image img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 8px;
}

.wc-block-components-product-name {
	font-weight: 500;
	color: #1e293b;
	text-decoration: none;
	font-size: 1rem;
	line-height: 1.5;
}

.wc-block-components-product-name:hover {
	color: #6bc9d3;
	text-decoration: underline;
}

/* Quantity Selector */
.wc-block-components-quantity-selector {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0.5rem 0;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}

.wc-block-components-quantity-selector__input {
	width: 80px;
	padding: 0.5rem 0.75rem;
	border: none;
	border-left: 1px solid #cbd5e1;
	border-right: 1px solid #cbd5e1;
	text-align: center;
	font-size: 1rem;
	font-weight: 500;
	background: #fff;
	outline: none;
	-moz-appearance: textfield;
}

.wc-block-components-quantity-selector__input::-webkit-outer-spin-button,
.wc-block-components-quantity-selector__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wc-block-components-quantity-selector__input:focus {
	border-color: #6bc9d3;
	box-shadow: 0 0 0 2px rgba(107, 201, 211, 0.1);
}

.wc-block-components-quantity-selector__button {
	padding: 0.5rem 0.75rem;
	border: none;
	background: #f8fafc;
	color: #475569;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: all 0.2s ease;
	min-width: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wc-block-components-quantity-selector__button:hover {
	background: #e2e8f0;
	color: #1e293b;
}

.wc-block-components-quantity-selector__button:active {
	background: #cbd5e1;
	transform: scale(0.95);
}

.wc-block-components-quantity-selector__button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	background: #f8fafc;
}

.wc-block-components-quantity-selector__button--minus {
	border-radius: 6px 0 0 6px;
}

.wc-block-components-quantity-selector__button--plus {
	border-radius: 0 6px 6px 0;
}

/* Product Price & Total */
.wc-block-components-product-price {
	font-weight: 500;
	color: #1e293b;
}

.wc-block-cart-item__total {
	font-weight: 600;
	color: #1e293b;
}

/* Remove Item Button */
.wc-block-cart-item__remove-link {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.5rem 1rem;
	color: #ef4444;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	border: 1px solid #fecaca;
	border-radius: 4px;
	background: #fef2f2;
	transition: all 0.2s ease;
}

.wc-block-cart-item__remove-link:hover {
	color: #dc2626;
	background: #fee2e2;
	border-color: #fca5a5;
	text-decoration: none;
}

/* Cart Totals Sidebar */
.wc-block-cart__sidebar {
	margin-top: 2rem;
}

.wc-block-cart__totals-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
	color: #1e293b;
}

.wc-block-components-totals {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 1.5rem;
}

.wc-block-components-totals__item {
	display: flex;
	justify-content: space-between;
	padding: 0.75rem 0;
	border-bottom: 1px solid #e2e8f0;
}

.wc-block-components-totals__item:last-child {
	border-bottom: none;
}

.wc-block-components-totals__label {
	font-weight: 500;
	color: #64748b;
}

.wc-block-components-totals__value {
	font-weight: 600;
	color: #1e293b;
}

.wc-block-cart__totals-button,
.wp-block-woocommerce-cart-button,
.wc-block-cart__submit-button,
.wc-block-cart__submit-button a,
.wp-block-woocommerce-cart-button a {
	width: 100%;
	padding: 1rem 2rem !important;
	margin-top: 1.5rem;
	background: #6bc9d3 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 8px !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	cursor: pointer;
	transition: background 0.2s ease;
	text-decoration: none !important;
	display: inline-block !important;
	text-align: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wc-block-cart__totals-button:hover,
.wp-block-woocommerce-cart-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-cart__submit-button a:hover,
.wp-block-woocommerce-cart-button a:hover {
	background: #5ab8c2 !important;
	color: #fff !important;
	text-decoration: none !important;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.wc-block-cart__totals-button:disabled,
.wp-block-woocommerce-cart-button:disabled,
.wc-block-cart__submit-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.wc-block-cart__totals-button:focus,
.wp-block-woocommerce-cart-button:focus,
.wc-block-cart__submit-button:focus {
	outline: 2px solid #6bc9d3;
	outline-offset: 2px;
}

/* Checkout Block Styles */
.wc-block-checkout {
	margin: 0 auto;
	max-width: 1200px;
	padding: 2rem 1rem;
}

.wc-block-checkout__main {
	display: grid;
	gap: 2rem;
}

.wc-block-checkout__order-review {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 1.5rem;
}

/* Button Styles for All Buttons */
button.wc-block-components-button,
a.wc-block-components-button,
.wc-block-components-button,
.wp-block-button__link,
.wp-block-woocommerce-cart-button,
.wc-block-cart__submit-button {
	padding: 0.75rem 1.5rem;
	border-radius: 6px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
	text-decoration: none;
	display: inline-block;
}

.wc-block-components-button--primary,
.wp-block-button__link,
.wp-block-woocommerce-cart-button a,
.wc-block-cart__submit-button {
	background: #6bc9d3 !important;
	color: #fff !important;
	border: none !important;
}

.wc-block-components-button--primary:hover,
.wp-block-button__link:hover,
.wp-block-woocommerce-cart-button a:hover,
.wc-block-cart__submit-button:hover {
	background: #5ab8c2 !important;
	color: #fff !important;
	text-decoration: none !important;
}

.wc-block-components-button--secondary {
	background: #f8fafc;
	color: #475569;
	border: 1px solid #cbd5e1;
}

.wc-block-components-button--secondary:hover {
	background: #e2e8f0;
	color: #1e293b;
}

/* Responsive */
@media (max-width: 768px) {
	.wc-block-cart-items__header {
		display: none;
	}
	
	.wc-block-cart-items__row {
		display: block;
		padding: 1rem 0;
	}
	
	.wc-block-cart-items__row td {
		display: block;
		padding: 0.5rem 0;
	}
	
	.wc-block-cart-item__image {
		text-align: center;
	}
	
	.wc-block-checkout__main {
		grid-template-columns: 1fr;
	}
	
	.wc-block-cart__sidebar {
		margin-top: 1rem;
	}
	
	.wc-block-components-quantity-selector {
		justify-content: center;
	}
}

/* Decimal Quantity Support */
.wc-block-components-quantity-selector__input[step="0.01"],
.wc-block-components-quantity-selector__input[step="0.1"],
.wc-block-components-quantity-selector__input[step="0.25"],
.wc-block-components-quantity-selector__input[step="0.5"] {
	/* Ensure decimal quantities display correctly */
	width: 100px;
}

/* Additional Button Selectors - Only target specific WooCommerce block button classes */
.wc-block-cart__submit-container .wc-block-cart__submit-button,
.wc-block-cart__submit-container button[type="submit"],
.wp-block-woocommerce-cart-button-wrapper .wp-block-woocommerce-cart-button,
.wp-block-woocommerce-cart-button-wrapper button,
.wc-block-cart__totals-wrapper .wc-block-cart__totals-button,
.wc-block-cart__totals-wrapper button {
	background: #6bc9d3 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 1rem 2rem !important;
	font-weight: 600 !important;
	font-size: 1rem !important;
	text-decoration: none !important;
	display: inline-block !important;
	width: 100% !important;
	text-align: center !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
	transition: all 0.2s ease !important;
}

.wc-block-cart__submit-container .wc-block-cart__submit-button:hover,
.wc-block-cart__submit-container button[type="submit"]:hover,
.wp-block-woocommerce-cart-button-wrapper .wp-block-woocommerce-cart-button:hover,
.wp-block-woocommerce-cart-button-wrapper button:hover,
.wc-block-cart__totals-wrapper .wc-block-cart__totals-button:hover,
.wc-block-cart__totals-wrapper button:hover {
	background: #5ab8c2 !important;
	color: #fff !important;
	text-decoration: none !important;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important;
}

/* Exclude admin bar from button styling */
#wpadminbar a,
#wpadminbar a.ab-item,
#wpadminbar li a {
	background: transparent !important;
	color: inherit !important;
	border: none !important;
	border-radius: 0 !important;
	padding: inherit !important;
	font-weight: inherit !important;
	font-size: inherit !important;
	text-decoration: inherit !important;
	display: inherit !important;
	width: auto !important;
	text-align: inherit !important;
	box-shadow: none !important;
	margin: 0 !important;
}

/* Ensure buttons in cart totals sidebar are styled (only WooCommerce block buttons) */
.wc-block-cart__sidebar .wp-block-button__link,
.wc-block-cart__sidebar button[type="submit"],
.wc-block-cart__sidebar .wc-block-cart__totals-button {
	background: #6bc9d3 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 1rem 2rem !important;
	font-weight: 600 !important;
	font-size: 1rem !important;
	text-decoration: none !important;
	display: block !important;
	width: 100% !important;
	text-align: center !important;
	margin-top: 1.5rem !important;
	cursor: pointer !important;
}

.wc-block-cart__sidebar .wp-block-button__link:hover,
.wc-block-cart__sidebar button[type="submit"]:hover,
.wc-block-cart__sidebar .wc-block-cart__totals-button:hover {
	background: #5ab8c2 !important;
	color: #fff !important;
	text-decoration: none !important;
}

/* Hide product description/metadata in cart */
.wc-block-cart .wc-block-components-product-metadata__description,
.wc-block-cart-items .wc-block-components-product-metadata__description {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	overflow: hidden !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Also hide the entire metadata container if it only contains description */
.wc-block-cart .wc-block-components-product-metadata:has(.wc-block-components-product-metadata__description:only-child),
.wc-block-cart-items .wc-block-components-product-metadata:has(.wc-block-components-product-metadata__description:only-child) {
	display: none !important;
}

/* Remove border-top from cart container */
div.wp-block-woocommerce-cart.alignwide {
	border-top: none !important;
}

/* Remove border-top from cart items in container query */
@container (min-width: 700px) {
	.wc-block-cart__main .wc-block-cart-items td {
		border-top: none !important;
	}
}
