/**
 * Cart Share Customer Styles
 *
 * Frontend styles for customer-facing shared cart views.
 *
 * @package QW\Enhancements\CartShare
 * @since 1.1.0
 */

/* ==========================================================================
   Shared Carts List
   ========================================================================== */

.qw-shared-carts-intro {
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: #f8f9fa;
	border-left: 3px solid #2c3e50;
	border-radius: 4px;
}

.qw-shared-carts-table .qw-created-by {
	color: #666;
	font-style: italic;
}

.qw-shared-carts-table .qw-expired-date {
	color: #e74c3c;
	font-weight: 600;
}

/* Status badges */
.qw-cart-status-badge {
	display: inline-block;
	padding: 0.3rem 0.75rem;
	border-radius: 20px;
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.qw-status-active {
	background-color: #d4edda;
	color: #155724;
}

.qw-status-expired {
	background-color: #f8d7da;
	color: #721c24;
}

.qw-status-accessed {
	background-color: #d1ecf1;
	color: #0c5460;
}

.qw-status-deactivated {
	background-color: #e2e3e5;
	color: #383d41;
}

.qw-status-purchased {
	background-color: #cfe2ff;
	color: #084298;
}

.qw-shared-carts-table .qw-cart-row td {
	padding: 12px !important;
}

.qw-shared-carts-table .qw-cart-row td:first-child {
	padding-inline-start: 16px !important;
}

.qw-shared-carts-table .qw-cart-row td:last-child {
	padding-inline-end: 16px !important;
}

.qw-cart-row.qw-cart-status-expired {
	opacity: 0.7;
}

.qw-cart-row.qw-cart-status-purchased {
	background-color: #f8f9ff;
}

/* Action buttons */
.qw-shared-carts-table .woocommerce-button {
	margin: 0.25rem 0.25rem 0 0;
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
}

.qw-shared-carts-table .qw-add-to-cart {
	background-color: #27ae60;
	color: #fff !important;
	border-color: #27ae60;
}

.qw-shared-carts-table .qw-add-to-cart:hover {
	background-color: #229954;
	border-color: #229954;
}

/* ==========================================================================
   Cart Details Page
   ========================================================================== */

.qw-cart-details-page {
	max-width: 1000px;
}

.qw-cart-details-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 2px solid #e5e5e5;
}

.qw-cart-details-header h2 {
	margin: 0;
}

/* Meta information grid */
.qw-cart-meta-info {
	margin-bottom: 2rem;
	padding: 1.5rem;
	background: #f8f9fa;
	border-radius: 8px;
	border: 1px solid #e5e5e5;
}

.qw-cart-meta-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1.25rem;
	margin-bottom: 1.5rem;
}

.qw-meta-item {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.qw-meta-label {
	font-weight: 600;
	color: #555;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.qw-meta-value {
	font-size: 1rem;
	color: #333;
}

.qw-meta-value .qw-expired-date {
	color: #e74c3c;
	font-weight: 600;
}

/* Notice/Info box */
.qw-cart-meta-notice {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1rem;
	background: #fff;
	border: 1px solid #3498db;
	border-left: 4px solid #3498db;
	border-radius: 4px;
	color: #2c3e50;
}

.qw-cart-meta-notice svg {
	flex-shrink: 0;
	margin-top: 0.15rem;
	color: #3498db;
}

/* Products list */
.qw-cart-products {
	margin-top: 2rem;
}

.qw-cart-products h3 {
	margin-bottom: 1.5rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid #e5e5e5;
}

.qw-products-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.qw-product-item {
	display: flex;
	gap: 1.25rem;
	padding: 1.5rem;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	transition: box-shadow 0.2s ease;
}

.qw-product-item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.qw-product-image {
	flex-shrink: 0;
	width: 100px;
	height: 100px;
	overflow: hidden;
	border-radius: 6px;
	border: 1px solid #e5e5e5;
}

.qw-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.qw-product-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.qw-product-name {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: #2c3e50;
}

.qw-product-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	font-size: 0.9rem;
	color: #666;
}

.qw-product-quantity {
	font-weight: 600;
}

.qw-product-variation {
	font-style: italic;
}

/* Booking and subscription details */
.qw-booking-details,
.qw-subscription-details {
	padding: 0.875rem;
	background: #f0f8ff;
	border-left: 3px solid #3498db;
	border-radius: 4px;
	font-size: 0.9rem;
}

.qw-booking-header,
.qw-subscription-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
	font-weight: 600;
	color: #2c3e50;
}

