/**
 * K360 Shop Modal — Left-side full-height sidebar variant.
 *
 * Typography:  Archivo (heading + UI), Archivo (body) — single family,
 *              variable weights so we get a tighter brand feel.
 * Animation:   cubic-bezier(0.23, 1, 0.32, 1), scale(0.98) on :active,
 *              prefers-reduced-motion respected.
 */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   1.  TRIGGERS
   ========================================================================== */

.k360-sm-trigger {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	background: transparent;
	border: none;
	font-family: 'Archivo', system-ui, -apple-system, sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: #1a1a1a;
	cursor: pointer;
	border-radius: 8px;
	transition: background 200ms cubic-bezier(0.23, 1, 0.32, 1),
		transform 100ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm-trigger:hover {
	background: rgba(0, 0, 0, 0.04);
}
.k360-sm-trigger:active {
	transform: scale(0.97);
}
.k360-sm-trigger__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.k360-sm-search-trigger {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	max-width: 600px;
	padding: 13px 18px;
	background: #f4f5f7;
	border: 1px solid transparent;
	border-radius: 999px;
	font-family: 'Archivo', system-ui, -apple-system, sans-serif;
	font-size: 14px;
	color: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	text-align: left;
	transition: background 200ms cubic-bezier(0.23, 1, 0.32, 1),
		border-color 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm-search-trigger:hover {
	background: #ebedf0;
}
.k360-sm-search-trigger:focus-visible {
	outline: none;
	border-color: #B22337;
	background: #ffffff;
}
.k360-sm-search-trigger__icon {
	flex-shrink: 0;
	color: rgba(0, 0, 0, 0.5);
}
.k360-sm-search-trigger__placeholder {
	flex: 1 1 auto;
}

/* ==========================================================================
   2.  SIDEBAR SHELL — left-side, full-height
   ========================================================================== */

.k360-sm {
	position: fixed;
	inset: 0;
	z-index: 99999;
	pointer-events: none;
	visibility: hidden;
	transition: visibility 0s linear 380ms;
}
.k360-sm.is-open {
	pointer-events: auto;
	visibility: visible;
	transition: visibility 0s linear 0s;
}

.k360-sm__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 15, 20, 0.4);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity 320ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm.is-open .k360-sm__overlay {
	opacity: 1;
}

.k360-sm__panel {
	position: absolute;
	top: 0;
	left: 0;
	width: min(520px, 100vw);
	height: 100vh;
	height: 100dvh; /* dynamic viewport height for mobile */
	background: #ffffff;
	box-shadow: 24px 0 60px -10px rgba(0, 0, 0, 0.15),
		8px 0 20px -8px rgba(0, 0, 0, 0.08);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: 'Archivo', system-ui, -apple-system, sans-serif;
	color: #1a1a1a;
	transform: translateX(-100%);
	transition: transform 420ms cubic-bezier(0.23, 1, 0.32, 1);
	will-change: transform;
}
.k360-sm.is-open .k360-sm__panel {
	transform: translateX(0);
}

/* ==========================================================================
   3.  HEADER + TABS + CLOSE
   ========================================================================== */

.k360-sm__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	flex-shrink: 0;
}

.k360-sm__brand {
	font-family: 'Archivo', sans-serif;
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: #1a1a1a;
	margin: 0;
}

.k360-sm__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	background: transparent;
	border: none;
	border-radius: 10px;
	color: rgba(0, 0, 0, 0.6);
	cursor: pointer;
	transition: background 200ms cubic-bezier(0.23, 1, 0.32, 1),
		color 200ms cubic-bezier(0.23, 1, 0.32, 1),
		transform 100ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__close:hover {
	background: rgba(0, 0, 0, 0.06);
	color: #1a1a1a;
}
.k360-sm__close:active {
	transform: scale(0.92);
}

