/**
 * La-Kass Cart Drawer Styles
 *
 * Slide-in cart panel, items, quantity controls, subtotal, actions.
 * Also includes AJAX search overlay and off-canvas shared base.
 *
 * @package La-Kass
 * @since   1.0.0
 */

/* ==========================================================================
   Cart Drawer
   ========================================================================== */

.lk-cart-drawer {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	visibility: hidden;
	pointer-events: none;
}

.lk-cart-drawer--active {
	visibility: visible;
	pointer-events: auto;
}

/* Overlay */
.lk-cart-drawer__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0);
	transition: background 0.3s ease;
	cursor: pointer;
}

.lk-cart-drawer--active .lk-cart-drawer__overlay {
	background: rgba(0, 0, 0, 0.5);
}

/* Panel */
.lk-cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	width: 420px;
	max-width: 90vw;
	height: 100%;
	background: #fff;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.lk-cart-drawer--active .lk-cart-drawer__panel {
	transform: translateX(0);
}

/* Header */
.lk-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}

.lk-cart-drawer__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #111;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.lk-cart-drawer__count {
	font-weight: 400;
	color: #888;
	font-size: 14px;
}

.lk-cart-drawer__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	background: #f5f5f5;
	border-radius: 50%;
	cursor: pointer;
	color: #333;
	transition: background 0.2s, color 0.2s;
}

.lk-cart-drawer__close:hover {
	background: #111;
	color: #fff;
}

/* Body (scrollable items area) */
.lk-cart-drawer__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* ---------- Cart Items ---------- */

.lk-cart-drawer__items {
	padding: 16px 24px;
}

.lk-cart-drawer__item {
	display: flex;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
	transition: opacity 0.3s;
}

.lk-cart-drawer__item:last-child {
	border-bottom: none;
}

.lk-cart-drawer__item--removing {
	opacity: 0.3;
	pointer-events: none;
}

.lk-cart-drawer__item--updating {
	opacity: 0.6;
}

/* Item image */
.lk-cart-drawer__item-image {
	width: 80px;
	height: 80px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	background: #f8f8f8;
}

.lk-cart-drawer__item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Item info */
.lk-cart-drawer__item-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.lk-cart-drawer__item-name {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
}

.lk-cart-drawer__item-name a {
	color: #111;
	text-decoration: none;
}

.lk-cart-drawer__item-name a:hover {
	color: var(--lk-color-primary, #ff4d00);
}

/* Variation display */
.lk-cart-drawer__item-variations {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
}

.lk-cart-drawer__variation {
	font-size: 12px;
	color: #888;
}

.lk-cart-drawer__variation strong {
	font-weight: 500;
	color: #666;
}

/* Price */
.lk-cart-drawer__item-price {
	font-size: 14px;
	font-weight: 600;
	color: #111;
}

.lk-cart-drawer__item-price del {
	color: #999;
	font-weight: 400;
	font-size: 12px;
}

.lk-cart-drawer__item-price ins {
	text-decoration: none;
	color: var(--lk-color-primary, #ff4d00);
}

/* Quantity controls */
.lk-cart-drawer__item-qty {
	display: flex;
	align-items: center;
	gap: 0;
	margin-top: 4px;
	width: fit-content;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	overflow: hidden;
}

.lk-cart-drawer__qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: none;
	background: #f8f8f8;
	cursor: pointer;
	color: #555;
	transition: background 0.15s, color 0.15s;
}

.lk-cart-drawer__qty-btn:hover {
	background: #eee;
	color: #111;
}

.lk-cart-drawer__qty-input {
	width: 36px;
	height: 30px;
	border: none;
	border-left: 1px solid #e0e0e0;
	border-right: 1px solid #e0e0e0;
	text-align: center;
	font-size: 13px;
	font-weight: 500;
	color: #111;
	background: #fff;
	-moz-appearance: textfield;
}

.lk-cart-drawer__qty-input::-webkit-outer-spin-button,
.lk-cart-drawer__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Remove button */
.lk-cart-drawer__item-remove {
	position: absolute;
	top: 16px;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: none;
	background: transparent;
	cursor: pointer;
	color: #bbb;
	transition: color 0.2s;
}

.lk-cart-drawer__item-remove:hover {
	color: #e53935;
}

/* ---------- Empty Cart ---------- */

.lk-cart-drawer__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 60px 24px;
	color: #999;
}