.qw-booking-header svg,
.qw-subscription-header svg {
	flex-shrink: 0;
	color: #3498db;
}

.qw-booking-info {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin-top: 0.5rem;
}

.qw-booking-item {
	display: flex;
	gap: 0.5rem;
}

.qw-booking-label {
	font-weight: 600;
	color: #555;
}

.qw-booking-value {
	color: #333;
}

.qw-subscription-info {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin-top: 0.5rem;
	line-height: 1.6;
}

.qw-product-price {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.5rem;
	padding-top: 0.75rem;
	border-top: 1px solid #e5e5e5;
}

.qw-price-label {
	color: #666;
	font-weight: 600;
}

.qw-product-price strong {
	font-size: 1.125rem;
	color: #27ae60;
}

/* Cart totals */
.qw-cart-totals {
	margin-top: 2rem;
	padding: 1.5rem;
	background: #f8f9fa;
	border-radius: 8px;
	border: 1px solid #e5e5e5;
}

.qw-total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.75rem 0;
	border-bottom: 1px solid #e0e0e0;
}

.qw-total-row:last-child {
	border-bottom: none;
}

.qw-grand-total {
	margin-top: 0.5rem;
	padding-top: 1rem;
	border-top: 2px solid #2c3e50;
	font-size: 1.25rem;
}

.qw-total-label {
	font-weight: 600;
	color: #555;
}

.qw-grand-total .qw-total-label,
.qw-grand-total .qw-total-value {
	color: #2c3e50;
	font-weight: 700;
}

.qw-grand-total .qw-total-value {
	color: #27ae60;
}

/* Subscription totals styling */
.qw-subscription-totals {
	margin-top: 1rem;
	padding-top: 1rem;
}

.qw-subscription-row .qw-total-label {
	font-size: 1.1rem;
	color: #2c3e50;
}

.qw-due-today {
	color: #2c3e50 !important;
	font-size: 1.25rem;
}

.qw-subscription-detail {
	padding: 0.5rem 0;
	border-bottom: 1px dashed #e0e0e0;
	font-size: 0.95rem;
}

.qw-subscription-detail .qw-total-label {
	font-weight: 400;
	color: #777;
}

.qw-indent {
	padding-left: 1.5rem;
	position: relative;
}

.qw-indent::before {
	content: "↳";
	position: absolute;
	left: 0.5rem;
	color: #999;
}

.qw-recurring-total {
	margin-top: 0.5rem;
	padding-top: 1rem;
	font-size: 1.1rem;
}

.qw-recurring-total .qw-total-label {
	color: #2c3e50;
}

.qw-recurring-amount {
	color: #3498db !important;
	font-size: 1.25rem;
}

.qw-subscription-notice {
	margin-top: 1rem;
	padding: 0.75rem;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	text-align: center;
}

.qw-subscription-notice small {
	color: #856404;
	font-size: 0.9rem;
}

/* Cart actions */
.qw-cart-actions {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 2px solid #e5e5e5;
	text-align: center;
}

.qw-add-to-cart-btn {
	display: inline-block;
	padding: 1rem 2.5rem;
	font-size: 1.125rem;
	font-weight: 600;
	background-color: #27ae60;
	border-color: #27ae60;
	color: #fff !important;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.qw-add-to-cart-btn:hover {
	background-color: #229954;
	border-color: #229954;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.qw-no-items {
	padding: 2rem;
	text-align: center;
	color: #666;
	font-style: italic;
	background: #f8f9fa;
	border-radius: 8px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
	.qw-cart-details-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}

	.qw-cart-meta-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.qw-product-item {
		flex-direction: column;
	}

	.qw-product-image {
		width: 100%;
		height: 200px;
	}

	.qw-product-meta {
		flex-direction: column;
		gap: 0.5rem;
	}

	.qw-cart-totals {
		padding: 1rem;
	}

	.qw-grand-total {
		font-size: 1.125rem;
	}

	.qw-add-to-cart-btn {
		width: 100%;
		padding: 0.875rem 1.5rem;
		font-size: 1rem;
	}

	/* Make table more mobile-friendly */
	.qw-shared-carts-table .woocommerce-button {
		display: block;
		width: 100%;
		margin: 0.25rem 0;
	}
}

@media (max-width: 480px) {
	.qw-cart-meta-notice {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.qw-product-name {
		font-size: 1rem;
	}

	.qw-booking-details,
	.qw-subscription-details {
		font-size: 0.85rem;
	}
}
