/* ============================================================
   WooCommerce Side Cart — sidecart.css
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.wcsidecart-overlay {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 999998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	cursor: pointer;
}

.wcsidecart-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

/* ── Drawer ──────────────────────────────────────────────── */
.wcsidecart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 420px;
	max-width: 100vw;
	height: 100%;
	background-color: #ffffff;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	transform: translateX(105%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: -6px 0 32px rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

.wcsidecart-drawer.position-left {
	right: auto;
	left: 0;
	transform: translateX(-105%);
	box-shadow: 6px 0 32px rgba(0, 0, 0, 0.12);
}

.wcsidecart-drawer.is-open {
	transform: translateX(0);
}

/* ── Header ──────────────────────────────────────────────── */
.wcsidecart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #eeeeee;
	flex-shrink: 0;
}

.wcsidecart-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
}

.wcsidecart-close {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 6px;
	cursor: pointer;
	color: inherit;
	opacity: 0.6;
	transition: opacity 0.2s, transform 0.2s;
	border-radius: 4px;
	line-height: 1;
}

.wcsidecart-close:hover {
	opacity: 1;
	transform: rotate(90deg);
}

/* ── Body (scrollable) ───────────────────────────────────── */
.wcsidecart-body {
	flex: 1;
	overflow-y: auto;
	padding: 0 24px;
	overscroll-behavior: contain;
}

/* ── Loading spinner ─────────────────────────────────────── */
.wcsidecart-loading {
	display: flex;
	justify-content: center;
	padding: 48px 0;
}

.wcsidecart-spinner {
	display: block;
	width: 32px;
	height: 32px;
	border: 3px solid #e8e8e8;
	border-top-color: #2c2c2c;
	border-radius: 50%;
	animation: wcsidecart-spin 0.7s linear infinite;
}

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

/* ── Empty state ─────────────────────────────────────────── */
.wcsidecart-empty {
	text-align: center;
	padding: 64px 20px;
	color: #aaaaaa;
	font-size: 15px;
	line-height: 1.6;
}

.wcsidecart-empty-icon {
	font-size: 48px;
	display: block;
	margin-bottom: 12px;
	opacity: 0.4;
}

/* ── Item list ───────────────────────────────────────────── */
.wcsidecart-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wcsidecart-item {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid #f0f0f0;
	align-items: start;
}

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

.wcsidecart-item-image-link {
	display: block;
	flex-shrink: 0;
}

.wcsidecart-item-image {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

.wcsidecart-item-info {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.wcsidecart-item-name {
	font-size: 14px;
	font-weight: 500;
	color: inherit;
	text-decoration: none;
	line-height: 1.4;
	white-space: normal;
	word-break: break-word;
}

.wcsidecart-item-name:hover {
	text-decoration: underline;
}

.wcsidecart-item-price {
	font-size: 13px;
	color: #777777;
}

.wcsidecart-item-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 6px;
}

/* ── Quantity stepper ────────────────────────────────────── */
.wcsidecart-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	overflow: hidden;
}

.wcsidecart-qty-btn {
	background: none;
	border: none;
	width: 30px;
	height: 30px;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #333333;
	transition: background-color 0.15s;
	flex-shrink: 0;
}

.wcsidecart-qty-btn:hover {
	background-color: #f5f5f5;
}

.wcsidecart-qty-btn:active {
	background-color: #ebebeb;
}

.wcsidecart-qty-input {
	width: 38px;
	height: 30px;
	text-align: center;
	border: none;
	border-left: 1px solid #e0e0e0;
	border-right: 1px solid #e0e0e0;
	font-size: 14px;
	padding: 0;
	background: transparent;
	color: inherit;
	-moz-appearance: textfield;
}

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

.wcsidecart-qty-input:focus {
	outline: none;
}

/* ── Remove button ───────────────────────────────────────── */
.wcsidecart-remove {
	background: none;
	border: none;
	cursor: pointer;
	color: #bbbbbb;
	font-size: 12px;
	padding: 0;
	text-decoration: underline;
	transition: color 0.2s;
	line-height: 1;
}

.wcsidecart-remove:hover {
	color: #e00000;
}

/* ── Footer ──────────────────────────────────────────────── */
.wcsidecart-footer {
	padding: 20px 24px;
	border-top: 1px solid #eeeeee;
	flex-shrink: 0;
}

.wcsidecart-total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 16px;
}

.wcsidecart-checkout-btn {
	display: block;
	width: 100%;
	padding: 14px 20px;
	background-color: #2c2c2c;
	color: #ffffff !important;
	text-align: center;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 15px;
	border-radius: 8px;
	transition: background-color 0.2s, transform 0.1s;
	margin-bottom: 10px;
	box-sizing: border-box;
}

.wcsidecart-checkout-btn:hover {
	background-color: #444444;
	transform: translateY(-1px);
}

.wcsidecart-checkout-btn:active {
	transform: translateY(0);
}

.wcsidecart-view-cart {
	display: block;
	text-align: center;
	font-size: 13px;
	color: #888888;
	text-decoration: underline;
	transition: color 0.2s;
}

.wcsidecart-view-cart:hover {
	color: #333333;
}

/* ── Add to Cart Button widget ───────────────────────────── */
.wcsidecart-button-wrap {
	display: flex;
}

.wcsidecart-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 28px;
	background-color: #2c2c2c;
	color: #ffffff;
	border: none;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	border-radius: 6px;
	transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
	line-height: 1;
}

.wcsidecart-btn:hover {
	background-color: #444444;
	transform: translateY(-1px);
}

.wcsidecart-btn:active {
	transform: translateY(0) scale(0.98);
}

.wcsidecart-btn:disabled,
.wcsidecart-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

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

.wcsidecart-btn-icon {
	display: inline-flex;
	align-items: center;
	font-size: 1em;
}

/* ── Cart page: static quantity (when editor is disabled) ── */
.wcsidecart-qty-static {
	display: inline-block;
	min-width: 2em;
	text-align: center;
	font-weight: 500;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
	.wcsidecart-drawer {
		width: 100vw;
	}
}