.lk-cart-drawer__empty svg {
	margin-bottom: 16px;
	opacity: 0.4;
}

.lk-cart-drawer__empty p {
	margin: 0 0 20px;
	font-size: 16px;
	color: #666;
}

.lk-cart-drawer__shop-btn {
	display: inline-flex;
	align-items: center;
	padding: 10px 24px;
	background: #111;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 6px;
	text-decoration: none;
	transition: background 0.2s;
}

.lk-cart-drawer__shop-btn:hover {
	background: var(--lk-color-primary, #ff4d00);
	color: #fff;
}

/* ---------- Footer ---------- */

.lk-cart-drawer__footer {
	flex-shrink: 0;
	border-top: 1px solid #eee;
	padding: 20px 24px;
	background: #fafafa;
}

.lk-cart-drawer__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.lk-cart-drawer__subtotal-label {
	font-size: 15px;
	font-weight: 600;
	color: #111;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.lk-cart-drawer__subtotal-value {
	font-size: 18px;
	font-weight: 700;
	color: #111;
}

/* Coupon */
.lk-cart-drawer__coupon {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.lk-cart-drawer__coupon-input {
	flex: 1;
	height: 38px;
	padding: 0 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 13px;
	color: #333;
	background: #fff;
	transition: border-color 0.2s;
}

.lk-cart-drawer__coupon-input:focus {
	outline: none;
	border-color: var(--lk-color-primary, #ff4d00);
}

.lk-cart-drawer__coupon-btn {
	height: 38px;
	padding: 0 16px;
	border: none;
	background: #333;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 6px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s;
}

.lk-cart-drawer__coupon-btn:hover {
	background: #111;
}

.lk-cart-drawer__coupon-btn.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Action buttons */
.lk-cart-drawer__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lk-cart-drawer__view-cart,
.lk-cart-drawer__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 46px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-decoration: none;
	border-radius: 6px;
	transition: background 0.2s, color 0.2s;
}

.lk-cart-drawer__view-cart {
	background: #fff;
	color: #111;
	border: 1px solid #ddd;
}

.lk-cart-drawer__view-cart:hover {
	background: #f5f5f5;
	color: #111;
}

.lk-cart-drawer__checkout {
	background: var(--lk-color-primary, #ff4d00);
	color: #fff;
	border: none;
}

.lk-cart-drawer__checkout:hover {
	background: #e64400;
	color: #fff;
}

/* ==========================================================================
   AJAX Search Overlay
   ========================================================================== */

.lk-search {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10001;
	visibility: hidden;
	pointer-events: none;
}

.lk-search--active {
	visibility: visible;
	pointer-events: auto;
}

/* Overlay */
.lk-search__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0);
	transition: background 0.3s ease;
	cursor: pointer;
}

.lk-search--active .lk-search__overlay {
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
}

/* Container */
.lk-search__container {
	position: relative;
	max-width: 720px;
	margin: 0 auto;
	padding-top: 80px;
	opacity: 0;
	transform: translateY(-20px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.lk-search--active .lk-search__container {
	opacity: 1;
	transform: translateY(0);
}

/* Header / Form */
.lk-search__header {
	padding: 0 20px;
}

.lk-search__form {
	display: flex;
	align-items: center;
	background: #fff;
	border-radius: 12px;
	padding: 0 20px;
	height: 56px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.lk-search__icon {
	flex-shrink: 0;
	color: #999;
	margin-right: 12px;
}

.lk-search__input {
	flex: 1;
	height: 100%;
	border: none;
	background: transparent;
	font-size: 16px;
	color: #111;
	outline: none;
}

.lk-search__input::placeholder {
	color: #aaa;
}

.lk-search__close {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: #f5f5f5;
	border-radius: 50%;
	cursor: pointer;
	color: #666;
	margin-left: 8px;
	transition: background 0.2s, color 0.2s;
}

.lk-search__close:hover {
	background: #111;
	color: #fff;
}

/* Body */
.lk-search__body {
	margin-top: 12px;
	padding: 0 20px;
	max-height: calc(100vh - 200px);
	overflow-y: auto;
}

/* Popular categories */
.lk-search__popular {
	background: #fff;
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.lk-search__popular-title {
	margin: 0 0 14px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #888;
}

.lk-search__popular-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.lk-search__tag {
	display: inline-flex;
	align-items: center;
	padding: 6px 16px;
	background: #f5f5f5;
	color: #333;
	font-size: 13px;
	font-weight: 500;
	border-radius: 20px;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}

.lk-search__tag:hover {
	background: var(--lk-color-primary, #ff4d00);
	color: #fff;
}

/* Loading */
.lk-search__loading {
	display: flex;
	justify-content: center;
	padding: 40px 0;
}

/* Results */
.lk-search__results {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.lk-search__results:empty {
	display: none;
}

.lk-search__results-list {
	padding: 8px 0;
}

/* Single result item */
.lk-search__result-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 20px;
	text-decoration: none;
	transition: background 0.15s;
}

.lk-search__result-item:hover {
	background: #f8f8f8;
}

.lk-search__result-image {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	background: #f0f0f0;
}

.lk-search__result-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lk-search__result-info {
	flex: 1;
	min-width: 0;
}

.lk-search__result-cat {
	display: block;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #999;
	margin-bottom: 2px;
}

.lk-search__result-title {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: #111;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lk-search__result-rating {
	display: flex;
	gap: 1px;
	margin-top: 2px;
	color: #ffb300;
}

.lk-search__result-price {
	font-size: 14px;
	font-weight: 600;
	color: var(--lk-color-primary, #ff4d00);
	margin-top: 2px;
}

.lk-search__result-price del {
	color: #bbb;
	font-weight: 400;
	font-size: 12px;
}

.lk-search__result-price ins {
	text-decoration: none;
}

/* View all link */
.lk-search__view-all {
	padding: 14px 20px;
	border-top: 1px solid #f0f0f0;
}

.lk-search__view-all-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--lk-color-primary, #ff4d00);
	text-decoration: none;
	transition: opacity 0.2s;
}

.lk-search__view-all-link:hover {
	opacity: 0.8;
}

/* No results */
.lk-search__no-results {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 40px 20px;
	color: #999;
}

.lk-search__no-results svg {
	margin-bottom: 12px;
	opacity: 0.4;
}

.lk-search__no-results p {
	margin: 0 0 4px;
	font-size: 15px;
	color: #666;
}

.lk-search__no-results-hint {
	font-size: 13px;
	color: #aaa;
}

/* ==========================================================================
   Responsive — Cart Drawer + Search
   ========================================================================== */

@media (max-width: 480px) {
	.lk-cart-drawer__panel {
		width: 100%;
		max-width: 100%;
	}

	.lk-cart-drawer__header,
	.lk-cart-drawer__items,
	.lk-cart-drawer__footer {
		padding-left: 16px;
		padding-right: 16px;
	}

	.lk-cart-drawer__item-image {
		width: 64px;
		height: 64px;
	}

	.lk-search__container {
		padding-top: 20px;
		max-width: 100%;
	}

	.lk-search__form {
		border-radius: 0;
		height: 50px;
	}

	.lk-search__body {
		max-height: calc(100vh - 100px);
	}

	.lk-search__popular,
	.lk-search__results {
		border-radius: 0;
	}
}

@media (max-width: 768px) {
	.lk-cart-drawer__panel {
		width: 100%;
		max-width: 380px;
	}

	.lk-search__container {
		padding-top: 40px;
	}
}
