/* ==========================================================================
   Sorvepatri - estilos complementares ao theme.json
   ========================================================================== */

:root {
	--sp-onda-altura: clamp(28px, 4vw, 56px);
	--sp-onda: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V30C1320 70 1200 70 1080 40C960 10 840 10 720 40C600 70 480 70 360 40C240 10 120 10 0 40Z'/%3E%3C/svg%3E");
	--sp-radius-card: var(--wp--custom--radius--card, 28px);
	--sp-sombra: var(--wp--preset--shadow--suave);
}

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

:where(.wp-site-blocks) > main {
	min-height: 50vh;
}

/* Cabeçalho fixo
   ========================================================================== */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
}

.sp-header {
	box-shadow: 0 6px 20px -16px rgba(74, 44, 42, 0.5);
}

.sp-marca {
	flex-shrink: 0;
}

.sp-marca .wp-block-site-logo img {
	height: auto;
	transition: transform 0.2s ease;
}

.sp-marca .wp-block-site-logo a:hover img {
	transform: rotate(-3deg) scale(1.04);
}

@media (max-width: 599px) {
	.sp-marca .wp-block-site-logo img {
		width: 96px;
	}
}

.sp-logo-rodape {
	margin-block-end: var(--wp--preset--spacing--30);
}

.sp-header .wp-block-navigation__container {
	flex-wrap: nowrap;
	white-space: nowrap;
}

.sp-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50);
}

.sp-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	font-size: var(--wp--preset--font-size--x-large);
	gap: 1rem;
}

@media (max-width: 1079px) {
	.sp-header .sp-header-cta {
		display: none;
	}
}

@media (min-width: 600px) and (max-width: 899px) {
	.sp-header .wp-block-navigation {
		font-size: 0.95rem;
	}

	.sp-header .wp-block-navigation .wp-block-navigation__container {
		gap: 1rem !important;
	}
}

/* Divisores em onda (estilos de bloco do Grupo)
   ========================================================================== */

.is-style-onda-base,
.is-style-onda-topo,
.is-style-onda-ambas {
	position: relative;
}

.is-style-onda-base::after,
.is-style-onda-ambas::after,
.is-style-onda-topo::before,
.is-style-onda-ambas::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: var(--sp-onda-altura);
	background: inherit;
	-webkit-mask: var(--sp-onda) center / 100% 100% no-repeat;
	mask: var(--sp-onda) center / 100% 100% no-repeat;
	pointer-events: none;
	z-index: 2;
}

.is-style-onda-base::after,
.is-style-onda-ambas::after {
	top: calc(100% - 1px);
}

.is-style-onda-topo::before,
.is-style-onda-ambas::before {
	bottom: calc(100% - 1px);
	transform: scaleY(-1);
}

/* Divisor avulso: uma faixa em onda colorida entre duas seções */
.sp-onda-divisor {
	height: var(--sp-onda-altura);
	-webkit-mask: var(--sp-onda) center / 100% 100% no-repeat;
	mask: var(--sp-onda) center / 100% 100% no-repeat;
	margin-block: 0 !important;
}

/* Cards
   ========================================================================== */

.is-style-card {
	border-radius: var(--sp-radius-card);
	box-shadow: var(--sp-sombra);
	overflow: hidden;
}

.is-style-card:not(.has-background) {
	background: var(--wp--preset--color--branco);
}

