/* product-category.css */
.categories-section {
	padding: 5rem 1.5rem;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

.section-intro { grid-column: 1 / -1; width: 100%; max-width: 680px; margin: 0 auto 1.25rem; text-align: center; }
.section-kicker { color: var(--brand-green-dark); margin-bottom: 0.65rem; }
.section-intro h2 { font-family: var(--fonte-display); font-size: clamp(1.75rem, 3vw, 2.8rem); line-height: 1.08; letter-spacing: -0.04em; margin: 0 auto 0.85rem; text-wrap: balance; }
.section-intro > p:last-child { color: var(--gray-700); max-width: 42ch; margin: 0 auto; font-size: 0.95rem; line-height: 1.55; }

.category-item {
	width: auto;
	min-width: 0;
	grid-column: span 1;
}

.category-card {
	position: relative;
	width: 100%;
	height: 430px;
	border-radius: 22px;
	overflow: hidden;
	list-style: none;
	cursor: pointer;
}

.category-card::-webkit-details-marker {
	display: none;
}

.category-card::marker {
	display: none;
}

.category-card .category-name {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	width: auto;
	height: auto;
	min-width: 160px;
	min-height: 48px;
	max-width: calc(100% - 40px);

	/* O summary ocupa todo o card e mantém o botão centralizado. */
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 10px 24px;
	border-radius: 30px;
	background-color: var(--white);
	color: var(--brand-forest);
	font-size: 1.05rem;
	font-weight: 700;
	text-align: center;
	line-height: 1.25;
	white-space: nowrap;
	box-sizing: border-box;
	transition: background-color 300ms cubic-bezier(0.32, 0.72, 0, 1), color 300ms cubic-bezier(0.32, 0.72, 0, 1), transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.category-card:hover .category-name,
.category-card:focus-visible .category-name {
	background-color: var(--brand-green);
	color: var(--brand-dark);
	transform: translate(-50%, -50%) translateY(-2px);
	box-shadow: 0 10px 24px rgba(23, 35, 29, 0.18);
}

.fertilizantes > .category-card {
	background: url(../../images/banners/fertilizantes-secao.png) no-repeat center;
	background-size: cover;
}

.adubos > .category-card {
	background: url(../../images/banners/adubos-secao.jpeg) no-repeat center;
	background-size: cover;
}

.defensivos > .category-card {
	background: url(../../images/banners/defensivos-secao.jpeg) no-repeat center;
	background-size: cover;
}

.implementos > .category-card {
	background: url(../../images/banners/implementos-secao.jpg) no-repeat center;
	background-size: cover;
}

.category-item[open] {
	grid-column: 1 / -1;
}

.category-item[open] .category-card {
	height: 11.25rem;
	margin-bottom: 30px;
}

.category-link {
	display: block;
	position: absolute;
	inset: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.overlay{
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(13, 26, 18, 0.05), rgba(13, 26, 18, 0.72));
	z-index: 1;
}

.catalog-panel {
	width: 100%;
	padding: clamp(1.5rem, 3vw, 2.5rem);
	border-top: 3px solid var(--brand-orange);
	background: #e8ecdf;
	animation: catalog-reveal 0.3s ease-out;
}

.catalog-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 24px;
}

.catalog-kicker {
	margin: 0 0 5px;
	color: var(--brand-green-dark);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.catalog-title {
	font-family: var(--fonte-display);
	margin: 0;
	color: var(--brand-dark);
	font-size: clamp(1.7rem, 3vw, 2.3rem);
	letter-spacing: -0.03em;
}

.catalog-close {
	padding: 9px 16px;
	border: 1px solid var(--gray-400);
	border-radius: 6px;
	background: var(--white);
	color: var(--brand-dark);
	cursor: pointer;
}

.catalog-close:hover,
.catalog-close:focus-visible {
	border-color: var(--brand-green-dark);
	color: var(--brand-green-dark);
}

.product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 18px;
}

.product-card {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 7px;
	padding-bottom: 14px;
	border: 1px solid #e0e5dc;
	border-radius: 12px;
	background: var(--white);
	color: var(--brand-dark);
	overflow: hidden;
	transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.product-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 18px rgba(31, 41, 29, 0.12);
}

.product-card img {
	width: 100%;
	height: 160px;
	object-fit: contain;
	padding: 10px 10px 0;
}

.product-card span,
.product-card small {
	padding: 0 14px;
	white-space: pre-line;
	text-align: center;
}

.product-card span {
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1.3;
}

.add-to-cart {
	margin: auto 14px 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 5px;
	background: var(--brand-green-dark);
	color: var(--white);
	cursor: pointer;
	font-weight: 700;
}

.add-to-cart:hover,
.add-to-cart:focus-visible {
	background: var(--brand-dark);
}

.product-information-link {
	display: block;
	text-align: center;
	text-decoration: none;
}

.product-card small {
	color: var(--gray-900);
	font-size: 0.875rem;
	line-height: 1.35;
}

@keyframes catalog-reveal {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1000px) {
	.categories-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.categories-section { padding: 3.5rem 1rem; }
	.categories-section { grid-template-columns: minmax(0, 1fr); }
	.category-item { grid-column: 1 / -1; }
	.category-card { height: 300px; }
	.category-card .category-name { font-size: 1rem; }
}

.cart-panel {
	position: fixed;
	z-index: 1002;
	top: 0;
	right: 0;
	display: flex;
	width: min(420px, 100%);
	height: 100vh;
	flex-direction: column;
	padding: 28px;
	background: var(--white);
	box-shadow: -8px 0 30px rgba(31, 41, 29, 0.2);
	transform: translateX(100%);
	transition: transform 0.3s ease;
}

.cart-panel.is-open {
	transform: translateX(0);
}

.cart-header,
.cart-footer p,
.cart-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.cart-header {
	border-bottom: 1px solid var(--gray-300);
	padding-bottom: 18px;
}

.cart-header h2 {
	margin: 0;
}

.cart-close {
	border: 0;
	background: transparent;
	font-size: 1.8rem;
	cursor: pointer;
}

.cart-empty {
	color: var(--gray-500);
}

.cart-items {
	display: flex;
	margin: 0;
	padding: 0;
	flex-direction: column;
	gap: 14px;
	list-style: none;
	overflow-y: auto;
}

.cart-item {
	flex-wrap: wrap;
	padding-bottom: 14px;
	border-bottom: 1px solid #e5e7eb;
}

.cart-item > span {
	font-weight: 700;
}

.quantity-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

.quantity-controls button,
.remove-item {
	border: 1px solid var(--gray-300);
	border-radius: 4px;
	background: var(--white);
	cursor: pointer;
}

.quantity-controls button {
	width: 28px;
	height: 28px;
}

.remove-item {
	padding: 5px 8px;
	color: #b42318;
	font-size: 0.75rem;
}

.cart-footer {
	margin-top: auto;
	border-top: 1px solid var(--gray-300);
	padding-top: 18px;
}

.cart-footer p {
	margin: 0 0 16px;
}

.whatsapp-order {
	width: 100%;
	padding: 13px;
	border: 0;
	border-radius: 5px;
	background: var(--brand-green-dark);
	color: var(--white);
	cursor: pointer;
	font-weight: 700;
}

.whatsapp-order:disabled {
	background: var(--gray-300);
	cursor: not-allowed;
}

.cart-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1001;
	background: rgba(0, 0, 0, 0.4);
}

body.cart-is-open {
	overflow: hidden;
}

@media (max-width:700px) {
	.category-item {
		width: 100%;
		flex-basis: 100%;
	}

	.catalog-panel {
		padding: 24px 16px;
	}

	.catalog-title {
		font-size: 1.6rem;
	}

	.product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.product-card img {
		height: 130px;
		padding: 8px 8px 0;
	}
}
