/**
 * FramesGrace Checkout & Cart Custom Styles
 * Modern design with enhanced UX
 */

/* ============================================
   EMPTY CART STYLES
   ============================================ */

.framesgrace-empty-cart {
	padding: 80px 20px;
	min-height: 60vh;
	display: flex;
	align-items: center;
}

.empty-cart-icon {
	color: #ddd;
	opacity: 0.5;
}

.empty-cart-icon svg {
	width: 120px;
	height: 120px;
	max-width: 100%;
}

.empty-cart-title {
	color: #333;
	margin-bottom: 20px;
}

.empty-cart-text {
	color: #666;
	margin-bottom: 40px;
}

.return-to-shop .button {
	padding: 14px 40px;
	font-weight: 600;
	border-radius: 6px;
	transition: all 0.3s ease;
	display: inline-block;
}

.return-to-shop .button:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   CHECKOUT PAGE STYLES
   ============================================ */

/* Checkout wrapper - uses theme defaults */
.framesgrace-checkout-wrapper {
	padding: 0;
}

/* Checkout - Full Width and Vertical Stacking */
.framesgrace-checkout-wrapper .checkout-order-section,
.framesgrace-checkout-wrapper .checkout-billing-section,
.framesgrace-checkout-wrapper .checkout-payment-section,
.woocommerce-checkout .checkout-order-section,
.woocommerce-checkout .checkout-billing-section,
.woocommerce-checkout .checkout-payment-section {
	width: 100% !important;
	max-width: 100% !important;
	margin-bottom: 40px;
	display: block !important;
	clear: both !important;
}

.framesgrace-checkout-wrapper .shopCart-sidebar,
.woocommerce-checkout .shopCart-sidebar {
	width: 100% !important;
	max-width: 100% !important;
}

/* Override Bootstrap grid for checkout form */
.woocommerce-checkout form.checkout.row {
	display: block !important;
}

.woocommerce-checkout form.checkout .col-lg,
.woocommerce-checkout form.checkout .col-lg-auto {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	display: block !important;
}

/* Override any grid layout from additional CSS */
.woocommerce-checkout form.checkout {
	display: block !important;
	grid-template-columns: none !important;
	gap: 0 !important;
}

.woocommerce-checkout .checkout-order-section,
.woocommerce-checkout .checkout-billing-section,
.woocommerce-checkout .checkout-payment-section {
	grid-column: auto !important;
	grid-row: auto !important;
}

.framesgrace-checkout-wrapper #order_review,
.framesgrace-checkout-wrapper .woocommerce-checkout-review-order {
	width: 100% !important;
	max-width: 100% !important;
}

/* Removed card styling for open layout */
.checkout-details-card,
.checkout-order-card {
	border: none;
	background: transparent;
	padding: 0;
	box-shadow: none;
}

/* Section titles use theme defaults */

/* Hide "Ship to a different address" checkbox */
#ship-to-different-address-checkbox,
.woocommerce-shipping-fields,
.woocommerce-shipping-fields__field-wrapper,
label[for="ship-to-different-address-checkbox"] {
	display: none !important;
}

/* Checkout Form Fields */
.woocommerce-checkout #customer_details .form-row {
	margin-bottom: 20px;
}

.woocommerce-checkout #customer_details label {
	font-weight: 600;
	color: #333;
	margin-bottom: 8px;
	display: block;
	font-size: 14px;
}

.woocommerce-checkout #customer_details input[type="text"],
.woocommerce-checkout #customer_details input[type="email"],
.woocommerce-checkout #customer_details input[type="tel"],
.woocommerce-checkout #customer_details input[type="password"],
.woocommerce-checkout #customer_details select,
.woocommerce-checkout #customer_details textarea {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	transition: border-color 0.3s ease;
}

.woocommerce-checkout #customer_details input:focus,
.woocommerce-checkout #customer_details select:focus,
.woocommerce-checkout #customer_details textarea:focus {
	outline: none;
	border-color: #007bff;
	box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Order Review Section - uses theme defaults */

.woocommerce-checkout-review-order-table {
	width: 100%;
	margin-bottom: 20px;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
	padding: 12px 0;
	border-bottom: 1px solid #eee;
}

.woocommerce-checkout-review-order-table th {
	font-weight: 600;
	color: #333;
	text-align: left;
}

.woocommerce-checkout-review-order-table .cart-subtotal,
.woocommerce-checkout-review-order-table .order-total {
	font-weight: 600;
}

.woocommerce-checkout-review-order-table .order-total {
	font-size: 18px;
	color: #007bff;
	border-top: 2px solid #eee;
	padding-top: 15px;
}

/* Payment Methods */
.wc_payment_methods {
	list-style: none;
	padding: 0;
	margin: 20px 0;
}

.wc_payment_methods li {
	margin-bottom: 15px;
	/* Removed border and background for cleaner look */
	border: none;
	border-radius: 0;
	padding: 10px 0;
	background: transparent;
	transition: none;
}

/* Payment method hover - uses theme defaults */

.wc_payment_methods label {
	cursor: pointer;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 10px;
}

.wc_payment_methods input[type="radio"] {
	margin-right: 10px;
}

/* Place Order Button */
#place_order {
	width: 100%;
	padding: 16px 30px;
	font-size: 16px;
	font-weight: 600;
	background-color: #007bff;
	border: none;
	color: #fff;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	margin-top: 20px;
}

#place_order:hover {
	background-color: #0056b3;
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