.is-style-card-pop {
	border-radius: var(--sp-radius-card);
	border: 3px solid var(--wp--preset--color--chocolate);
	box-shadow: 6px 6px 0 0 var(--wp--preset--color--chocolate);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.is-style-card-pop:hover {
	transform: translate(-2px, -2px);
	box-shadow: 8px 8px 0 0 var(--wp--preset--color--chocolate);
}

.sp-selo {
	display: inline-block;
	padding: 0.3em 0.9em;
	border-radius: 999px;
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.sp-selo.has-text-align-center {
	display: table;
	margin-inline: auto !important;
}

/* Imagem flutuando
   ========================================================================== */

.is-style-flutuante img {
	animation: sp-flutuar 5s ease-in-out infinite;
	filter: drop-shadow(0 24px 24px rgba(74, 44, 42, 0.18));
	border-radius: 0 !important;
}

.is-style-flutuante:nth-child(2n) img {
	animation-delay: -2.5s;
}

@keyframes sp-flutuar {
	0%,
	100% {
		transform: translateY(0) rotate(-3deg);
	}
	50% {
		transform: translateY(-16px) rotate(3deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.is-style-flutuante img {
		animation: none;
	}
}

.sp-ilustra img {
	border-radius: 0 !important;
}

/* Hero
   ========================================================================== */

.sp-hero {
	overflow: visible;
}

.sp-hero .sp-hero-arte {
	position: relative;
}

.sp-hero .sp-hero-arte::before {
	content: "";
	position: absolute;
	inset: 8% 6%;
	border-radius: 50%;
	background: var(--wp--preset--color--baunilha);
	opacity: 0.55;
	z-index: 0;
}

.sp-hero .sp-hero-arte > * {
	position: relative;
	z-index: 1;
}

.sp-granulado {
	background-image:
		radial-gradient(circle at 12% 18%, var(--wp--preset--color--morango) 0 4px, transparent 5px),
		radial-gradient(circle at 82% 12%, var(--wp--preset--color--menta) 0 5px, transparent 6px),
		radial-gradient(circle at 70% 78%, var(--wp--preset--color--ceu) 0 4px, transparent 5px),
		radial-gradient(circle at 28% 84%, var(--wp--preset--color--baunilha) 0 6px, transparent 7px),
		radial-gradient(circle at 92% 52%, var(--wp--preset--color--morango) 0 3px, transparent 4px),
		radial-gradient(circle at 6% 60%, var(--wp--preset--color--ceu) 0 3px, transparent 4px);
}

/* Carrossel de sabores (rolagem com scroll-snap + setas via JS)
   ========================================================================== */

.sp-carrossel-wrap {
	position: relative;
}

.sp-carrossel.wp-block-group {
	display: flex;
	flex-wrap: nowrap;
	gap: 1.25rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 4px;
	padding: 0.5rem 4px 1.5rem;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--morango) transparent;
	-webkit-overflow-scrolling: touch;
}

.sp-carrossel > * {
	flex: 0 0 min(260px, 78%);
	scroll-snap-align: start;
	margin: 0 !important;
}

.sp-sabor {
	text-align: center;
}

.sp-sabor .wp-block-image {
	margin-inline: auto;
}

.sp-sabor .wp-block-image img {
	height: 170px;
	width: auto;
	object-fit: contain;
	transition: transform 0.3s ease;
	border-radius: 0 !important;
}

.sp-sabor:hover .wp-block-image img {
	transform: rotate(-6deg) scale(1.06);
}

.sp-carrossel-setas {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.sp-carrossel-setas button {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 3px solid var(--wp--preset--color--chocolate);
	background: var(--wp--preset--color--branco);
	color: var(--wp--preset--color--chocolate);
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 3px 3px 0 0 var(--wp--preset--color--chocolate);
	transition: transform 0.15s ease, background 0.15s ease;
}

.sp-carrossel-setas button:hover {
	background: var(--wp--preset--color--baunilha);
}

.sp-carrossel-setas button:active {
	transform: translate(2px, 2px);
	box-shadow: 1px 1px 0 0 var(--wp--preset--color--chocolate);
}

.sp-carrossel-setas button:disabled {
	opacity: 0.4;
	cursor: default;
}

/* Linha do tempo (Quem Somos)
   ========================================================================== */

.sp-timeline {
	position: relative;
	padding-left: 2.5rem;
}

.sp-timeline::before {
	content: "";
	position: absolute;
	top: 0.5rem;
	bottom: 0.5rem;
	left: 0.85rem;
	border-left: 4px dashed var(--wp--preset--color--morango);
	opacity: 0.5;
}

.sp-timeline-item,
.sp-timeline-item.is-style-card {
	position: relative;
	overflow: visible;
}

.sp-timeline-item::before {
	content: "";
	position: absolute;
	left: calc(-2.5rem + 0.85rem - 12px + 2px);
	top: 1.6rem;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--wp--preset--color--baunilha);
	border: 4px solid var(--wp--preset--color--morango);
	box-sizing: border-box;
}

.sp-timeline-item:nth-child(3n + 2)::before {
	background: var(--wp--preset--color--menta);
}

.sp-timeline-item:nth-child(3n)::before {
	background: var(--wp--preset--color--ceu);
}

/* Listas e números
   ========================================================================== */

.is-style-checks {
	list-style: none;
	padding-left: 0;
}

.is-style-checks li {
	position: relative;
	padding-left: 2rem;
	margin-bottom: 0.5rem;
}

.is-style-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1.2em;
	height: 1.2em;
	border-radius: 50%;
	background: var(--wp--preset--color--menta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A2C2A' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat;
}

.sp-numero {
	font-family: var(--wp--preset--font-family--fredoka);
	font-weight: 700;
	line-height: 1;
}

/* Instagram
   ========================================================================== */

.sp-insta-grid.wp-block-group {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.75rem;
}

@media (min-width: 782px) {
	.sp-insta-grid.wp-block-group {
		grid-template-columns: repeat(6, 1fr);
	}
}

.sp-insta-grid > * {
	margin: 0 !important;
	aspect-ratio: 1;
	border-radius: 22px;
	overflow: hidden;
	display: grid;
	place-items: center;
	transition: transform 0.2s ease;
}

.sp-insta-grid > *:hover {
	transform: scale(1.04) rotate(-1.5deg);
}

.sp-insta-grid .wp-block-image,
.sp-insta-grid .wp-block-image a {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	margin: 0;
}

.sp-insta-grid .wp-block-image img {
	width: 62%;
	height: 62%;
	object-fit: contain;
	border-radius: 0 !important;
}

/* Galeria: ilustrações SVG ganham respiro; fotos reais ocupam o card inteiro */

.wp-block-gallery .wp-block-image.is-style-card img[src$=".svg"] {
	aspect-ratio: 4 / 3;
	object-fit: contain !important;
	padding: 1.5rem;
	background: var(--wp--preset--color--baunilha-claro);
}

.wp-block-gallery .wp-block-image.is-style-card:nth-child(3n + 2) img[src$=".svg"] {
	background: var(--wp--preset--color--menta-claro);
}

.wp-block-gallery .wp-block-image.is-style-card:nth-child(3n) img[src$=".svg"] {
	background: var(--wp--preset--color--morango-claro);
}

/* Rodapé
   ========================================================================== */

.sp-footer a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--baunilha);
	text-decoration: none;
}

.sp-footer a:where(:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--branco);
	text-decoration: underline;
}

