/**
 * FlexCart Styles
 *
 * @package FlexCart
 */

/* ============================================
   VARIABLES
   ============================================ */
:root {
	--flexcart-primary: var(--flexsuite-primary, #1E55B3);
	--flexcart-secondary: var(--flexsuite-secondary, #06AFBE);
	--flexcart-success: #4caf50;
	--flexcart-error: #dc3545;
	--flexcart-gray: #6c757d;
	--flexcart-light: #f8f9fa;
	--flexcart-border: #e2e8f0;
	--flexcart-radius: 8px;
}

/* ============================================
   ADD TO CART BUTTON
   ============================================ */
.flexcart-add-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	background: var(--flexcart-primary);
	color: #fff;
	border: none;
	border-radius: var(--flexcart-radius);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.flexcart-add-btn:hover:not(:disabled) {
	background: var(--flexcart-secondary);
	transform: translateY(-1px);
}

.flexcart-add-btn:disabled,
.flexcart-add-btn.is-in-cart {
	background: var(--flexcart-success);
	cursor: default;
}

.flexcart-add-btn.is-loading {
	pointer-events: none;
	opacity: 0.8;
}

.flexcart-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: flexcart-spin 0.6s linear infinite;
}

@keyframes flexcart-spin {
	to { transform: rotate(360deg); }
}

/* ============================================
   MINI CART (HEADER)
   ============================================ */
.flexcart-mini {
	position: relative;
	display: inline-block;
}

.flexcart-mini-toggle {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px;
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
}

.flexcart-mini-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.flexcart-mini-icon svg {
	width: 24px;
	height: 24px;
}

.flexcart-mini-count {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: var(--flexcart-gray);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 10px;
	transition: all 0.2s ease;
}

.flexcart-mini-count.has-items {
	background: var(--flexcart-primary);
}

.flexcart-mini-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	width: 320px;
	max-height: 400px;
	background: #fff;
	border-radius: var(--flexcart-radius);
	box-shadow: 0 8px 32px rgba(0,0,0,0.15);
	z-index: 1000;
	overflow: hidden;
}

.flexcart-mini-content {
	max-height: 280px;
	overflow-y: auto;
	padding: 16px;
}

.flexcart-mini-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.flexcart-mini-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid var(--flexcart-border);
	font-size: 14px;
}

.flexcart-mini-item:last-child {
	border-bottom: none;
}

.flexcart-mini-title {
	flex: 1;
	font-weight: 500;
	color: #333;
}

.flexcart-mini-qty {
	color: var(--flexcart-gray);
	margin: 0 8px;
}

.flexcart-mini-price {
	font-weight: 600;
	color: var(--flexcart-primary);
}

.flexcart-mini-total {
	display: flex;
	justify-content: space-between;
	padding-top: 12px;
	margin-top: 8px;
	border-top: 2px solid var(--flexcart-border);
	font-weight: 700;
	font-size: 16px;
}

.flexcart-mini-actions {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	background: var(--flexcart-light);
	border-top: 1px solid var(--flexcart-border);
}

.flexcart-mini-view,
.flexcart-mini-checkout {
	flex: 1;
	padding: 10px 16px;
	text-align: center;
	text-decoration: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.2s ease;
}

.flexcart-mini-view {
	background: #fff;
	border: 1px solid var(--flexcart-border);
	color: #333;
}

.flexcart-mini-view:hover {
	border-color: var(--flexcart-primary);
	color: var(--flexcart-primary);
}

.flexcart-mini-checkout {
	background: var(--flexcart-primary);
	color: #fff;
}

.flexcart-mini-checkout:hover {
	background: var(--flexcart-secondary);
	color: #fff;
}

.flexcart-empty {
	text-align: center;
	color: var(--flexcart-gray);
	padding: 20px 0;
}

/* ============================================
   CART PAGE
   ============================================ */
.flexcart-page {
	max-width: 900px;
	margin: 0 auto;
}

.flexcart-empty-page {
	text-align: center;
	padding: 60px 20px;
	background: var(--flexcart-light);
	border-radius: var(--flexcart-radius);
}

.flexcart-empty-page p {
	font-size: 18px;
	color: var(--flexcart-gray);
	margin-bottom: 20px;
}

.flexcart-continue {
	display: inline-block;
	padding: 12px 24px;
	background: var(--flexcart-primary);
	color: #fff;
	text-decoration: none;
	border-radius: var(--flexcart-radius);
	font-weight: 600;
	transition: all 0.2s ease;
}

.flexcart-continue:hover {
	background: var(--flexcart-secondary);
	color: #fff;
}

/* Cart Table */
.flexcart-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 24px;
}

.flexcart-table th {
	text-align: left;
	padding: 12px 16px;
	background: var(--flexcart-light);
	font-weight: 600;
	font-size: 14px;
	color: var(--flexcart-gray);
	border-bottom: 2px solid var(--flexcart-border);
}

