/* ============================================
   Cuisinart Recipes Toolkit - Frontend Styles
   ============================================ */

/* ---- Related Products Grid ---- */
.crt-products-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	width: 100%;
}

.crt-product-card {
	display: flex;
	border: 1px solid #d1d5d0;
	border-radius: 20px;
	overflow: hidden;
	background: #fff;
	border-style: solid;
	transition: border-color 0.3s ease;
}

.crt-product-card:hover {
	box-shadow: none;
}

.crt-product-card--horizontal {
	flex-direction: row;
	align-items: center;
}
.crt-product-card--vertical {
	flex-direction: column;
}

.crt-product-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	box-shadow: none !important;
}
.crt-product-card--horizontal .crt-product-card__image {
	width: 45%;
	flex: 0 0 45%;
}
.crt-product-card--vertical .crt-product-card__image {
	width: 100%;
}
.crt-product-card__image img {
	width: 100%;
	height: auto;
	object-fit: contain;
	max-width: 100%;
	background: transparent !important;
	box-shadow: none !important;
}

.crt-product-card__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex: 1;
	gap: 4px;
}

.crt-product-card__title {
	font-size: 1.25rem;
	font-weight: 700;
	color: #233C28;
	margin: 0 0 8px 0;
	line-height: 1.3;
}

.crt-product-card__price {
	font-size: 1.5rem;
	color: #1A1816;
	font-weight: 400;
	margin: 0 0 16px 0;
}

.crt-product-card__btn {
	display: inline-block;
	padding: 12px 32px;
	border: 1px solid #233C28;
	border-radius: 10px;
	background: transparent;
	color: #233C28;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	text-align: center;
	transition: all 0.3s ease;
	align-self: flex-start;
}
.crt-product-card__btn:hover {
	background: #233C28;
	color: #fff;
}

/* ---- Recipes UI Grid ---- */
.crt-recipes-grid {
	display: grid;
	gap: 20px;
	width: 100%;
}

.crt-recipe-card {
	border: 1px solid #d1d5d0;
	border-style: solid;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.crt-recipe-card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.crt-recipe-card.crt-hidden {
	display: none;
}

.crt-recipe-card__link {
	text-decoration: none;
	color: inherit;
	display: block;
	height: 100%;
}

.crt-recipe-card__inner {
	display: flex;
	flex-direction: row;
	height: 100%;
}

.crt-recipe-card__text {
	flex: 1;
	padding: 16px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}

.crt-recipe-card__title {
	font-size: 1.1rem;
	font-weight: 700;
	color: #233C28;
	margin: 0 0 6px 0;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.crt-recipe-card__excerpt {
	font-size: 0.9rem;
	color: #1A1816;
	margin: 0 0 8px 0;
	line-height: 1.5;
}

.crt-recipe-card__acf {
	font-size: 0.85rem;
	color: #666;
	margin: 0;
	line-height: 1.4;
}
.crt-recipe-card__acf-label {
	font-weight: 600;
	color: #233C28;
}

.crt-recipe-card__image {
	position: relative;
	width: 50%;
	flex: 0 0 50%;
	min-height: 160px;
}
.crt-recipe-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.crt-no-results {
	text-align: center;
	color: #999;
	font-style: italic;
	grid-column: 1 / -1;
	padding: 40px 20px;
}

/* ---- Filter Accordion ---- */
.crt-filter-accordion {
	width: 100%;
}

.crt-filter-item {
	border-bottom: 1px solid #d1d5d0;
	border-bottom-style: solid;
}

.crt-filter-item__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.2s ease;
}

.crt-filter-item__title {
	font-size: 1rem;
	font-weight: 400;
	color: #233C28;
	transition: color 0.2s ease;
}

.crt-filter-item__icon {
	font-size: 24px;
	font-weight: 300;
	color: #233C28;
	line-height: 1;
	transition: transform 0.3s ease, color 0.2s ease;
}

.crt-filter-item__terms {
	display: none;
	flex-direction: column;
	gap: 8px;
	padding: 8px 0 16px 0;
	animation: crtSlideDown 0.3s ease;
}

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

.crt-filter-term {
	display: flex;
	align-items: center;
	gap: 8px;
}
.crt-filter-term input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: #233C28;
	cursor: pointer;
	margin: 0;
}
.crt-filter-term label {
	cursor: pointer;
	font-size: 0.95rem;
	color: #1A1816;
	line-height: 1;
	transition: color 0.2s ease;
}
.crt-filter-term__count {
	color: #999;
	font-size: 0.85rem;
}

/* ---- Search ---- */
.crt-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	box-sizing: border-box;
	border: none;
	background: transparent;
	padding: 0;
}

.crt-search-wrap--icon-left .crt-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
}
.crt-search-wrap--icon-right .crt-search-icon {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
}

