/**
 * Cart Page Styles
 *
 * Custom styles for the WooCommerce cart page.
 *
 * @package Codeyweb
 */

/* ============================================================
   CSS Custom Properties (shared with product page)
   ============================================================ */
:root {
	--cw-primary: #0c7489;
	--cw-primary-dark: #0c2d3a;
	--cw-primary-light: #14a3c7;
	--cw-dark: #0c2d3a;
	--cw-text: #333333;
	--cw-text-light: #666666;
	--cw-text-muted: #999999;
	--cw-border: #e5e7eb;
	--cw-bg-light: #f8f9fa;
	--cw-bg-page: #f3f4f6;
	--cw-white: #ffffff;
	--cw-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
	--cw-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
	--cw-radius: 8px;
	--cw-radius-lg: 12px;
	--cw-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   CART PAGE WRAPPER
   ============================================================ */
.cw-cart-page {
	font-family: var(--cw-font);
	color: var(--cw-text);
	max-width: 1200px;
	margin: 0 auto;
	padding: 50px 40px 80px;
}

.cw-cart-page *,
.cw-cart-page *::before,
.cw-cart-page *::after {
	box-sizing: border-box;
}

.cw-cart-page__title {
	font-size: 34px;
	font-weight: 800;
	color: var(--cw-dark);
	margin: 0 0 36px;
	letter-spacing: -0.5px;
}

/* ============================================================
   CART LAYOUT — Two Columns
   ============================================================ */
.cw-cart-layout {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: 40px;
	align-items: start;
}

/* ============================================================
   CART ITEMS COLUMN
   ============================================================ */
.cw-cart-items-col {
	min-width: 0;
}

.cw-cart-items {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* ============================================================
   SINGLE CART ITEM CARD
   ============================================================ */
.cw-cart-item {
	display: flex;
	gap: 20px;
	background: var(--cw-white);
	border: 1px solid var(--cw-border);
	border-radius: var(--cw-radius-lg);
	padding: 20px;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cw-cart-item:hover {
	border-color: #d1d5db;
	box-shadow: var(--cw-shadow-sm);
}

/* Item Image */
.cw-cart-item__image {
	flex-shrink: 0;
	width: 100px;
	height: 100px;
	border-radius: var(--cw-radius);
	overflow: hidden;
}

.cw-cart-item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cw-cart-item__image a {
	display: block;
	width: 100%;
	height: 100%;
}

/* Item Info */
.cw-cart-item__info {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
}

.cw-cart-item__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.cw-cart-item__details {
	min-width: 0;
}

.cw-cart-item__name {
	font-size: 16px;
	font-weight: 700;
	color: var(--cw-dark);
	margin: 0 0 4px;
	line-height: 1.3;
}

.cw-cart-item__name a {
	color: inherit;
	text-decoration: none;
}

.cw-cart-item__name a:hover {
	color: var(--cw-primary);
}

/* Booking meta (date, resources, persons) rendered via wc_get_formatted_cart_item_data */
.cw-cart-item__meta {
	margin: 4px 0 6px;
	padding: 0;
}
/* WC wraps everything in a <dl class="variation"> */
.cw-cart-item__meta dl {
	margin: 0;
	padding: 0;
}
/* Each dt+dd pair on one row */
.cw-cart-item__meta dt,
.cw-cart-item__meta dd {
	display: inline;
	margin: 0;
	padding: 0;
}
.cw-cart-item__meta dt {
	font-size: 12px;
	font-weight: 600;
	color: var(--cw-text-muted);
}
/* WC puts a colon inside the dt text — no ::after needed */
.cw-cart-item__meta dd {
	font-size: 12px;
	color: var(--cw-text-light);
	margin-left: 4px;
}
/* WC wraps dd content in a <p> — strip its spacing */
.cw-cart-item__meta dd p {
	display: inline;
	margin: 0;
}
/* Line break between each dt/dd pair */
.cw-cart-item__meta dl::before,
.cw-cart-item__meta dd::after {
	content: '';
	display: block;
}

.cw-cart-item__unit-price {
	font-size: 13px;
	color: var(--cw-text-light);
	margin: 0;
}

/* Remove Button */
.cw-cart-item__remove {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	color: var(--cw-text-muted);
	cursor: pointer;
	border-radius: 6px;
	transition: all 0.2s ease;
	padding: 0;
}

.cw-cart-item__remove:hover {
	background-color: #fef2f2;
	color: #ef4444;
}

/* Item Footer */
.cw-cart-item__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 14px;
}

/* ============================================================
   CART QUANTITY STEPPER
   ============================================================ */
.cw-cart-qty-stepper {
	display: flex;
	align-items: center;
	border: 1px solid var(--cw-border);
	border-radius: 6px;
	overflow: hidden;
}

.cw-cart-qty-btn {
	width: 36px;
	height: 36px;
	border: none;
	background: var(--cw-white);
	color: var(--cw-text);
	font-size: 18px;
	font-weight: 500;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease;
	padding: 0;
	line-height: 1;
}

.cw-cart-qty-btn:hover {
	background-color: var(--cw-bg-light);
}

.cw-cart-qty-stepper input[type="number"] {
	width: 40px;
	height: 36px;
	text-align: center;
	border: none;
	border-left: 1px solid var(--cw-border);
	border-right: 1px solid var(--cw-border);
	font-size: 14px;
	font-weight: 600;
	font-family: var(--cw-font);
	color: var(--cw-text);
	background: var(--cw-bg-light);
	-moz-appearance: textfield;
	appearance: textfield;
	padding: 0;
	margin: 0;
}

.cw-cart-qty-stepper input[type="number"]::-webkit-outer-spin-button,
.cw-cart-qty-stepper input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Line Total */
.cw-cart-item__total {
	font-size: 20px;
	font-weight: 700;
	color: var(--cw-dark);
	white-space: nowrap;
}

/* ============================================================
   BOTTOM LINKS
   ============================================================ */
.cw-cart-bottom-links {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 24px;
	padding-top: 0;
}

.cw-cart-link {
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	font-family: var(--cw-font);
}

.cw-cart-link--continue {
	color: var(--cw-primary);
}

.cw-cart-link--continue:hover {
	color: var(--cw-primary-dark);
}

.cw-cart-link--clear {
	color: var(--cw-text-muted);
}

.cw-cart-link--clear:hover {
	color: #ef4444;
}

/* ============================================================
   ORDER SUMMARY
   ============================================================ */
.cw-cart-summary-col {
	position: sticky;
	top: 100px;
}

.cw-order-summary {
	background: var(--cw-white);
	border: 1px solid var(--cw-border);
	border-radius: var(--cw-radius-lg);
	padding: 28px;
	box-shadow: var(--cw-shadow);
}

.cw-order-summary__title {
	font-size: 22px;
	font-weight: 800;
	color: var(--cw-dark);
	margin: 0 0 20px;
}

/* Summary Line Items */
.cw-order-summary__items {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--cw-border);
	margin-bottom: 18px;
}

.cw-order-summary__item {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
}

.cw-order-summary__item-name {
	font-size: 14px;
	color: var(--cw-text-light);
	flex: 1;
	min-width: 0;
}

.cw-order-summary__item-price {
	font-size: 14px;
	font-weight: 600;
	color: var(--cw-text);
	white-space: nowrap;
}

/* Summary Total */
.cw-order-summary__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 4px;
	margin-bottom: 24px;
}

