/**
 * Public-facing styles for MS Categories Menu.
 */

.ms-cm-wrapper {
	position: relative;
	max-width: 720px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Intro text box */
.ms-cm-intro-text {
	background: #fbe9ec;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 20px;
	color: #1a1a1a;
	font-size: 15px;
	line-height: 1.5;
}

.ms-cm-intro-text p:last-child {
	margin-bottom: 0;
}

/* Categories nav (pill buttons) */
.ms-cm-categories-nav {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	gap: 10px;
	padding: 4px 8px 12px;
	margin-bottom: 10px;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
	align-items: center;
	scrollbar-width: thin; /* Firefox: show a thin scrollbar */
}

/* WebKit scrollbar styling (visible but subtle) */
.ms-cm-categories-nav::-webkit-scrollbar {
	height: 8px;
}
.ms-cm-categories-nav::-webkit-scrollbar-track {
	background: transparent;
}
.ms-cm-categories-nav::-webkit-scrollbar-thumb {
	background-color: rgba(0,0,0,0.15);
	border-radius: 8px;
}

.ms-cm-cat-btn {
	flex: 0 0 auto;
	background: #f6d9de;
	color: #7a1f2b;
	border: none;
	border-radius: 999px;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
	scroll-snap-align: start;
}

.ms-cm-cat-btn:hover {
	background: #f0c4cc;
}

.ms-cm-cat-btn.ms-cm-cat-btn-active {
	background: #b3123a;
	color: #ffffff;
}

/* Products */
.ms-cm-products-container {
	position: relative;
	min-height: 80px;
}

.ms-cm-category-heading {
	font-size: 20px;
	font-weight: 700;
	margin: 18px 0 10px;
	color: #1a1a1a;
}

.ms-cm-products-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ms-cm-product-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #ffffff;
	border: 1px solid #f0e0e2;
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 12px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

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

.ms-cm-product-name {
	font-weight: 600;
	color: #1a1a1a;
	text-decoration: none;
	font-size: 15px;
}

.ms-cm-product-name:hover {
	text-decoration: underline;
}

.ms-cm-product-price {
	color: #b3123a;
	font-weight: 600;
	font-size: 14px;
}

.ms-cm-product-add a.button,
.ms-cm-product-add button.button {
	background: #b3123a;
	color: #ffffff;
	border-radius: 999px;
	padding: 8px 18px;
	font-weight: 600;
	font-size: 13px;
	border: none;
	white-space: nowrap;
}

.ms-cm-product-add a.button:hover,
.ms-cm-product-add button.button:hover {
	background: #8f0e2f;
	color: #ffffff;
}

.ms-cm-product-add a.added::after {
	content: "\2713";
	margin-left: 6px;
}

.ms-cm-no-products {
	text-align: center;
	color: #6b6b6b;
	padding: 30px 0;
}

/* Drag-to-scroll styling */
.ms-cm-categories-nav.ms-cm-dragging {
	cursor: grabbing !important;
	user-select: none; /* avoid selecting text while dragging */
}

/* Pagination */
.ms-cm-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
}

.ms-cm-page-btn {
	background: #f6d9de;
	color: #7a1f2b;
	border: none;
	border-radius: 6px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.ms-cm-page-btn:hover {
	background: #f0c4cc;
}

.ms-cm-page-btn.ms-cm-page-active {
	background: #b3123a;
	color: #ffffff;
}

/* Loading state */
.ms-cm-products-container.ms-cm-loading .ms-cm-products-list,
.ms-cm-products-container.ms-cm-loading .ms-cm-pagination {
	opacity: 0.4;
	pointer-events: none;
}

.ms-cm-spinner {
	display: block;
	margin: 20px auto;
	width: 28px;
	height: 28px;
	border: 3px solid #f0e0e2;
	border-top-color: #b3123a;
	border-radius: 50%;
	animation: ms-cm-spin 0.8s linear infinite;
}

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

.ms-cm-product-add .added_to_cart{
  color: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.ms-cm-product-add a.button.loading {
  justify-content: center;
  display: inline-flex !important;
  padding-right: 15px !important;
  align-items: center;
}

.ms-cm-product-add a.button.loading::after {
  font-family: WooCommerce;
  content: "\e01c";
  font-weight: 400;
	margin-left: 5px;
  position: unset !important;
	animation: spin 2s linear infinite;
}