/* MoulFood layout fixed v3 */

/* =============================================
   TOP SELLERS - Horizontal Scroll Section
   ============================================= */
.top-sellers-section {
	margin-bottom: 30px;
	padding: 0 0 18px;
	border-bottom: none;
}

.top-sellers-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}

.top-sellers-nav-arrows {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.ts-nav-arrow {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid transparent;
	background: #f1f1f3;
	color: var(--color-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ts-nav-arrow:hover {
	background: #fff7ed;
	border-color: #fed7aa;
	color: var(--color-primary-700);
	transform: translateY(-1px);
}

.top-sellers-scroll {
	display: flex;
	overflow-x: auto;
	overflow-y: visible; /* Try to keep vertical visible */
	gap: 16px;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 2px 0 16px;
	scroll-padding-inline: 10px;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.top-sellers-scroll::-webkit-scrollbar {
	display: none;
}

/* Each Top Seller item — larger and elegant */
.top-seller-item {
	flex: 0 0 158px;
	max-width: 158px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	position: relative;
	padding-bottom: 2px;
	box-sizing: border-box;
}

/* Image wrapper with overlapping + button */
.top-seller-image-wrapper {
	width: 158px;
	height: 158px;
	border-radius: 12px;
	overflow: visible;
	background: transparent;
	margin-bottom: 18px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: none;
}

.top-seller-image-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 12px;
}

@media (min-width: 981px) and (max-width: 1180px) {
	.top-seller-item {
		flex-basis: calc((100% - 32px) / 3);
		max-width: calc((100% - 32px) / 3);
	}

	.top-seller-image-wrapper {
		width: 100%;
		height: auto;
		aspect-ratio: 1;
	}
}

@media (min-width: 1181px) {
	.top-seller-item {
		flex-basis: calc((100% - 48px) / 4);
		max-width: calc((100% - 48px) / 4);
	}

	.top-seller-image-wrapper {
		width: 100%;
		height: auto;
		aspect-ratio: 1;
	}
}

/* + button overlay — bottom-right of image */
.top-seller-action-overlay {
	position: absolute;
	bottom: -15px;
	right: 10px;
	z-index: 10;
}

html[dir="rtl"] .top-seller-action-overlay {
	right: auto;
	left: 10px;
}

/* The + button inside top sellers */
.top-seller-action-overlay .btn-circle-add {
	width: 36px;
	height: 36px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

/* Mini Quantity Controller (appears when product is in cart) */
.mini-qty-controller {
	display: inline-flex;
	align-items: center;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: 20px;
	height: 34px;
	padding: 0 4px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	gap: 2px;
}

.mini-qty-controller .qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 0;
	background: transparent;
	padding: 0;
	color: var(--color-text);
	cursor: pointer;
	transition: background 0.15s ease;
	text-decoration: none;
}

.mini-qty-controller .qty-btn:hover {
	background: var(--color-background-alt);
}

.top-seller-action-overlay .mini-qty-controller .qty-minus,
.product-card .mini-qty-controller .qty-minus,
.product-row .mini-qty-controller .qty-minus,
.restaurant-search-results .mini-qty-controller .qty-minus {
	display: none !important;
}

.top-seller-item .cart-item-remove,
.top-seller-item .remove,
.product-row .cart-item-remove,
.restaurant-search-results .cart-item-remove {
	display: none !important;
}

.mini-qty-controller .qty-val {
	font-weight: 700;
	font-size: 14px;
	min-width: 18px;
	text-align: center;
	color: var(--color-text);
}

.top-seller-action-overlay .mini-qty-controller .qty-val,
.product-card .mini-qty-controller .qty-val,
.product-row .mini-qty-controller .qty-val,
.restaurant-search-results .mini-qty-controller .qty-val {
	display: none !important;
}

/* Product name under the image */
.top-seller-title {
	font-size: 0.95rem;
	font-weight: 700;
	margin: 0 0 7px 0;
	color: var(--color-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.3;
	min-height: 2.6em;
	overflow-wrap: anywhere;
	text-decoration: none;
}

.top-seller-title a {
	color: inherit;
	text-decoration: none;
}

/* Price under the name */
.top-seller-price {
	font-weight: 650;
	font-size: 0.94rem;
	color: var(--color-text);
	margin-top: auto;
	padding-top: 2px;
	line-height: 1.3;
	white-space: nowrap;
}


/* =============================================
   PRODUCT ROWS — Horizontal list items
   ============================================= */
.product-list {
	display: flex;
	flex-direction: column;
	background: transparent;
	border: none;
	border-radius: 0;
	overflow: hidden;
}

.restaurant-search-results[hidden],
.is-search-hidden {
	display: none !important;
}

.restaurant-search-results {
	margin-bottom: 32px;
}

.restaurant-search-status {
	padding: 28px 0;
	color: var(--color-text-secondary);
	font-weight: 600;
	border-bottom: 1px solid var(--color-border);
}

.restaurant-search-error {
	color: var(--color-error-500);
}

.product-row {
	display: flex;
	align-items: center;
	background: transparent;
	padding: 17px 0;
	border-bottom: 1px solid var(--color-border);
	transition: background 0.18s ease;
}

.product-row:hover {
	background: transparent;
}

.product-row:last-child {
	border-bottom: none;
}

/* Product image — left side */
.product-row-image {
	width: 104px;
	height: 104px;
	flex-shrink: 0;
	border-radius: 10px;
	overflow: hidden;
	background: transparent;
	margin-right: 16px;
}

html[dir="rtl"] .product-row-image {
	margin-right: 0;
	margin-left: 16px;
}

.product-row-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

/* Content area — name + description */
.product-row-content {
	flex: 1;
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	min-width: 0;
	min-height: 104px;
	gap: 18px;
}

.product-row-info {
	flex: 1;
	min-width: 0;
	padding: 2px 0;
}

.product-row-title {
	font-size: 1rem;
	font-weight: 750;
	margin: 0 0 6px 0;
	color: var(--color-text);
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}

.product-row-title a {
	color: inherit;
	text-decoration: none;
}

.product-row-desc {
	font-size: 0.88rem;
	color: var(--color-text-secondary);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.product-row-desc p {
	display: inline;
	margin: 0;
}

/* Price + button — right side, stacked vertically */
.product-row-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	gap: 10px;
	flex-shrink: 0;
	min-width: 128px;
	min-height: 104px;
	padding: 2px 0;
	box-sizing: border-box;
}

.product-row-price {
	font-weight: 750;
	font-size: 0.98rem;
	color: var(--color-text);
	white-space: nowrap;
	line-height: 1.35;
	text-align: right;
}

.product-row-add {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	min-height: 36px;
}


/* =============================================
   CIRCULAR + BUTTON (shared)
   ============================================= */
.btn-circle-add {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background-color: var(--color-white) !important;
	border: 1px solid var(--color-border) !important;
	transition: all 0.2s ease;
	position: relative;
	overflow: hidden;
	color: var(--color-text) !important;
	font-size: 24px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	text-indent: 0;
	box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
}

.btn-circle-add::before {
	content: none;
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: currentColor;
	font-size: 24px;
	font-weight: 500;
	line-height: 1;
	transition: all 0.2s ease;
}

.btn-circle-add-symbol {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: currentColor;
	font-size: 24px;
	font-weight: 500;
	line-height: 1;
	text-indent: 0;
}

.btn-circle-add:hover {
	background-color: var(--color-primary-500) !important;
	border-color: var(--color-primary-500) !important;
	color: var(--color-white) !important;
	transform: translateY(-1px);
}

.btn-circle-add.is-disabled,
.btn-circle-add:disabled,
.mini-qty-controller .qty-btn.is-disabled,
.mini-qty-controller .qty-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
	transform: none !important;
}

.btn-circle-add.is-disabled:hover,
.btn-circle-add:disabled:hover {
	background-color: var(--color-white) !important;
	border-color: var(--color-border) !important;
}

.btn-circle-add:hover::before {
	color: var(--color-white);
}

/* Ensure any SVG injected via HTML is hidden to avoid duplicates */
.btn-circle-add svg {
	display: none !important;
}

/* Hide native WooCommerce View Cart link that appears after AJAX add */
a.added_to_cart {
	display: none !important;
}

/* Text Add Button */
.btn-add-text {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 16px;
	border-radius: 20px;
	background: var(--color-primary);
	color: var(--color-white);
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.2s ease;
	border: 1px solid var(--color-primary);
	min-width: 80px;
}

.btn-add-text:hover {
	background: var(--color-primary-700);
	color: var(--color-white);
	border-color: var(--color-primary-700);
}

/* Loading state */
.btn-circle-add.loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
	color: transparent !important;
}

.btn-circle-add.loading::before {
	opacity: 0;
}

.btn-circle-add.loading::after {
	content: "";
	position: absolute;
	width: 16px;
	height: 16px;
	border: 2px solid var(--color-text);
	border-top-color: transparent;
	border-radius: 50%;
	animation: mf-spin 0.7s linear infinite;
}

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


/* =============================================
   MOBILE ADJUSTMENTS
   ============================================= */
@media (max-width: 768px) {
	.top-sellers-section {
		margin-top: 12px;
		margin-bottom: 30px;
		padding-bottom: 18px;
	}

	.top-sellers-header {
		gap: 12px;
		margin-bottom: 16px;
	}

	.top-sellers-header .category-title {
		font-size: 1.2rem;
		line-height: 1.2;
	}

	.top-sellers-nav-arrows {
		gap: 8px;
	}

	.ts-nav-arrow {
		width: 36px;
		height: 36px;
	}

	.top-sellers-scroll {
		gap: 14px;
		padding: 2px 6px 14px;
		margin-left: -6px;
		margin-right: -6px;
	}

	.top-seller-item {
		flex: 0 0 136px;
		max-width: 136px;
	}

	.top-seller-image-wrapper {
		width: 136px;
		height: 136px;
		border-radius: 10px;
	}

	.top-seller-title {
		font-size: 14px;
		line-height: 1.25;
	}

	.top-seller-price {
		font-size: 13px;
	}

	.product-row {
		align-items: center;
		padding: 15px 0;
		border-radius: 0;
	}

	.product-list {
		border-left: none;
		border-right: none;
		border-radius: 0;
		margin-left: -14px;
		margin-right: -14px;
		padding-left: 14px;
		padding-right: 14px;
	}

	.product-row-image {
		width: 84px;
		height: 84px;
		border-radius: 9px;
		margin-right: 12px;
	}

	html[dir="rtl"] .product-row-image {
		margin-right: 0;
		margin-left: 12px;
	}

	.product-row-actions {
		min-height: 84px;
		min-width: 74px;
		flex-direction: column;
		align-items: flex-end;
		justify-content: space-between;
		gap: 7px;
	}

	.product-row-content {
		min-height: 84px;
		gap: 10px;
		align-items: stretch;
	}

	.product-row-title {
		font-size: 15px;
		margin-bottom: 5px;
	}

	.product-row-desc {
		font-size: 0.82rem;
		line-height: 1.35;
		-webkit-line-clamp: 2;
	}

	.product-row-price {
		font-size: 0.88rem;
		line-height: 1.2;
		text-align: right;
	}

	.btn-circle-add {
		width: 36px !important;
		height: 36px !important;
		min-width: 36px !important;
	}

	.top-seller-action-overlay .btn-circle-add {
		width: 34px !important;
		height: 34px !important;
		min-width: 34px !important;
	}
}

@media (max-width: 430px) {
	.top-seller-item {
		flex-basis: 128px;
		max-width: 128px;
	}

	.top-seller-image-wrapper {
		width: 128px;
		height: 128px;
		margin-bottom: 17px;
	}

	.top-sellers-scroll {
		gap: 16px;
	}
}

@media (max-width: 380px) {
	.top-seller-item {
		flex-basis: 122px;
		max-width: 122px;
	}

	.top-seller-image-wrapper {
		width: 122px;
		height: 122px;
	}

	.product-list {
		margin-left: -12px;
		margin-right: -12px;
		padding-left: 12px;
		padding-right: 12px;
	}

	.product-row-image {
		width: 78px;
		height: 78px;
		margin-right: 10px;
	}

	html[dir="rtl"] .product-row-image {
		margin-left: 10px;
	}

	.product-row-content {
		min-height: 78px;
		gap: 8px;
	}

	.product-row-actions {
		min-height: 78px;
		min-width: 64px;
	}

	.product-row-title {
		font-size: 14px;
	}

	.product-row-desc {
		font-size: 0.78rem;
	}

	.product-row-price {
		font-size: 0.82rem;
	}
}