.cw-order-summary__total-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	color: var(--cw-text-muted);
}

.cw-order-summary__total-amount {
	font-size: 26px;
	font-weight: 800;
	color: var(--cw-dark);
}

/* Checkout Buttons */
.cw-order-summary__checkout .wc-proceed-to-checkout {
	margin: 0;
	padding: 0;
}

.cw-order-summary__checkout .checkout-button,
.cw-order-summary__checkout .wc-proceed-to-checkout .checkout-button {
	display: block;
	width: 100%;
	padding: 14px;
	background-color: var(--cw-primary);
	color: #ffffff !important;
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	border: none;
	border-radius: var(--cw-radius);
	cursor: pointer;
	transition: all 0.3s ease;
	font-family: var(--cw-font);
	text-decoration: none;
	margin-bottom: 10px;
}

.cw-order-summary__checkout .checkout-button:hover {
	background-color: var(--cw-primary-dark);
}

/* Override WC default button class inside our summary */
.cw-order-summary .wc-proceed-to-checkout a.checkout-button {
	display: block;
	width: 100%;
	padding: 14px;
	background-color: var(--cw-primary) !important;
	color: #ffffff !important;
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	border: none !important;
	border-radius: var(--cw-radius);
	margin-bottom: 10px;
	text-decoration: none;
}