.sp-footer .wp-block-social-links .wp-social-link {
	background: var(--wp--preset--color--morango) !important;
	color: var(--wp--preset--color--branco) !important;
}

.sp-footer .wp-block-social-links .wp-social-link a {
	color: var(--wp--preset--color--branco) !important;
}

.sp-lista-limpa {
	list-style: none;
	padding-left: 0;
}

.sp-lista-limpa li + li {
	margin-top: 0.4rem;
}

/* Botões
   ========================================================================== */

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 3px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--chocolate);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--chocolate);
	color: var(--wp--preset--color--branco);
	border-color: var(--wp--preset--color--chocolate);
}

.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.wp-element-button:active,
.wp-block-button__link:active {
	transform: scale(0.97);
}

/* 404
   ========================================================================== */

.sp-404-numero {
	font-size: clamp(5rem, 18vw, 11rem) !important;
	color: var(--wp--preset--color--morango);
	text-shadow: 6px 6px 0 var(--wp--preset--color--baunilha);
}

/* Utilidades
   ========================================================================== */

.sp-centro {
	text-align: center;
}

.sp-sem-margem {
	margin-block: 0 !important;
}

@media (max-width: 781px) {
	.sp-inverte-mobile.wp-block-columns {
		flex-direction: column-reverse;
	}
}
