/*
Theme Name: Il Faro
Theme URI: https://example.com/ilfaro
Author: Marco Rapella
Author URI: https://marcorapella.com
Description: Tema leggero per libreria online, compatibile con WooCommerce. Slider in home, catalogo con filtri, scheda libro, carrello e checkout. Colori, slider, testi della home e footer si modificano dal Personalizza.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ilfaro
Tags: e-commerce, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns
WC requires at least: 8.0
*/

/* =========================================================================
   1. Variabili e base
   ====================================================================== */
:root {
	--if-navy: #17233B;
	--if-gold: #E3A82B;
	--if-gold-text: #B07F0E;
	--if-cream: #F7F5EF;
	--if-card: #FFFFFF;
	--if-border: #DDD9CD;
	--if-text: #1B1F2A;
	--if-muted: #5E6573;
	--if-green: #2F5D50;
	--if-footer-link: #C9CED8;
	--if-sand: #EDE6D3;
	--if-radius: 6px;
	--if-radius-lg: 10px;
	--if-font-head: 'Fraunces', Georgia, serif;
	--if-font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--if-wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--if-font-body);
	font-size: 16px;
	line-height: 1.55;
	color: var(--if-text);
	background: var(--if-cream);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.if-site { flex: 1 0 auto; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--if-navy); }
a:hover { color: var(--if-gold-text); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 3px solid var(--if-gold);
	outline-offset: 2px;
}

