/*
Theme Name:   Ciotola Piena
Theme URI:    https://www.ciotolapiena.it
Description:  Tema child di Blocksy per Ciotola Piena: palette del marchio, titoli in Nunito (caricato dal sito, niente Google Fonts), stile di schede prodotto, pulsanti Amazon, prezzi e marchi. Al primo avvio imposta logo, icona del sito e motto.
Author:       Ciotola Piena
Template:     blocksy
Version:      1.0.3
Requires PHP: 8.0
Text Domain:  ciotolapiena
*/

/* ==========================================================================
   Font: Nunito variabile, ospitato sul sito (GDPR: nessuna chiamata a Google)
   ========================================================================== */
@font-face {
	font-family: "Nunito";
	font-style: normal;
	font-display: swap;
	font-weight: 200 1000;
	src: url("assets/fonts/nunito-latin-ext-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Nunito";
	font-style: normal;
	font-display: swap;
	font-weight: 200 1000;
	src: url("assets/fonts/nunito-latin-wght-normal.woff2") format("woff2-variations");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Palette del marchio (ricavata dal logo).
   Sovrascrive la "Tavolozza colori globale" di Blocksy: per cambiarla,
   modifica questi valori (il Customizer non ha effetto finché sono qui).
   ========================================================================== */
:root:root {
	--cp-pink: #DA0061;        /* pulsanti e link (contrasto AA con testo bianco) */
	--cp-pink-dark: #A8004B;   /* hover */
	--cp-pink-logo: #ED0168;   /* rosa originale del logo, solo decorativo */
	--cp-amber: #FDAF02;       /* accento: badge offerta, evidenze (testo scuro sopra) */
	--cp-brown: #652C01;       /* accento: dettagli, prezzo al kg */
	--cp-text: #3D3936;
	--cp-heading: #282727;
	--cp-border: #EFE6DD;
	--cp-cream: #FFF7E8;
	--cp-bg: #FFFDF9;
	--cp-radius: 14px;

	/* Blocksy 2.x */
	--theme-palette-color-1: var(--cp-pink);
	--theme-palette-color-2: var(--cp-pink-dark);
	--theme-palette-color-3: var(--cp-text);
	--theme-palette-color-4: var(--cp-heading);
	--theme-palette-color-5: var(--cp-border);
	--theme-palette-color-6: var(--cp-cream);
	--theme-palette-color-7: var(--cp-bg);
	--theme-palette-color-8: #FFFFFF;
	/* Blocksy 1.x (compatibilità) */
	--paletteColor1: var(--cp-pink);
	--paletteColor2: var(--cp-pink-dark);
	--paletteColor3: var(--cp-text);
	--paletteColor4: var(--cp-heading);
	--paletteColor5: var(--cp-border);
	--paletteColor6: var(--cp-cream);
	--paletteColor7: var(--cp-bg);
	--paletteColor8: #FFFFFF;

	--theme-headings-font-family: "Nunito", ui-rounded, system-ui, sans-serif;
}

/* ==========================================================================
   Tipografia
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.page-title, .entry-title,
.woocommerce-loop-product__title,
.product_title {
	font-family: "Nunito", ui-rounded, system-ui, sans-serif;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--cp-heading);
}

a { text-underline-offset: 0.15em; }

:focus-visible {
	outline: 3px solid var(--cp-amber);
	outline-offset: 2px;
}

/* ==========================================================================
   Header: tendine del menu chiare (il rosa su fondo scuro si leggeva poco)
   ========================================================================== */
#header .sub-menu,
.ct-header .sub-menu {
	--dropdown-background-color: #fff;
	background-color: #fff !important;
	border: 1px solid var(--cp-border);
	border-radius: 12px;
	box-shadow: 0 12px 30px rgba(40, 39, 39, 0.12) !important;
	overflow: hidden;
}
#header .sub-menu li,
.ct-header .sub-menu li {
	border-color: var(--cp-border) !important;
}
#header .sub-menu a,
.ct-header .sub-menu a {
	color: var(--cp-heading) !important;
	font-weight: 600;
}
#header .sub-menu a:hover,
#header .sub-menu a:focus-visible,
#header .sub-menu .current-menu-item > a,
.ct-header .sub-menu a:hover,
.ct-header .sub-menu a:focus-visible,
.ct-header .sub-menu .current-menu-item > a {
	color: var(--cp-pink) !important;
	background-color: var(--cp-cream) !important;
}

/* ==========================================================================
   Pulsanti
   ========================================================================== */
.button,
button.button,
.wp-element-button,
.wp-block-button__link {
	border-radius: 999px;
	font-weight: 700;
}

/* Pulsante "Vedi su Amazon" (schede e liste) */
.cp-amazon-button,
.products .product .button.product_type_external {
	background: var(--cp-pink) !important;
	color: #fff !important;
	border: 0;
	border-radius: 999px;
	font-weight: 800;
	padding: 0.75em 1.4em;
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.cp-amazon-button:hover,
.products .product .button.product_type_external:hover {
	background: var(--cp-pink-dark) !important;
	transform: translateY(-1px);
}
.products .product .button.product_type_external { width: 100%; text-align: center; }
.cp-affiliate { margin-top: 1em; }

/* ==========================================================================
   Schede prodotto in lista
   ========================================================================== */
.products .product {
	background: #fff;
	border: 1px solid var(--cp-border);
	border-radius: var(--cp-radius);
	padding: 14px;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.products .product:hover {
	box-shadow: 0 10px 28px rgba(40, 39, 39, 0.08);
	transform: translateY(-2px);
}
.products .product img,
.cp-remote-img {
	background: #fff;
	border-radius: calc(var(--cp-radius) - 4px);
}
.woocommerce-loop-product__title {
	font-size: 1rem;
	line-height: 1.3;
}

/* Badge offerta: ambra con testo scuro (leggibile) */
.onsale,
span.onsale {
	background: var(--cp-amber) !important;
	color: var(--cp-heading) !important;
	font-weight: 800;
	border-radius: 999px;
}

/* ==========================================================================
   Prezzi (classi del plugin Ciotola Piena Core)
   ========================================================================== */
.price { color: var(--cp-heading); font-weight: 800; }
.price del { color: #8A8480; font-weight: 400; }
.price ins { text-decoration: none; color: var(--cp-pink); }
.cp-price-kg { color: var(--cp-brown); font-weight: 600; font-size: 0.85em; }
.cp-price-date { color: #6E6864; font-weight: 400; }
.cp-price-unavailable { color: var(--cp-text); font-weight: 600; font-size: 0.9em; }

/* ==========================================================================
   Pagine categoria e marchio
   ========================================================================== */
.term-description,
.woocommerce-products-header__description {
	background: var(--cp-cream);
	border-radius: var(--cp-radius);
	padding: 1.25em 1.5em;
	margin-bottom: 1.5em;
}
.woocommerce-breadcrumb,
.ct-breadcrumbs { font-size: 0.85em; }

/* Elenco marchi [ciotolapiena_marchi] */
.cp-brands__letter {
	color: var(--cp-pink);
	border-bottom: 2px solid var(--cp-border);
	padding-bottom: 0.2em;
	margin-top: 1.6em;
}
.cp-brands__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 0.5em 1.5em;
}
.cp-brands__list a { font-weight: 600; text-decoration: none; }
.cp-brands__list a:hover { text-decoration: underline; }

/* Filtri rapidi "Solo in offerta" / "Solo consegna Prime" */
.cp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.2em; }
.cp-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.4em 1em;
	border: 1.5px solid var(--cp-border);
	border-radius: 999px;
	background: #fff;
	color: var(--cp-heading);
	font-weight: 700;
	font-size: 0.9em;
	text-decoration: none;
}
.cp-chip:hover { border-color: var(--cp-pink); color: var(--cp-pink); }
.cp-chip.is-active { background: var(--cp-pink); border-color: var(--cp-pink); color: #fff; }

/* Badge Prime e offerte a tempo */
.cp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.4em 0; }
.cp-badge {
	display: inline-block;
	padding: 0.15em 0.6em;
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 800;
	line-height: 1.6;
}
.cp-badge--prime { background: #E8F1FB; color: #0B4F8A; }
.cp-badge--deal { background: var(--cp-amber); color: var(--cp-heading); }
.cp-empty { background: var(--cp-cream); padding: 1em 1.4em; border-radius: var(--cp-radius); }

/* Guida e FAQ sotto i prodotti (contenuti SEO del plugin) */
.cp-term-content {
	max-width: 820px;
	margin: 3em auto 1em;
	line-height: 1.7;
}
.cp-term-content h2 { margin-top: 1.6em; }
.cp-faq { margin-top: 2.5em; }
.cp-faq__item {
	border: 1px solid var(--cp-border);
	border-radius: var(--cp-radius);
	padding: 0.9em 1.2em;
	margin-bottom: 0.7em;
	background: #fff;
}
.cp-faq__item summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--cp-heading);
}
.cp-faq__item[open] summary { color: var(--cp-pink); margin-bottom: 0.5em; }

/* ==========================================================================
   Avviso affiliazione nel footer
   ========================================================================== */
.cp-disclosure { color: var(--cp-text); }
.cp-disclosure a { color: inherit; }