.k360-sm__tabs {
	display: flex;
	gap: 20px;
	padding: 0 24px;
	background: transparent;
	flex-shrink: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.k360-sm__tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 16px 0 14px;
	background: transparent;
	border: none;
	font-family: inherit;
	font-size: 14px;
	cursor: pointer;
	letter-spacing: 0.01em;
	color: rgba(0, 0, 0, 0.55);
	transition: color 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__tab-icon {
	flex-shrink: 0;
	color: currentColor;
}
.k360-sm__tab::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: #B22337;
	transform-origin: center;
	transition: transform 280ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__tab:hover {
	color: #1a1a1a;
}
.k360-sm__tab.is-active {
	color: #1a1a1a;
	font-weight: 600;
}
.k360-sm__tab.is-active::after {
	transform: scaleX(1);
}

/* ==========================================================================
   4.  TAB PANELS
   ========================================================================== */

.k360-sm__tab-panel {
	display: none;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}
.k360-sm__tab-panel.is-active {
	display: flex;
}

/* ==========================================================================
   5.  CATEGORIES TAB — crumbs + sliding layers
   ========================================================================== */

.k360-sm__crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	padding: 16px 20px 12px;
	flex-shrink: 0;
}
.k360-sm__crumb {
	display: inline-flex;
	align-items: center;
	padding: 5px;
	font-family: inherit;
	font-size: 12px;
	font-weight: 500;
	color: rgba(0, 0, 0, 0.55);
	background: transparent;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	transition: background 180ms cubic-bezier(0.23, 1, 0.32, 1),
		color 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__crumb::after {
	content: "/";
	margin-left: 8px;
	color: rgba(0, 0, 0, 0.25);
}
.k360-sm__crumb:last-child::after {
	display: none;
}
.k360-sm__crumb:hover:not(.is-current) {
	background: rgba(0, 0, 0, 0.04);
	color: #1a1a1a;
}
.k360-sm__crumb:active:not(.is-current) {
	transform: scale(0.97);
}
.k360-sm__crumb.is-current {
	color: #B22337;
	font-weight: 700;
	cursor: default;
}

.k360-sm__viewport {
	position: relative;
	flex: 1 1 auto;
	overflow: hidden;
	min-height: 200px;
}
.k360-sm__layer {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 8px 24px 32px;
	transition: transform 380ms cubic-bezier(0.23, 1, 0.32, 1),
		opacity 280ms cubic-bezier(0.23, 1, 0.32, 1);
	transform: translateX(0);
	opacity: 1;
	will-change: transform, opacity;
}
.k360-sm__layer.is-leaving-forward { transform: translateX(-12%); opacity: 0; pointer-events: none; }
.k360-sm__layer.is-entering-forward { transform: translateX(20%); opacity: 0; }
.k360-sm__layer.is-leaving-back   { transform: translateX(20%); opacity: 0; pointer-events: none; }
.k360-sm__layer.is-entering-back  { transform: translateX(-12%); opacity: 0; }
.k360-sm__layer.is-active         { transform: translateX(0); opacity: 1; pointer-events: auto; }

.k360-sm__layer::-webkit-scrollbar      { width: 5px; }
.k360-sm__layer::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.12);
	border-radius: 6px;
}
.k360-sm__layer::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.22);
}

/* ==========================================================================
   6.  CATEGORY GRID + ITEMS — vertical list, premium feel
   ========================================================================== */