#place_order:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* ============================================
   CART PAGE STYLES
   ============================================ */

.framesgrace-cart-header,
.framesgrace-cart-footer {
	/* Removed for cleaner layout */
	display: none;
}

/* Cart layout - stacked vertically */
.framesgrace-cart .row {
	margin-bottom: 40px;
}

.framesgrace-cart .col-12:first-child {
	margin-bottom: 40px;
}

/* Cart Table Improvements */
.woocommerce-cart-form__contents {
	border-collapse: separate;
	border-spacing: 0;
	/* Use theme defaults */
}

/* Product images - thumbnail size */
.framesgrace-cart .product-image img,
.framesgrace-cart .product-info img {
	width: 80px !important;
	height: 80px !important;
	object-fit: cover;
	max-width: 80px !important;
}

.framesgrace-cart .product-image {
	display: inline-block;
	margin-right: 15px;
	flex-shrink: 0;
}

.woocommerce-cart-form__contents thead th {
	background-color: #f8f9fa;
	font-weight: 600;
	color: #333;
	padding: 15px;
	border-bottom: 2px solid #dee2e6;
}

.woocommerce-cart-form__contents tbody td {
	padding: 20px 15px;
	vertical-align: middle;
	border-bottom: 1px solid #eee;
}

.woocommerce-cart-form__contents .product-remove a {
	color: #dc3545;
	font-size: 20px;
	text-decoration: none;
	transition: color 0.3s ease;
}

.woocommerce-cart-form__contents .product-remove a:hover {
	color: #c82333;
}


.woocommerce-cart-form__contents .product-name .product-price,
.woocommerce-cart-form__contents .product-subtotal {
	font-weight: 600;
	display: flex;
	width: 80px;
	color: #333;
}

/* Quantity Input */
.quantity input[type="number"] {
	width: 80px;
	padding: 8px;
	text-align: center;
	border: 1px solid #ddd;
	border-radius: 4px;
}

/* Cart Totals - Full Width */
.framesgrace-cart .shopCart-sidebar,
.framesgrace-cart .cart-collaterals {
	width: 100% !important;
	max-width: 100% !important;
}

.cart_totals {
	/* Removed background and borders - use theme defaults */
	background: transparent;
	padding: 0;
	border-radius: 0;
	border: none;
	width: 100% !important;
	max-width: 100% !important;
}

/* Cart totals heading - uses theme defaults */

.cart_totals table {
	width: 100%;
	margin-bottom: 20px;
}

.cart_totals table th,
.cart_totals table td {
	border-bottom: 1px solid #dee2e6;
}

.cart_totals table .order-total {
	border-top: 2px solid #dee2e6;
	font-size: 18px;
	font-weight: 700;
	color: #007bff;
}

/* Checkout Button */
.wc-proceed-to-checkout {
	margin-top: 20px;
}

.wc-proceed-to-checkout .checkout-button {
	width: 100%;
	padding: 16px 30px;
	font-size: 16px;
	font-weight: 600;
	background-color: #007bff;
	border: none;
	color: #fff;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: block;
	text-align: center;
}

.wc-proceed-to-checkout .checkout-button:hover {
	background-color: #0056b3;
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
	color: #fff;
	text-decoration: none;
}

/* Coupon Section in Cart Totals */
.cart-coupon-section {
	padding: 20px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	margin-bottom: 30px;
	background-color: #f8f9fa;
}

.cart-coupon-title {
	font-size: 18px;
	font-weight: 600;
	color: #333;
	margin-bottom: 15px;
}

.cart-coupon-form .coupon {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.cart-coupon-form .coupon input[type="text"] {
	flex: 1;
	min-width: 200px;
	padding: 12px 16px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
}

.cart-coupon-form .coupon .button {
	padding: 12px 24px;
	white-space: nowrap;
}

/* Coupon Section in Table (if still present) */
.woocommerce-cart-form .coupon {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.woocommerce-cart-form .coupon input[type="text"] {
	flex: 1;
	min-width: 200px;
	padding: 12px 16px;
	border: 1px solid #ddd;
	border-radius: 6px;
}

.woocommerce-cart-form .coupon .button {
	padding: 12px 24px;
	white-space: nowrap;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 991px) {
	.checkout-order-card {
		position: static;
		margin-top: 30px;
	}
	
	.framesgrace-checkout-wrapper .col-lg-7,
	.framesgrace-checkout-wrapper .col-lg-5 {
		margin-bottom: 30px;
	}
	
	.woocommerce-cart-form__contents {
		font-size: 14px;
	}
	
	.woocommerce-cart-form__contents thead th,
	.woocommerce-cart-form__contents tbody td {
		padding: 12px 8px;
	}
}

@media (max-width: 767px) {
	.framesgrace-empty-cart {
		padding: 40px 20px;
	}
	
	.empty-cart-icon svg {
		width: 80px;
		height: 80px;
	}
	
	.woocommerce-cart-form__contents thead {
		display: none;
	}
	
	.woocommerce-cart-form__contents tbody td {
		display: block;
		padding: 10px 0;
		text-align: left;
	}
	
	.woocommerce-cart-form__contents tbody td::before {
		content: attr(data-title) ": ";
		font-weight: 600;
		margin-right: 10px;
	}
	
	.coupon {
		flex-direction: column;
	}
	
	.coupon input[type="text"],
	.coupon .button {
		width: 100%;
	}
}

/* ============================================
   LOADING STATES
   ============================================ */

.framesgrace-loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}

.framesgrace-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #007bff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}