.flexcart-table td {
	padding: 16px;
	border-bottom: 1px solid var(--flexcart-border);
	vertical-align: middle;
}

.flexcart-col-product { width: 45%; }
.flexcart-col-price { width: 15%; }
.flexcart-col-qty { width: 15%; }
.flexcart-col-total { width: 15%; }
.flexcart-col-remove { width: 10%; text-align: center; }

/* Product cell */
.flexcart-product {
	display: flex;
	align-items: center;
	gap: 16px;
}

.flexcart-product-image {
	flex-shrink: 0;
	width: 80px;
	height: 60px;
	border-radius: 6px;
	overflow: hidden;
}

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

.flexcart-product-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.flexcart-product-title {
	font-weight: 600;
	color: #333;
	text-decoration: none;
}

.flexcart-product-title:hover {
	color: var(--flexcart-primary);
}

.flexcart-product-startcode {
	font-size: 13px;
	color: var(--flexcart-gray);
}

/* Quantity input */
.flexcart-qty {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--flexcart-border);
	border-radius: 6px;
	overflow: hidden;
}

.flexcart-qty-minus,
.flexcart-qty-plus {
	width: 36px;
	background: var(--flexcart-light);
	border: none;
	font-size: 18px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.flexcart-qty-minus:hover,
.flexcart-qty-plus:hover {
	background: var(--flexcart-border);
}

.flexcart-qty-input {
	width: 50px;
	text-align: center;
	border: none;
	border-left: 1px solid var(--flexcart-border);
	border-right: 1px solid var(--flexcart-border);
	font-size: 16px;
	font-weight: 600;
	-moz-appearance: textfield;
}

.flexcart-qty-input::-webkit-outer-spin-button,
.flexcart-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Remove button */
.flexcart-remove {
	width: 32px;
	height: 32px;
	background: none;
	border: 1px solid var(--flexcart-border);
	border-radius: 50%;
	font-size: 20px;
	color: var(--flexcart-gray);
	cursor: pointer;
	transition: all 0.2s ease;
}

.flexcart-remove:hover {
	background: var(--flexcart-error);
	border-color: var(--flexcart-error);
	color: #fff;
}

/* Totals */
.flexcart-totals {
	max-width: 300px;
	margin-left: auto;
	background: var(--flexcart-light);
	padding: 20px;
	border-radius: var(--flexcart-radius);
}

.flexcart-totals-row {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	font-size: 15px;
}

.flexcart-totals-total {
	border-top: 2px solid var(--flexcart-border);
	margin-top: 8px;
	padding-top: 16px;
	font-size: 18px;
	font-weight: 700;
}

.flexcart-totals-total span:last-child {
	color: var(--flexcart-primary);
}

/* Actions */
.flexcart-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--flexcart-border);
}

.flexcart-actions .flexcart-continue {
	background: transparent;
	color: var(--flexcart-primary);
	padding: 12px 0;
}

.flexcart-actions .flexcart-continue:hover {
	color: var(--flexcart-secondary);
}

.flexcart-checkout-btn {
	display: inline-block;
	padding: 16px 32px;
	background: var(--flexcart-primary);
	color: #fff;
	text-decoration: none;
	border-radius: var(--flexcart-radius);
	font-size: 18px;
	font-weight: 700;
	transition: all 0.2s ease;
}

.flexcart-checkout-btn:hover {
	background: var(--flexcart-secondary);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Count badge */
.flexcart-count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: var(--flexcart-primary);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	border-radius: 10px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
	.flexcart-table thead {
		display: none;
	}

	.flexcart-table tr {
		display: block;
		padding: 16px;
		margin-bottom: 16px;
		background: #fff;
		border: 1px solid var(--flexcart-border);
		border-radius: var(--flexcart-radius);
	}

	.flexcart-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 8px 0;
		border: none;
	}

	.flexcart-table td::before {
		content: attr(data-label);
		font-weight: 600;
		color: var(--flexcart-gray);
	}

	.flexcart-col-product {
		flex-direction: column;
		align-items: flex-start;
	}

	.flexcart-col-product::before {
		display: none;
	}

	.flexcart-product {
		width: 100%;
	}

	.flexcart-col-remove {
		justify-content: flex-end;
	}

	.flexcart-col-remove::before {
		display: none;
	}

	.flexcart-totals {
		max-width: 100%;
	}

	.flexcart-actions {
		flex-direction: column;
		gap: 16px;
	}

	.flexcart-checkout-btn {
		width: 100%;
		text-align: center;
	}

	.flexcart-mini-dropdown {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		width: 100%;
		max-height: 70vh;
		border-radius: var(--flexcart-radius) var(--flexcart-radius) 0 0;
	}
}