.k360-sm__grid {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.k360-sm__item-wrap {
	animation: k360SmStaggerIn 360ms cubic-bezier(0.23, 1, 0.32, 1) backwards;
}
.k360-sm__item-wrap:nth-child(1)  { animation-delay:  10ms; }
.k360-sm__item-wrap:nth-child(2)  { animation-delay:  30ms; }
.k360-sm__item-wrap:nth-child(3)  { animation-delay:  50ms; }
.k360-sm__item-wrap:nth-child(4)  { animation-delay:  70ms; }
.k360-sm__item-wrap:nth-child(5)  { animation-delay:  90ms; }
.k360-sm__item-wrap:nth-child(6)  { animation-delay: 110ms; }
.k360-sm__item-wrap:nth-child(7)  { animation-delay: 130ms; }
.k360-sm__item-wrap:nth-child(8)  { animation-delay: 150ms; }
.k360-sm__item-wrap:nth-child(9)  { animation-delay: 170ms; }
.k360-sm__item-wrap:nth-child(10) { animation-delay: 190ms; }
.k360-sm__item-wrap:nth-child(n+11) { animation-delay: 210ms; }

@keyframes k360SmStaggerIn {
	from { opacity: 0; transform: translateX(-8px); }
	to   { opacity: 1; transform: translateX(0); }
}

.k360-sm__item {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 12px 0;
	background: transparent;
	border: none;
	border-radius: 12px;
	font-family: inherit;
	color: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background 220ms cubic-bezier(0.23, 1, 0.32, 1),
		transform 100ms cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) {
	.k360-sm__item:hover .k360-sm__item-chevron {
		transform: translateX(4px);
		color: #B22337;
	}
	.k360-sm__item:hover .k360-sm__item-image {
		background: #ffffff;
	}
	.k360-sm__item:hover .k360-sm__item-image img {
		transform: scale(1.05);
	}
	.k360-sm__item:hover .k360-sm__item-name {
		color: #B22337;
	}
}
.k360-sm__item:active {
	transform: scale(0.99);
}
.k360-sm__item:focus-visible {
	outline: none;
	box-shadow: inset 0 0 0 2px #B22337;
}

.k360-sm__item-image {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	background: #f4f5f7;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__item-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 6px;
	box-sizing: border-box;
	transition: transform 380ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__item-image svg {
	width: 22px;
	height: 22px;
	color: rgba(0, 0, 0, 0.25);
}

.k360-sm__item-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.k360-sm__item-name {
	font-size: 15px;
	font-weight: 500;
	color: #1a1a1a;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	letter-spacing: -0.005em;
	transition: color 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__item-count {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.45);
	font-variant-numeric: tabular-nums;
}
.k360-sm__item-chevron {
	flex-shrink: 0;
	color: rgba(0, 0, 0, 0.25);
	transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1),
		color 220ms cubic-bezier(0.23, 1, 0.32, 1);
}

.k360-sm__empty {
	padding: 48px 24px;
	text-align: center;
	color: rgba(0, 0, 0, 0.4);
	font-size: 14px;
}

/* Skeleton placeholder shown briefly during AJAX load */
.k360-sm__loading-placeholder {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 4px 0;
}
.k360-sm__loading-placeholder::before,
.k360-sm__loading-placeholder::after {
	content: "";
	height: 76px;
	border-radius: 12px;
	background: linear-gradient(90deg, #f4f5f7 0%, #ebedf0 50%, #f4f5f7 100%);
	background-size: 200% 100%;
	animation: k360SmSkeleton 1.4s ease-in-out infinite;
}
.k360-sm__loading-placeholder::after {
	animation-delay: 0.15s;
	opacity: 0.7;
}
@keyframes k360SmSkeleton {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ==========================================================================
   7.  SEARCH TAB
   ========================================================================== */

.k360-sm__search-bar {
	position: relative;
	padding: 18px 24px 12px;
	flex-shrink: 0;
}
.k360-sm__search-icon {
	position: absolute;
	left: 42px;
	top: 50%;
	transform: translateY(calc(-50% - 3px));
	color: rgba(0, 0, 0, 0.4);
	pointer-events: none;
}
.k360-sm__search-input {
	width: 100%;
	padding: 14px 48px 14px 50px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	color: #1a1a1a;
	background: #f4f5f7;
	border: 1.5px solid transparent;
	border-radius: 12px;
	box-sizing: border-box;
	letter-spacing: -0.005em;
	transition: background 200ms cubic-bezier(0.23, 1, 0.32, 1),
		border-color 200ms cubic-bezier(0.23, 1, 0.32, 1),
		box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__search-input::placeholder {
	color: rgba(0, 0, 0, 0.4);
}
.k360-sm__search-input:focus {
	outline: none;
	background: #ffffff;
	border-color: #B22337;
	box-shadow: 0 0 0 3px rgba(178, 35, 55, 0.1);
}
.k360-sm__search-clear {
	position: absolute;
	right: 34px;
	top: 50%;
	transform: translateY(calc(-50% - 3px));
	width: 26px;
	height: 26px;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.06);
	border: none;
	border-radius: 50%;
	color: rgba(0, 0, 0, 0.6);
	cursor: pointer;
	transition: background 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__search-clear:hover {
	background: rgba(0, 0, 0, 0.12);
}
.k360-sm__search-clear.is-visible {
	display: inline-flex;
}

/* Quick-search hints */
.k360-sm__search-hints {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 0 24px 14px;
	flex-shrink: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.k360-sm__search-hint-label {
	font-size: 11px;
	font-weight: 600;
	color: rgba(0, 0, 0, 0.45);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-right: 4px;
}
.k360-sm__search-hint {
	display: inline-flex;
	align-items: center;
	padding: 5px 11px;
	background: #f4f5f7;
	border: none;
	border-radius: 999px;
	font-family: inherit;
	font-size: 12px;
	font-weight: 500;
	color: rgba(0, 0, 0, 0.7);
	cursor: pointer;
	transition: background 180ms cubic-bezier(0.23, 1, 0.32, 1),
		color 180ms cubic-bezier(0.23, 1, 0.32, 1),
		transform 100ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__search-hint:hover {
	background: #1a1a1a;
	color: #ffffff;
}
.k360-sm__search-hint:active {
	transform: scale(0.96);
}

.k360-sm__search-results {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 24px 32px;
}
.k360-sm__search-results::-webkit-scrollbar { width: 5px; }
.k360-sm__search-results::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.12);
	border-radius: 6px;
}
.k360-sm__search-results::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.22);
}

.k360-sm__search-empty {
	padding: 56px 24px 24px;
	text-align: center;
	color: rgba(0, 0, 0, 0.4);
	font-size: 14px;
}
.k360-sm__search-empty svg {
	color: rgba(0, 0, 0, 0.15);
	margin-bottom: 16px;
}
.k360-sm__search-empty p {
	margin: 0 0 8px;
}
.k360-sm__search-empty p:last-child {
	margin-bottom: 0;
}
.k360-sm__search-empty-hint {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.4);
	max-width: 320px;
	margin: 8px auto 0 !important;
	line-height: 1.5;
}

.k360-sm__search-section {
	margin-bottom: 28px;
}
.k360-sm__search-section:last-child {
	margin-bottom: 0;
}
.k360-sm__search-section-title {
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: rgba(0, 0, 0, 0.5);
	margin: 0 0 12px;
}

/* Category pills */
.k360-sm__search-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.k360-sm__search-cat-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	background: #f4f5f7;
	color: #1a1a1a;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: background 180ms cubic-bezier(0.23, 1, 0.32, 1),
		color 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__search-cat-pill:hover {
	background: #B22337;
	color: #ffffff;
}
.k360-sm__search-cat-pill span {
	color: rgba(0, 0, 0, 0.4);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
}
.k360-sm__search-cat-pill:hover span {
	color: rgba(255, 255, 255, 0.7);
}

/* Product result rows */
.k360-sm__search-products {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.k360-sm__search-product {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	transition: background 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__search-product:hover {
	background: #faf6f7;
}
.k360-sm__search-product:hover .k360-sm__search-product-name {
	color: #B22337;
}
.k360-sm__search-product-image {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	background: #f4f5f7;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.k360-sm__search-product-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 4px;
	box-sizing: border-box;
}
.k360-sm__search-product-placeholder {
	color: rgba(0, 0, 0, 0.3);
}
.k360-sm__search-product-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.k360-sm__search-product-name {
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: color 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__search-product-meta {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.5);
	font-variant-numeric: tabular-nums;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.k360-sm__search-product-price {
	flex-shrink: 0;
	font-family: 'Archivo', sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: #B22337;
	letter-spacing: -0.01em;
}
.k360-sm__search-product-price .price,
.k360-sm__search-product-price bdi {
	color: #B22337;
}
.k360-sm__search-product-price del {
	color: rgba(0, 0, 0, 0.4);
	font-weight: 400;
	margin-right: 4px;
	font-size: 12px;
}

.k360-sm__search-see-all {
	display: block;
	margin-top: 14px;
	padding: 14px 16px;
	text-align: center;
	background: #1a1a1a;
	color: #ffffff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border-radius: 10px;
	letter-spacing: 0.01em;
	transition: background 180ms cubic-bezier(0.23, 1, 0.32, 1),
		transform 100ms cubic-bezier(0.23, 1, 0.32, 1);
}
.k360-sm__search-see-all:hover {
	background: #B22337;
	color: #ffffff;
}
.k360-sm__search-see-all:active {
	transform: scale(0.99);
}

/* ==========================================================================
   8.  REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.k360-sm__panel,
	.k360-sm__overlay,
	.k360-sm__layer,
	.k360-sm__item,
	.k360-sm__item-chevron,
	.k360-sm__item-image,
	.k360-sm__item-image img,
	.k360-sm__item-name,
	.k360-sm__crumb,
	.k360-sm__tab,
	.k360-sm__tab::after,
	.k360-sm__close,
	.k360-sm-trigger,
	.k360-sm-search-trigger,
	.k360-sm__search-input,
	.k360-sm__search-product,
	.k360-sm__search-product-name,
	.k360-sm__search-cat-pill,
	.k360-sm__search-see-all,
	.k360-sm__search-hint {
		transition: none;
	}
	.k360-sm__item-wrap {
		animation: none;
	}
}

/* ==========================================================================
   9.  MOBILE
   ========================================================================== */

@media (max-width: 640px) {
	.k360-sm__panel {
		width: 100vw;
	}
	.k360-sm__header,
	.k360-sm__tabs {
		padding-left: 18px;
		padding-right: 18px;
	}
	.k360-sm__crumbs,
	.k360-sm__layer,
	.k360-sm__search-bar,
	.k360-sm__search-hints,
	.k360-sm__search-results {
		padding-left: 18px;
		padding-right: 18px;
	}
	.k360-sm__search-icon {
		left: 36px;
	}
	.k360-sm__search-clear {
		right: 28px;
	}
}