.cw-order-summary .wc-proceed-to-checkout a.checkout-button:hover {
	background-color: var(--cw-primary-dark) !important;
}

/* WhatsApp */
.cw-order-summary__whatsapp {
	text-align: center;
	margin-top: 16px;
}

.cw-order-summary__whatsapp p {
	font-size: 13px;
	color: var(--cw-text-muted);
	margin: 0;
}

.cw-order-summary__whatsapp a {
	color: var(--cw-primary);
	text-decoration: none;
	font-weight: 500;
}

.cw-order-summary__whatsapp a:hover {
	text-decoration: underline;
}

/* ============================================================
   CART EMPTY STATE
   ============================================================ */
.cw-cart-page .cart-empty {
	text-align: center;
	padding: 60px 20px;
	font-size: 16px;
	color: var(--cw-text-light);
}

.cw-cart-page .return-to-shop a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background-color: var(--cw-primary);
	color: #ffffff;
	text-decoration: none;
	border-radius: var(--cw-radius);
	font-weight: 600;
	font-size: 14px;
	transition: all 0.3s ease;
}

.cw-cart-page .return-to-shop a:hover {
	background-color: var(--cw-primary-dark);
}

/* ============================================================
   HIDE DEFAULT WC ELEMENTS
   ============================================================ */
.cw-cart-page .shop_table,
.cw-cart-page table.shop_table,
.cw-cart-page .cart_totals > h2,
.cw-cart-page .cart_totals > table,
.cw-cart-page .cart_totals .wc-proceed-to-checkout {
	display: none !important;
}

/* Hide default cart totals wrapper when our custom one is present */
.cw-cart-page .cart_totals {
	display: none !important;
}

/* Show our custom summary */
.cw-cart-page .cw-order-summary {
	display: block !important;
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.cw-cart-item.cw-loading {
	opacity: 0.5;
	pointer-events: none;
}

.cw-cart-page.cw-refreshing .cw-cart-items {
	opacity: 0.5;
	pointer-events: none;
}
.cw-cart-item__meta .dl.variation dd {
	margin-right: 0px !important;
}
/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
	.cw-cart-layout {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.cw-cart-summary-col {
		position: static;
	}
}

@media (max-width: 768px) {
	.cw-cart-page {
		padding: 30px 20px 60px;
	}

	.cw-cart-page__title {
		font-size: 28px;
	}

	.cw-cart-item {
		padding: 16px;
		gap: 14px;
	}

	.cw-cart-item__image {
		width: 80px;
		height: 80px;
	}

	.cw-cart-item__total {
		font-size: 17px;
	}

	.cw-order-summary {
		padding: 22px;
	}

	.cw-order-summary__total-amount {
		font-size: 22px;
	}
}

@media (max-width: 480px) {
	.cw-cart-item {
		flex-direction: column;
		align-items: flex-start;
	}

	.cw-cart-item__image {
		width: 100%;
		height: 160px;
	}

	.cw-cart-item__footer {
		width: 100%;
	}
}

/* ============================================================
   CROSS-SELL HIDE (we don't show cross-sells on custom cart)
   ============================================================ */
.cw-cart-page .cross-sells {
	display: none;
}