.crt-search-icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	pointer-events: none;
}
.crt-search-icon svg {
	width: 18px;
	height: 18px;
	stroke: #999;
	fill: none;
}

.crt-search-input {
	border: 1px solid #d1d5d0;
	border-style: solid;
	border-radius: 8px;
	outline: none;
	background: #fff;
	font-size: 1rem;
	color: #1A1816;
	width: 100%;
	padding: 12px 16px 12px 40px;
	box-sizing: border-box;
	transition: border-color 0.3s ease;
}
.crt-search-input:focus {
	border-color: #233C28;
}
.crt-search-input::placeholder {
	color: #999;
}

/* ---- Search Recommendations ---- */
.crt-search-recommendations {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #d1d5d0;
	border-top: none;
	border-radius: 0 0 8px 8px;
	z-index: 100;
	max-height: 300px;
	overflow-y: auto;
	box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.crt-search-recommendations.active {
	display: block;
}

.crt-search-rec-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	cursor: pointer;
	text-decoration: none;
	color: #1A1816;
	transition: background-color 0.15s ease;
	border-bottom: 1px solid #f0f0f0;
}
.crt-search-rec-item:last-child {
	border-bottom: none;
}
.crt-search-rec-item:hover {
	background-color: #f5f5f5;
}
.crt-search-rec-item__thumb {
	width: 40px;
	height: 40px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
}
.crt-search-rec-item__title {
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.3;
}
.crt-search-rec-none {
	padding: 12px 16px;
	color: #999;
	font-style: italic;
	font-size: 0.9rem;
}

/* ---- Showing Dropdown ---- */
.crt-showing-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
}
.crt-showing-label {
	font-size: 0.9rem;
	font-weight: 500;
	color: #999;
}
.crt-showing-select {
	padding: 10px 16px;
	border: 1px solid #d1d5d0;
	border-style: solid;
	border-radius: 6px;
	background: #fff;
	color: #1A1816;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	outline: none;
	appearance: auto;
	min-width: 160px;
}
.crt-showing-select:focus {
	border-color: #233C28;
}

/* ---- Paged Hidden (infinite scroll) ---- */
.crt-recipe-card.crt-paged-hidden {
	display: none;
}

/* ---- Sort By ---- */
.crt-sort-wrap {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
}

.crt-sort-label {
	font-size: 0.95rem;
	font-weight: 500;
	color: #233C28;
	white-space: nowrap;
}

.crt-sort-select {
	padding: 10px 16px;
	border: 1px solid #d1d5d0;
	border-style: solid;
	border-radius: 6px;
	background: #fff;
	color: #1A1816;
	font-size: 0.95rem;
	cursor: pointer;
	outline: none;
	appearance: auto;
	width: 200px;
}
.crt-sort-select:focus {
	border-color: #233C28;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
	.crt-product-card--horizontal {
		flex-direction: row;
	}
	.crt-product-card--horizontal .crt-product-card__image {
		width: 40%;
		flex: 0 0 40%;
	}
	.crt-product-card__content {
		padding: 12px;
		gap: 6px;
	}
	.crt-product-card__title {
		font-size: 1rem;
	}
	.crt-product-card__price {
		font-size: 1.15rem;
		margin: 0 0 8px 0;
	}
	.crt-product-card__btn {
		padding: 8px 16px;
		font-size: 0.85rem;
	}
}

/* ============================================
   Vertical Recipe Grid
   ============================================ */
.crt-vgrid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	width: 100%;
}

.crt-vcard {
	display: flex;
	flex-direction: column;
	border: none;
	border-radius: 5px;
	overflow: hidden;
	background: transparent;
	box-shadow: none !important;
}
.crt-vcard:hover {
	box-shadow: none !important;
}

/* ---- Loading State ---- */
.crt-loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}
.crt-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid #e5e5e5;
	border-top-color: #233C28;
	border-radius: 50%;
	animation: crt-spin 0.8s linear infinite;
}
@keyframes crt-spin {
	to { transform: rotate(360deg); }
}

.crt-vcard__image {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 5px;
}
.crt-vcard__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 5px;
}


.crt-vcard__content {
	display: flex;
	flex-direction: column;
	padding: 20px;
	flex: 1;
}

.crt-vcard__category {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: #666;
	text-transform: uppercase;
	margin: 0 0 8px 0;
	line-height: 1;
	transition: color 0.2s ease;
}

.crt-vcard__title-link {
	text-decoration: none;
	color: inherit;
}
.crt-vcard__title {
	font-size: 1.25rem;
	font-weight: 700;
	color: #1A1816;
	margin: 0;
	line-height: 1.3;
	transition: color 0.2s ease;
}

@media (max-width: 767px) {
	.crt-vgrid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	.crt-vcard__content {
		padding: 12px;
	}
	.crt-vcard__title {
		font-size: 1rem;
	}
	.crt-vcard__category {
		font-size: 0.7rem;
	}
}
