/**
 * OHI Slide-out Cart Drawer Styles
 */

/* 1. Drawer Root & Backdrop */
.oh-drawer-cart {
	position: fixed;
	inset: 0;
	z-index: 95;
	pointer-events: none;
	visibility: hidden;
	transition: visibility 0s linear 0.45s;
}

.oh-drawer-cart.is-open {
	pointer-events: auto;
	visibility: visible;
	transition-delay: 0s;
}

.oh-drawer-cart__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 10, 0.45);
	opacity: 0;
	transition: opacity 0.35s ease;
	cursor: pointer;
}

.oh-drawer-cart.is-open .oh-drawer-cart__backdrop {
	opacity: 1;
}

/* 2. Slide Panel */
.oh-drawer-cart__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: min(440px, 100vw);
	background: var(--paper, #fbf9f5);
	color: var(--ink, #141414);
	display: flex;
	flex-direction: column;
	transform: translateX(102%);
	transition: transform 0.45s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
	box-shadow: -12px 0 32px rgba(10, 10, 10, 0.08);
	overflow: hidden;
}

.oh-drawer-cart.is-open .oh-drawer-cart__panel {
	transform: translateX(0);
}

/* Body Scroll Lock */
body.oh-cart-drawer-open {
	overflow: hidden;
}

/* 3. Inner Container */
.oh-drawer-cart__inner {
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--paper, #fbf9f5);
	position: relative;
}

.oh-drawer-cart__inner.is-loading {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* 4. Drawer Header */
.oh-drawer-cart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid var(--line, rgba(20, 20, 20, 0.12));
	background: var(--paper, #fbf9f5);
	flex: none;
}

.oh-drawer-cart__title {
	font-family: var(--body, "Space Grotesk", sans-serif);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin: 0;
	color: var(--ink, #141414);
	line-height: 1.2;
}

.oh-drawer-cart__close {
	min-width: 44px;
	min-height: 44px;
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	color: var(--ink, #141414);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	padding: 0;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.oh-drawer-cart__close:hover {
	background: var(--hover, rgba(20, 20, 20, 0.06));
}

.oh-drawer-cart__close svg {
	width: 20px;
	height: 20px;
}

/* 5. Free Shipping Progress Bar */
.oh-drawer-cart__shipping {
	padding: 16px 24px;
	background: var(--bg-2, #ece6dc);
	border-bottom: 1px solid var(--line, rgba(20, 20, 20, 0.12));
	flex: none;
}

.oh-drawer-cart__shipping-text {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink, #141414);
	line-height: 1.4;
}

.oh-drawer-cart__shipping-bar {
	width: 100%;
	height: 6px;
	background: var(--line, rgba(20, 20, 20, 0.1));
	border-radius: 99px;
	overflow: hidden;
}

.oh-drawer-cart__shipping-fill {
	height: 100%;
	background: var(--sun, #ff6b47);
	border-radius: 99px;
	transition: width 0.4s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.oh-drawer-cart__shipping.is-unlocked .oh-drawer-cart__shipping-fill {
	background: var(--sun, #ff6b47);
}

/* 6. Items Body */
.oh-drawer-cart__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 20px 24px;
}

.oh-drawer-cart__items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.oh-drawer-cart__item {
	display: grid;
	grid-template-columns: 80px 1fr;
	gap: 16px;
	align-items: start;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--line, rgba(20, 20, 20, 0.08));
}

.oh-drawer-cart__item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.oh-drawer-cart__item-thumb {
	position: relative;
	aspect-ratio: 4 / 5;
	background: var(--bg-2, #ece6dc);
	border-radius: var(--radius, 2px);
	overflow: hidden;
}

.oh-drawer-cart__item-thumb a {
	display: block;
	width: 100%;
	height: 100%;
}

.oh-drawer-cart__item-thumb img,
.oh-drawer-cart__img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block;
}

.oh-drawer-cart__item-detail {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.oh-drawer-cart__item-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.oh-drawer-cart__item-name {
	font-family: var(--body, "Space Grotesk", sans-serif);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--ink, #141414);
	text-decoration: none;
	word-break: break-word;
	transition: color 0.2s ease;
}

.oh-drawer-cart__item-name:hover {
	color: var(--sun, #ff6b47);
}

.oh-drawer-cart__item-remove {
	background: transparent;
	border: 0;
	color: var(--ink-faint, rgba(20, 20, 20, 0.42));
	font-family: var(--body, "Space Grotesk", sans-serif);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
	min-height: 44px;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	flex: none;
	transition: color 0.2s ease;
}

.oh-drawer-cart__item-remove:hover {
	color: var(--ink, #141414);
}

.oh-drawer-cart__item-size {
	font-size: 12px;
	color: var(--ink-soft, rgba(20, 20, 20, 0.66));
	letter-spacing: 0.04em;
	line-height: 1.4;
}

.oh-drawer-cart__item-size dl,
.oh-drawer-cart__item-size .variation {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
}

.oh-drawer-cart__item-size dt,
.oh-drawer-cart__item-size dd {
	display: inline;
	margin: 0;
}

.oh-drawer-cart__item-size dt {
	font-weight: 600;
}

.oh-drawer-cart__item-size dd p {
	display: inline;
	margin: 0;
}

.oh-drawer-cart__item-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 6px;
}

/* Quantity controls with 44px tap targets */
.oh-drawer-cart__qty-ctrl {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--line, rgba(20, 20, 20, 0.12));
	border-radius: var(--radius, 2px);
	background: var(--paper, #fbf9f5);
}

.oh-drawer-cart__qty-btn {
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	border: 0;
	background: transparent;
	color: var(--ink, #141414);
	font-size: 18px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s ease;
}

.oh-drawer-cart__qty-btn:hover {
	background: var(--hover, rgba(20, 20, 20, 0.06));
}

.oh-drawer-cart__qty-input {
	width: 36px;
	height: 44px;
	border: 0;
	background: transparent;
	text-align: center;
	font-family: var(--body, "Space Grotesk", sans-serif);
	font-size: 13px;
	font-weight: 700;
	color: var(--ink, #141414);
	padding: 0;
	margin: 0;
	-moz-appearance: textfield;
}

.oh-drawer-cart__qty-input::-webkit-outer-spin-button,
.oh-drawer-cart__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.oh-drawer-cart__item-price {
	font-family: var(--body, "Space Grotesk", sans-serif);
	font-size: 14px;
	font-weight: 700;
	color: var(--ink, #141414);
	white-space: nowrap;
}

.oh-drawer-cart__item-price ins {
	text-decoration: none;
	color: var(--sun, #ff6b47);
}

.oh-drawer-cart__item-price del {
	color: var(--ink-faint, rgba(20, 20, 20, 0.42));
	font-weight: 400;
	margin-right: 4px;
}

/* 7. Drawer Footer */
.oh-drawer-cart__foot {
	padding: 20px 24px;
	border-top: 1px solid var(--line, rgba(20, 20, 20, 0.12));
	background: var(--paper, #fbf9f5);
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.oh-drawer-cart__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.oh-drawer-cart__subtotal-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ink-soft, rgba(20, 20, 20, 0.66));
}

.oh-drawer-cart__subtotal-val {
	font-size: 16px;
	font-weight: 700;
	color: var(--ink, #141414);
}

.oh-drawer-cart__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.oh-drawer-cart__checkout,
.oh-drawer-cart__view-cart {
	width: 100%;
	min-height: 52px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius, 2px);
	font-family: var(--body, "Space Grotesk", sans-serif);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
}

.oh-drawer-cart__checkout {
	background: var(--ink, #141414);
	color: var(--on-ink, #fff);
	border: 1.5px solid var(--ink, #141414);
	transition: background 0.25s ease, color 0.25s ease;
}

.oh-drawer-cart__checkout:hover {
	background: transparent;
	color: var(--ink, #141414);
}

.oh-drawer-cart__view-cart {
	background: transparent;
	color: var(--ink, #141414);
	border: 1.5px solid var(--line, rgba(20, 20, 20, 0.12));
	transition: border-color 0.25s ease;
}

.oh-drawer-cart__view-cart:hover {
	border-color: var(--ink, #141414);
}

/* 8. Empty State */
.oh-drawer-cart__empty {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 48px 24px;
}

.oh-drawer-cart__empty-msg {
	font-size: 15px;
	color: var(--ink-soft, rgba(20, 20, 20, 0.66));
	margin: 0 0 24px;
	letter-spacing: 0.04em;
}

.oh-drawer-cart__shop-btn {
	min-height: 52px;
	padding: 0 28px;
	background: var(--ink, #141414);
	color: var(--on-ink, #fff);
	border: 1.5px solid var(--ink, #141414);
	border-radius: var(--radius, 2px);
	font-family: var(--body, "Space Grotesk", sans-serif);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.25s ease, color 0.25s ease;
}

.oh-drawer-cart__shop-btn:hover {
	background: transparent;
	color: var(--ink, #141414);
}

/* 9. Single Product Page Error Message */
.oh-cart-error {
	margin-top: 14px;
	padding: 12px 16px;
	background: var(--paper, #fbf9f5);
	border: 1px solid var(--line, rgba(20, 20, 20, 0.12));
	border-left: 3px solid #c0392b;
	border-radius: var(--radius, 2px);
	color: #c0392b;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.45;
}

/* 10. Add to cart button loading state */
button.single_add_to_cart_button.is-loading,
.oh-btn.is-loading {
	opacity: 0.7;
	pointer-events: none;
	position: relative;
}

/* 11. Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.oh-drawer-cart,
	.oh-drawer-cart__backdrop,
	.oh-drawer-cart__panel,
	.oh-drawer-cart__shipping-fill,
	.oh-drawer-cart__inner {
		transition: none !important;
		animation: none !important;
	}
}