h1, h2, h3, h4 { font-family: var(--if-font-head); color: var(--if-navy); line-height: 1.15; margin: 0 0 .5em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.if-skip {
	position: absolute; left: -9999px; top: 0; background: var(--if-navy); color: #fff; padding: 12px 16px; z-index: 100;
}
.if-skip:focus { left: 8px; top: 8px; color: #fff; }

.if-wrap { width: 100%; max-width: var(--if-wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.if-main { padding-top: 32px; padding-bottom: 80px; }
.if-h1 { font-size: 40px; margin: 12px 0 28px; }
.if-h2 { font-size: 30px; margin: 0 0 24px; }

/* Pulsanti */
.if-btn,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .woocommerce a.button.alt, .woocommerce button.button.alt,
.wp-block-button__link, .woocommerce-page a.button {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 10px 20px;
	border: 0; border-radius: var(--if-radius);
	background: var(--if-navy); color: #F7F5EF;
	font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
	text-decoration: none; cursor: pointer;
	transition: background .15s, color .15s;
}
.if-btn:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover {
	background: #0e1830; color: #fff;
}
.if-btn--gold { background: var(--if-gold); color: var(--if-navy); }
.if-btn--gold:hover { background: #f1b83c; color: var(--if-navy); }
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce #place_order {
	min-height: 52px; font-size: 17px;
}

/* Form */
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="search"], input[type="url"], select, textarea,
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea {
	width: 100%; min-height: 46px; padding: 10px 14px;
	border: 1px solid var(--if-border); border-radius: var(--if-radius);
	background: #fff; color: var(--if-text);
	font-family: inherit; font-size: 16px;
}
textarea { min-height: 110px; }
label { font-weight: 600; font-size: 14px; }

/* =========================================================================
   2. Header
   ====================================================================== */
.if-topbar { background: var(--if-navy); color: var(--if-cream); font-size: 13px; }
.if-topbar__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding-top: 10px; padding-bottom: 10px; }

.if-header { background: #fff; border-bottom: 1px solid var(--if-border); position: relative; z-index: 20; }
.if-header__in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-top: 18px; padding-bottom: 8px; }

.if-brand, .if-brandwrap a.custom-logo-link {
	font-family: var(--if-font-head); font-weight: 700; font-size: 26px;
	color: var(--if-navy); text-decoration: none; white-space: nowrap;
}
.if-brandwrap img { max-height: 56px; width: auto; }

.if-search { flex: 1 1 260px; display: flex; min-width: 0; margin: 0; }
.if-search input[type="search"] {
	flex: 1; min-width: 0; height: 46px; border-right: 0;
	border-radius: var(--if-radius) 0 0 var(--if-radius); background: var(--if-cream);
	-webkit-appearance: none; appearance: none;
}
.if-search button {
	width: 52px; height: 46px; border: 0; cursor: pointer;
	border-radius: 0 var(--if-radius) var(--if-radius) 0;
	background: var(--if-navy); color: var(--if-cream);
	display: flex; align-items: center; justify-content: center;
}
.if-search--inline { max-width: 560px; margin: 16px 0; }

.if-icons { display: flex; align-items: center; gap: 8px; }
.if-icon { position: relative; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; color: var(--if-navy); }
.if-icon:hover { color: var(--if-gold-text); }
.if-cart-count {
	position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: 10px; background: var(--if-gold); color: var(--if-navy);
	font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.if-cart-count[hidden] { display: none; }

.if-burger { display: none; width: 46px; height: 46px; border: 0; background: transparent; color: var(--if-navy); cursor: pointer; align-items: center; justify-content: center; }

.if-catnav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 28px; }
.if-catnav__list a {
	display: block; padding: 12px 0; font-size: 15px; font-weight: 600;
	color: var(--if-navy); text-decoration: none; border-bottom: 3px solid transparent;
}
.if-catnav__list a:hover { color: var(--if-gold-text); }
.if-catnav__list .current-menu-item > a, .if-catnav__list .current-cat > a { border-bottom-color: var(--if-gold); }

/* =========================================================================
   3. Slider
   ====================================================================== */
.if-hero { position: relative; overflow: hidden; }
.if-hero__track { position: relative; }
.if-slide {
	display: none; background: var(--bg, var(--if-navy)); color: var(--fg, var(--if-cream));
}
.if-slide.is-active { display: block; animation: if-fade .5s ease; }
@keyframes if-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .if-slide.is-active { animation: none; } }

.if-slide__in { display: flex; align-items: center; justify-content: space-between; gap: 40px; min-height: 420px; padding-top: 48px; padding-bottom: 72px; }
.if-slide__copy { flex: 1 1 50%; max-width: 560px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.if-slide__tag { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--if-gold-text); }
.if-slide .if-slide__tag { color: var(--fg); opacity: .85; }
.if-slide__title { font-size: 48px; line-height: 1.08; color: var(--fg, #fff); margin: 0; }
.if-slide__text { font-size: 18px; margin: 0; opacity: .92; }
.if-slide .if-btn--gold { margin-top: 8px; }

.if-slide__art { flex: 1 1 40%; position: relative; min-height: 300px; display: flex; align-items: center; justify-content: center; }
.if-slide__art img { max-height: 340px; width: auto; border-radius: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.3); }
.if-slide__cover { position: absolute; width: 150px; aspect-ratio: 2 / 3; border-radius: 3px 6px 6px 3px; box-shadow: 0 18px 36px rgba(0,0,0,.3); }
.if-slide__cover--a { background: var(--fg); opacity: .95; transform: translate(-80px, 10px) rotate(-8deg); }
.if-slide__cover--b { background: #E3A82B; transform: translate(0, -10px); z-index: 1; }
.if-slide__cover--c { background: rgba(255,255,255,.35); transform: translate(80px, 14px) rotate(8deg); }

.if-hero__nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
	width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255,255,255,.9); color: var(--if-navy); font-size: 22px;
	display: flex; align-items: center; justify-content: center;
}
.if-hero__nav:hover { background: #fff; }
.if-hero__nav--prev { left: 16px; }
.if-hero__nav--next { right: 16px; }
.if-hero__dots { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; gap: 4px; z-index: 3; }
.if-hero__dot { width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; position: relative; }
.if-hero__dot::after {
	content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
	border-radius: 50%; background: rgba(255,255,255,.55); border: 2px solid rgba(0,0,0,.25);
}
.if-hero__dot.is-active::after { background: var(--if-gold); border-color: var(--if-navy); }

/* =========================================================================
   4. Sezioni home
   ====================================================================== */
.if-section { padding-top: 56px; padding-bottom: 8px; }
.if-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.if-section__head .if-h2 { margin: 0; }
.if-link { font-weight: 600; font-size: 15px; display: inline-block; padding: 8px 0; }

.if-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.if-cat {
	display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 120px;
	padding: 20px; border-radius: var(--if-radius-lg); background: #fff; border: 1px solid var(--if-border);
	text-decoration: none; transition: border-color .15s, transform .15s;
}
.if-cat:hover { border-color: var(--if-gold); transform: translateY(-2px); }
.if-cat__name { font-family: var(--if-font-head); font-size: 22px; font-weight: 700; color: var(--if-navy); }
.if-cat__count { font-size: 14px; color: var(--if-muted); }

.if-month {
	display: flex; flex-wrap: wrap; align-items: center; gap: 40px;
	background: var(--if-sand); border-radius: var(--if-radius-lg); padding: 40px;
}
.if-month__img { flex: 0 1 240px; margin: 0 auto; }
.if-month__img img { width: 100%; max-width: 240px; border-radius: 3px 8px 8px 3px; box-shadow: 0 18px 40px rgba(23,35,59,.3); }
.if-month__copy { flex: 1 1 320px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.if-month__copy p { margin: 0; }
.if-month__title { font-size: 36px; margin: 0; }
.if-month__title a { text-decoration: none; }
.if-month__author { color: var(--if-muted); font-size: 17px; }
.if-month__price { font-family: var(--if-font-head); font-size: 28px; font-weight: 700; color: var(--if-navy); }

.if-benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; padding-bottom: 56px; }
.if-benefit { padding: 24px; background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg); }
.if-benefit h3 { font-size: 20px; margin-bottom: 8px; }
.if-benefit p { margin: 0; color: var(--if-muted); }

/* =========================================================================
   5. Elenco prodotti (card)
   ====================================================================== */
.woocommerce ul.products, ul.products {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 24px;
}
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product, ul.products li.product,
.woocommerce ul.products[class*="columns-"] li.product,
.woocommerce-page ul.products[class*="columns-"] li.product {
	/* sovrascrive le larghezze a percentuale e i margini del CSS di WooCommerce */
	width: auto !important; max-width: none; float: none !important; clear: none !important; margin: 0 !important; padding: 0;
}
.if-products-home { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.if-card {
	background: #fff; border: 1px solid var(--if-border); border-radius: 8px;
	padding: 16px; display: flex; flex-direction: column; gap: 14px; position: relative;
}
.if-card__media { display: block; position: relative; background: var(--if-sand); border-radius: 4px; overflow: hidden; }
.if-card__media img, .woocommerce ul.products li.product .if-card__media img {
	width: 100%; aspect-ratio: 2 / 3; object-fit: cover; margin: 0;
	box-shadow: 0 6px 16px rgba(23,35,59,.18);
}
.if-card__body { display: flex; flex-direction: column; gap: 2px; }
.if-card__title, .woocommerce ul.products li.product .if-card__title {
	font-family: var(--if-font-head); font-size: 18px; font-weight: 700; line-height: 1.2; margin: 0; padding: 0;
}
.if-card__title a { text-decoration: none; }
.if-card__author { font-size: 14px; color: var(--if-muted); }
.if-card__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.if-card__foot .price, .woocommerce ul.products li.product .price {
	font-weight: 700; font-size: 18px; color: var(--if-navy); display: block; margin: 0;
}
.price del { color: var(--if-muted); font-weight: 400; font-size: 14px; opacity: .85; margin-right: 4px; }
.price ins { text-decoration: none; }
.if-card__foot .button { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.if-card__foot .added_to_cart { font-size: 13px; font-weight: 600; }

.if-badge {
	position: absolute; top: 10px; left: 10px; z-index: 2;
	padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 700;
	background: var(--if-navy); color: var(--if-cream);
}
.if-badge--sale { background: var(--if-gold); color: var(--if-navy); }

/* =========================================================================
   6. Catalogo: breadcrumb, filtri, ordinamento, paginazione
   ====================================================================== */
.woocommerce-breadcrumb { font-size: 14px; color: var(--if-muted); margin: 0 0 12px; }
.woocommerce-breadcrumb a { color: var(--if-muted); text-decoration: none; }
.woocommerce-breadcrumb a:hover { text-decoration: underline; }

.woocommerce-products-header__title.page-title { font-size: 40px; margin: 12px 0 8px; }
.term-description { color: var(--if-muted); margin-bottom: 16px; }

.if-shop { display: flex; align-items: flex-start; gap: 40px; }
.if-shop__side { flex: 0 0 260px; }
.if-shop__main { flex: 1 1 0; min-width: 0; }
.if-filters-toggle {
	display: none; min-height: 44px; padding: 8px 20px; border: 1.5px solid var(--if-navy);
	border-radius: var(--if-radius); background: #fff; color: var(--if-navy); font: 700 15px var(--if-font-body); cursor: pointer;
}

.if-filter { background: #fff; border: 1px solid var(--if-border); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.if-filter__title { font-family: var(--if-font-body); font-size: 15px; font-weight: 700; margin: 0 0 12px; color: var(--if-navy); }
.if-filter ul { list-style: none; margin: 0; padding: 0; }
.if-filter li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 15px; }
.if-filter li a { text-decoration: none; }
.if-filter .count { color: var(--if-muted); }

/* Filtro prezzo */
.widget_price_filter .ui-slider { position: relative; height: 6px; background: var(--if-sand); border-radius: 3px; margin: 16px 8px 20px; }
.widget_price_filter .ui-slider .ui-slider-range { position: absolute; height: 100%; background: var(--if-gold); border-radius: 3px; }
.widget_price_filter .ui-slider .ui-slider-handle {
	position: absolute; top: -7px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
	background: var(--if-navy); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--if-navy); cursor: pointer;
}
.widget_price_filter .price_slider_amount { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.widget_price_filter .price_slider_amount .button { min-height: 40px; }
.widget_price_filter .price_label { color: var(--if-muted); }

.woocommerce-result-count { float: left; margin: 0 0 20px; line-height: 46px; color: var(--if-muted); font-size: 15px; }
.woocommerce-ordering { float: right; margin: 0 0 20px; }
.woocommerce-ordering select { width: auto; min-width: 220px; }
.woocommerce .products { clear: both; }

.woocommerce-pagination { margin-top: 40px; }
.woocommerce-pagination ul.page-numbers, .navigation.pagination .nav-links {
	list-style: none; margin: 0; padding: 0; border: 0;
	display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.woocommerce-pagination ul.page-numbers li { border: 0; float: none; overflow: visible; display: block; }
.woocommerce-pagination .page-numbers, .navigation.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid var(--if-border);
	border-radius: var(--if-radius); background: #fff; color: var(--if-navy);
	font-weight: 600; text-decoration: none; margin: 0;
}
.woocommerce-pagination .page-numbers.current, .navigation.pagination .page-numbers.current { background: var(--if-navy); color: #fff; border-color: var(--if-navy); }
.woocommerce-pagination a.page-numbers:hover { border-color: var(--if-gold); background: #fff; color: var(--if-navy); }
.navigation.pagination { margin-top: 40px; }

/* =========================================================================
   7. Scheda prodotto
   ====================================================================== */
.single-product div.product { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.single-product div.product > .woocommerce-product-gallery { flex: 1 1 340px; max-width: 480px; margin: 0 auto; float: none; width: auto; position: relative; background: var(--if-sand); border-radius: 12px; padding: 40px; }
.single-product div.product > .woocommerce-product-gallery img { border-radius: 3px 8px 8px 3px; box-shadow: 0 18px 40px rgba(23,35,59,.3); }
.single-product div.product > .woocommerce-product-gallery .flex-control-thumbs { list-style: none; display: flex; gap: 8px; margin: 16px 0 0; padding: 0; }
.single-product div.product > .woocommerce-product-gallery .flex-control-thumbs li { width: 64px; }
.single-product div.product > .woocommerce-product-gallery .woocommerce-product-gallery__trigger { position: absolute; top: 12px; right: 12px; z-index: 3; }
.single-product div.product .summary { flex: 1 1 420px; min-width: 0; float: none; width: auto; display: flex; flex-direction: column; gap: 16px; }
.single-product div.product .summary > * { margin: 0; }
.single-product .product_title { font-size: 44px; line-height: 1.08; }
.if-author { font-size: 17px; color: #3A4150; }
.single-product .summary .price { font-family: var(--if-font-head); font-size: 40px; font-weight: 700; color: var(--if-navy); }
.single-product .summary .price del { font-size: 22px; }
.woocommerce-product-rating { display: flex; align-items: center; gap: 10px; }
.star-rating { position: relative; display: inline-block; overflow: hidden; width: 5.4em; height: 1.1em; line-height: 1; font-size: 18px; font-family: star; letter-spacing: 0; }
.star-rating::before { content: '\73\73\73\73\73'; position: absolute; left: 0; top: 0; color: var(--if-border); }
.star-rating span { position: absolute; left: 0; top: 0; overflow: hidden; padding-top: 1.5em; }
.star-rating span::before { content: '\53\53\53\53\53'; position: absolute; left: 0; top: 0; color: var(--if-gold); }
.woocommerce-product-details__short-description { color: #3A4150; }
.stock.in-stock { color: var(--if-green); font-weight: 600; }
.stock.out-of-stock { color: #a33; font-weight: 600; }

form.cart { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
form.cart .quantity { display: flex; }
.quantity input.qty { width: 80px; text-align: center; font-weight: 700; }
.single_add_to_cart_button { flex: 1 1 200px; min-height: 48px; }
table.variations { width: 100%; border: 0; margin-bottom: 8px; }
table.variations td, table.variations th { display: block; padding: 4px 0; text-align: left; }

.product_meta { font-size: 14px; color: var(--if-muted); display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid var(--if-border); }

.woocommerce-tabs { flex: 0 0 100%; margin-top: 24px; }
.woocommerce-tabs ul.tabs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 28px; border-bottom: 1px solid var(--if-border); }
.woocommerce-tabs ul.tabs li { margin: 0; }
.woocommerce-tabs ul.tabs li a { display: block; padding: 14px 0; font-weight: 700; color: var(--if-muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.woocommerce-tabs ul.tabs li.active a { color: var(--if-navy); border-bottom-color: var(--if-gold); }
.woocommerce-tabs .panel { padding-top: 28px; max-width: 760px; font-size: 17px; line-height: 1.7; color: #3A4150; }
.woocommerce-tabs .panel > h2:first-child { display: none; }
.woocommerce-tabs table.shop_attributes { width: 100%; border-collapse: collapse; }
.woocommerce-tabs table.shop_attributes th, .woocommerce-tabs table.shop_attributes td { padding: 12px 0; border-bottom: 1px solid var(--if-border); text-align: left; font-size: 15px; }
.woocommerce-tabs table.shop_attributes th { width: 180px; color: var(--if-muted); font-weight: 400; }
.woocommerce-tabs table.shop_attributes p { margin: 0; }

.related.products, .upsells.products, .cross-sells { flex: 0 0 100%; margin-top: 48px; }
.related.products > h2, .upsells.products > h2, .cross-sells > h2 { font-size: 30px; margin-bottom: 24px; }

#reviews #comments ol.commentlist { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 16px; }
#reviews .commentlist li { background: #fff; border: 1px solid var(--if-border); border-radius: 8px; padding: 20px 24px; }
#reviews .commentlist .comment_container { display: flex; gap: 16px; }
#reviews .commentlist img.avatar { width: 48px; height: 48px; border-radius: 50%; }
#reviews .commentlist .meta { margin: 0 0 6px; font-size: 14px; color: var(--if-muted); }
#reviews .commentlist .description p { margin: 0; }
p.stars a { color: var(--if-gold); font-size: 20px; text-decoration: none; margin-right: 4px; }

/* =========================================================================
   8. Avvisi
   ====================================================================== */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
	list-style: none; margin: 0 0 24px; padding: 16px 20px;
	background: #fff; border: 1px solid var(--if-border); border-left: 5px solid var(--if-navy);
	border-radius: var(--if-radius); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.woocommerce-message { border-left-color: var(--if-green); }
.woocommerce-error { border-left-color: #b3261e; }
.woocommerce-message .button { order: 2; }

/* =========================================================================
   9. Carrello
   ====================================================================== */
.woocommerce-cart .woocommerce { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; }
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper { flex: 0 0 100%; }
.woocommerce-cart .woocommerce-cart-form { flex: 2 1 560px; min-width: 0; }
.woocommerce-cart .cart-collaterals { flex: 1 1 320px; min-width: 0; }
.woocommerce-cart .cart-collaterals .cross-sells { display: none; }

.if-shipbar { background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg); padding: 18px 22px; margin-bottom: 20px; }
.if-shipbar p { margin: 0 0 10px; font-weight: 600; color: var(--if-navy); }
.if-shipbar__track { height: 8px; border-radius: 4px; background: var(--if-sand); overflow: hidden; }
.if-shipbar__track div { height: 100%; background: var(--if-gold); }

table.shop_table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg); overflow: hidden; }
table.shop_table th, table.shop_table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--if-border); vertical-align: middle; }
table.shop_table thead th { font-size: 14px; color: var(--if-muted); background: var(--if-cream); }
table.cart .product-thumbnail { width: 88px; }
table.cart .product-thumbnail img { width: 72px; border-radius: 2px 4px 4px 2px; box-shadow: 0 4px 10px rgba(23,35,59,.2); }
table.cart .product-name a { font-family: var(--if-font-head); font-size: 19px; font-weight: 700; text-decoration: none; }
table.cart .product-remove a { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; font-size: 22px; text-decoration: none; color: var(--if-muted); }
table.cart .product-remove a:hover { background: var(--if-sand); color: #b3261e; }
table.cart td.actions { background: var(--if-cream); }
table.cart td.actions .coupon { display: flex; flex-wrap: wrap; gap: 8px; float: left; }
table.cart td.actions .coupon input { width: 200px; }
table.cart td.actions > .button { float: right; }

.cart_totals { background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg); padding: 26px; }
.cart_totals h2 { font-size: 24px; }
.cart_totals table.shop_table { border: 0; border-radius: 0; }
.cart_totals table.shop_table th, .cart_totals table.shop_table td { padding: 12px 0; background: transparent; }
.cart_totals .order-total th, .cart_totals .order-total td { font-size: 18px; }
.cart_totals .order-total .amount { font-family: var(--if-font-head); font-size: 28px; color: var(--if-navy); }
.cart_totals .wc-proceed-to-checkout .button { width: 100%; min-height: 52px; font-size: 17px; }

/* =========================================================================
   10. Checkout e account
   ====================================================================== */
form.checkout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; }
form.checkout #customer_details { flex: 2 1 480px; min-width: 0; }
form.checkout #order_review_heading { flex: 0 0 100%; display: none; }
form.checkout #order_review { flex: 1 1 340px; min-width: 0; background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg); padding: 26px; }
form.checkout h3 { font-size: 24px; margin: 0 0 20px; }
form.checkout #customer_details .col-1, form.checkout #customer_details .col-2 { width: 100%; float: none; margin-bottom: 24px; padding: 24px; background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg); }
.woocommerce form .form-row { margin: 0 0 16px; padding: 0; }
.woocommerce form .form-row-first, .woocommerce form .form-row-last { width: 48.5%; float: left; }
.woocommerce form .form-row-last { float: right; }
.woocommerce form .form-row-wide { clear: both; }
.woocommerce form .form-row label { display: block; margin-bottom: 6px; }
.woocommerce form .form-row .required { color: #b3261e; text-decoration: none; }
.woocommerce-checkout #order_review table.shop_table { border: 0; }
.woocommerce-checkout #order_review table.shop_table th, .woocommerce-checkout #order_review table.shop_table td { padding: 12px 0; }
.woocommerce-checkout .order-total .amount { font-family: var(--if-font-head); font-size: 28px; color: var(--if-navy); }
#payment { background: transparent; }
#payment ul.payment_methods { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
#payment ul.payment_methods li { border: 1px solid var(--if-border); border-radius: var(--if-radius); padding: 14px 16px; background: var(--if-cream); }
#payment ul.payment_methods li label { display: inline; font-size: 15px; }
#payment .payment_box { margin-top: 10px; font-size: 14px; color: var(--if-muted); }
#payment #place_order { width: 100%; }
.woocommerce-privacy-policy-text { font-size: 13px; color: var(--if-muted); margin-bottom: 16px; }
.select2-container .select2-selection--single { height: 46px; border-color: var(--if-border); border-radius: var(--if-radius); }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 44px; padding-left: 14px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px; }

.woocommerce-account .woocommerce { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.woocommerce-MyAccount-navigation { flex: 0 0 240px; }
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg); overflow: hidden; }
.woocommerce-MyAccount-navigation li a { display: block; padding: 14px 18px; border-bottom: 1px solid var(--if-border); text-decoration: none; font-weight: 600; }
.woocommerce-MyAccount-navigation li:last-child a { border-bottom: 0; }
.woocommerce-MyAccount-navigation li.is-active a { background: var(--if-navy); color: #fff; }
.woocommerce-MyAccount-content { flex: 1 1 400px; min-width: 0; }
.woocommerce-account .u-columns { display: flex; flex-wrap: wrap; gap: 32px; }
.woocommerce-account .u-columns .u-column1, .woocommerce-account .u-columns .u-column2 { flex: 1 1 320px; float: none; width: auto; background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg); padding: 24px; }

/* =========================================================================
   11. Blog / pagine
   ====================================================================== */
.if-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.if-post { background: #fff; border: 1px solid var(--if-border); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.if-post__img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; }
.if-post__title { font-size: 22px; margin: 0; }
.if-post__title a { text-decoration: none; }
.if-post__date { font-size: 14px; color: var(--if-muted); }
.if-post__excerpt p { margin: 0; color: #3A4150; }

.if-entry { max-width: 760px; }
.if-entry__thumb { margin: 20px 0; }
.if-entry__thumb img { border-radius: 8px; width: 100%; }
.if-entry__content { font-size: 18px; line-height: 1.75; color: #2a2f3b; }
.if-entry__content img { border-radius: 4px; }
.if-comments { max-width: 760px; margin-top: 48px; }
.if-comments__list { list-style: none; padding: 0; }
.if-comments__list li { padding: 16px 0; border-bottom: 1px solid var(--if-border); }

/* =========================================================================
   12. Footer
   ====================================================================== */
.if-footer { background: var(--if-navy); color: var(--if-cream); margin-top: 56px; flex-shrink: 0; }
.if-footer__in { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 56px; padding-bottom: 32px; }
.if-footer__col { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; }
.if-footer__col--about { flex: 2 1 280px; gap: 14px; }
.if-footer__brand { font-family: var(--if-font-head); font-weight: 700; font-size: 24px; }
.if-footer__col p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--if-footer-link); max-width: 360px; }
.if-footer__title { font-weight: 700; margin-bottom: 6px; }
.if-footer__list { list-style: none; margin: 0; padding: 0; }
.if-footer__list a { display: block; padding: 6px 0; font-size: 15px; color: var(--if-footer-link); text-decoration: none; }
.if-footer__list a:hover { color: var(--if-gold); }
.if-footer__list--plain li { padding: 3px 0; font-size: 15px; color: var(--if-footer-link); }
.if-footer__bottom { border-top: 1px solid #2C3A57; }
.if-footer__bottom-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 18px; padding-bottom: 18px; font-size: 13px; color: #9AA3B5; }

/* =========================================================================
   13. Responsive
   ====================================================================== */
@media (max-width: 860px) {
	.if-slide__in { flex-direction: column; align-items: flex-start; min-height: 0; padding-top: 36px; padding-bottom: 64px; }
	.if-slide__title { font-size: 36px; }
	.if-slide__art { display: none; }
	.if-hero__nav { display: none; }
	.if-shop { flex-direction: column; gap: 16px; }
	.if-shop__side { flex: none; width: 100%; display: none; }
	.if-shop__side.is-open { display: block; }
	.if-filters-toggle { display: inline-flex; align-items: center; }
	.single-product .product_title { font-size: 34px; }
	.single-product div.product { gap: 28px; }
	.if-month { padding: 28px 20px; gap: 24px; }
}

@media (max-width: 680px) {
	.if-wrap { padding-left: 16px; padding-right: 16px; }
	.if-h1, .woocommerce-products-header__title.page-title { font-size: 32px; }
	.if-burger { display: flex; margin-left: 0; }
	.if-header__in { gap: 12px 16px; }
	.if-brandwrap { flex: 1 1 auto; }
	.if-search { order: 5; flex: 1 1 100%; }
	.if-catnav { display: none; border-top: 1px solid var(--if-border); }
	.if-catnav.is-open { display: block; }
	.if-catnav__list { flex-direction: column; gap: 0; }
	.if-catnav__list a { padding: 14px 0; border-bottom: 1px solid var(--if-border); }
	.if-topbar__in { justify-content: center; text-align: center; }
	.woocommerce-result-count, .woocommerce-ordering { float: none; width: 100%; }
	.woocommerce-result-count { line-height: 1.4; }
	.woocommerce-ordering select { width: 100%; min-width: 0; }
	.if-section { padding-top: 40px; }
	.if-h2 { font-size: 26px; }

	/* Carrello come schede */
	table.shop_table_responsive thead { display: none; }
	table.shop_table_responsive tr { display: block; border-bottom: 1px solid var(--if-border); padding: 8px 0; }
	table.shop_table_responsive td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 8px 16px; text-align: right; }
	table.shop_table_responsive td::before { content: attr(data-title); font-weight: 600; color: var(--if-muted); text-align: left; }
	table.shop_table_responsive td.product-thumbnail::before, table.shop_table_responsive td.product-remove::before, table.shop_table_responsive td.actions::before { display: none; }
	table.cart td.actions .coupon { float: none; width: 100%; }
	table.cart td.actions .coupon input { flex: 1 1 140px; width: auto; }
	table.cart td.actions > .button { float: none; width: 100%; margin-top: 8px; }

	.woocommerce form .form-row-first, .woocommerce form .form-row-last { width: 100%; float: none; }
	.woocommerce-MyAccount-navigation { flex: 1 1 100%; }
	.single-product div.product > .woocommerce-product-gallery { padding: 24px; }
	.single-product .summary .price { font-size: 32px; }
}

@media (max-width: 380px) {
	.if-slide__title { font-size: 30px; }
	ul.products { grid-template-columns: 1fr; }
}

/* Barra filtri del catalogo */
.if-filterbar {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; align-items: end;
	margin: 0 0 24px; padding: 16px; background: #fff; border: 1px solid var(--if-border); border-radius: var(--if-radius-lg);
}
.if-filterbar__f label { display: block; margin-bottom: 4px; font-size: 13px; color: var(--if-muted); }
.if-filterbar select { width: 100%; }
.if-filterbar__btns { display: flex; align-items: center; gap: 16px; }
.if-filterbar__reset { font-size: 14px; font-weight: 600; }
.woocommerce-result-count { clear: both; }
