/* Tutto Moderno: styles that theme.json cannot express. */

:root {
	--tm-charcoal: #2B2624;
	--tm-ink: #1F1B19;
	--tm-cream: #F7F4EF;
	--tm-terracotta: #B4533A;
	--tm-terracotta-dark: #964330;
	--tm-peach: #F2B49E;
	--tm-sand: #E6DED3;
	--tm-muted: #5A514C;
}

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

/* ---------- Header ---------- */
.tm-utility a { color: var(--tm-peach); text-decoration: none; font-weight: 700; }
.tm-utility a:hover { color: #fff; }
.tm-header { position: sticky; top: 0; z-index: 50; }
.admin-bar .tm-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tm-header { top: 0; position: relative; } }
.tm-header .wp-block-navigation a { text-decoration: none; }
.tm-header .wp-block-navigation__submenu-container {
	border: 1px solid var(--tm-sand) !important;
	border-radius: 8px;
	padding: 6px 0;
	min-width: 240px !important;
	box-shadow: 0 12px 28px rgba(43, 38, 36, 0.12);
}
.tm-header .wp-block-navigation__submenu-container a { padding: 7px 16px !important; font-weight: 500; }
.tm-header .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container { left: 100%; top: -7px; }
.tm-header .wp-block-search__input { background: #FBF9F6; border-color: #D9CFC2; border-radius: 6px; font-size: 14px; }
.tm-header .wp-block-search__button { border-radius: 6px; }
.tm-phone-btn .wp-block-button__link { white-space: nowrap; }
.tm-logo img { height: 58px; width: auto; }
@media (max-width: 781px) {
	.tm-logo img { height: 44px; }
	.tm-header-search, .tm-phone-btn { display: none !important; }
}

/* ---------- Cards and tiles ---------- */
.tm-card {
	background: #fff;
	border: 1px solid var(--tm-sand);
	border-radius: 10px;
	overflow: hidden;
	transition: border-color .15s ease, transform .15s ease;
}
.tm-card:hover { border-color: var(--tm-terracotta); }
.tm-card a { text-decoration: none; }
.tm-card .wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.tm-tile a { text-decoration: none; display: block; }
.tm-tile .tm-tile-cta { color: var(--tm-terracotta); font-weight: 700; }
.tm-kicker { letter-spacing: .14em; text-transform: uppercase; }
.tm-hero-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.tm-hero-grid .tm-hero-tall img { min-height: 420px; }
.tm-hero-grid .tm-hero-short img { height: 203px; }
@media (max-width: 781px) {
	.tm-hero-grid .tm-hero-tall img { min-height: 260px; }
	.tm-hero-grid .tm-hero-short img { height: 140px; }
}
.tm-brand-tile a {
	display: flex; align-items: center; justify-content: center;
	height: 76px; background: #fff; border: 1px solid var(--tm-sand);
	border-radius: 8px; font-weight: 700; text-decoration: none;
}
.tm-brand-tile a:hover { border-color: var(--tm-terracotta); color: var(--tm-terracotta); }
.tm-stat strong { font-family: 'Bodoni Moda', Georgia, serif; font-size: 30px; font-weight: 500; display: block; line-height: 1.2; }
.is-style-outline-dark .wp-block-button__link,
.tm-btn-outline .wp-block-button__link { background: transparent !important; border: 1.5px solid currentColor; color: inherit !important; }

/* ---------- Product loops (shortcode and block) ---------- */
.woocommerce ul.products, .wc-block-product-template { gap: 20px; }
.woocommerce ul.products li.product,
.wc-block-product {
	background: #fff;
	border: 1px solid var(--tm-sand);
	border-radius: 10px;
	padding: 0 0 16px !important;
	overflow: hidden;
	text-align: left;
}
.woocommerce ul.products li.product a img,
.wc-block-product img { margin: 0 0 12px !important; aspect-ratio: 1 / 1; object-fit: cover; }
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.wc-block-product .wp-block-post-title {
	font-family: 'Manrope', system-ui, sans-serif !important;
	font-size: 15px !important; font-weight: 700; line-height: 1.35;
	padding: 0 14px !important; margin: 0 0 6px !important;
}
.woocommerce ul.products li.product .price,
.wc-block-product .wc-block-components-product-price { padding: 0 14px; font-size: 15px; }
.woocommerce ul.products li.product .button { margin: 8px 14px 0; }
.tm-call-price { color: var(--tm-terracotta) !important; font-weight: 700; text-decoration: none; }
.tm-call-price:hover { text-decoration: underline; }

/* ---------- Product page call box (inline styles live in product content) ---------- */
.tm-call-box { background: var(--tm-charcoal) !important; border-radius: 10px !important; }
.tm-call-box p:first-child { color: var(--tm-peach) !important; }
.tm-call-box a[href^="tel:"] { background: var(--tm-terracotta) !important; }
.tm-call-box a[href^="tel:"]:hover { background: var(--tm-terracotta-dark) !important; }
.tm-call-box a[href^="mailto:"] { color: var(--tm-peach) !important; }
.tm-docs a { border-radius: 6px; }

/* ---------- Sticky mobile call bar ---------- */
.tm-callbar { display: none; }
@media (max-width: 781px) {
	.tm-callbar {
		display: flex; justify-content: center; align-items: center; gap: 10px;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
		background: var(--tm-terracotta); color: #fff !important;
		padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
		font-weight: 700; font-size: 17px; text-decoration: none;
		box-shadow: 0 -6px 18px rgba(0, 0, 0, .18);
	}
	.tm-callbar__label { font-weight: 600; opacity: .9; }
	body { padding-bottom: 64px; }
	.chaty-widget, #chaty-widget-0 { bottom: 72px !important; }
}

/* ---------- Footer ---------- */
.tm-footer a { color: #CFC5BA; text-decoration: none; }
.tm-footer a:hover { color: #fff; }
.tm-footer .tm-footer-phone a { color: var(--tm-peach); font-weight: 700; }

/* ---------- Misc ---------- */
.woocommerce-breadcrumb, .wc-block-breadcrumbs { font-size: 14px; color: var(--tm-muted); }
.wp-block-post-content > .alignfull { margin-left: 0; margin-right: 0; }

/* ---------- Product filters ---------- */
.tm-filters { background: #fff; border: 1px solid var(--tm-sand); border-radius: 10px; padding: 0; }
.tm-filters__toggle { display: none; }
.tm-filters__form { padding: 18px 18px 20px; }
.tm-f-group { border-bottom: 1px solid var(--tm-sand); padding: 10px 0; }
.tm-f-group summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; display: flex; justify-content: space-between; }
.tm-f-group summary::after { content: "+"; color: var(--tm-terracotta); font-weight: 700; }
.tm-f-group[open] summary::after { content: "–"; }
.tm-f-group ul { list-style: none; margin: 8px 0 4px; padding: 0; max-height: 260px; overflow: auto; }
.tm-f-group li { margin: 0; }
.tm-f-group label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; cursor: pointer; }
.tm-f-group input { accent-color: var(--tm-terracotta); width: 16px; height: 16px; }
.tm-f-count { margin-left: auto; color: var(--tm-muted); font-size: 12px; }
.tm-f-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.tm-f-actions .wp-element-button { padding: 10px 18px; font-size: 15px; border: 0; cursor: pointer; }
.tm-f-clear { font-size: 14px; color: var(--tm-muted); }
@media (max-width: 781px) {
	.tm-filters__toggle { display: flex; justify-content: space-between; padding: 14px 18px; font-weight: 700; cursor: pointer; list-style: none; }
	.tm-filters__toggle::after { content: "+"; color: var(--tm-terracotta); }
	.tm-filters[open] .tm-filters__toggle::after { content: "–"; }
	.tm-filters__form { padding-top: 0; }
}
.tm-shop-layout > .wp-block-column:first-child { position: sticky; top: 120px; align-self: flex-start; }
@media (max-width: 781px) { .tm-shop-layout > .wp-block-column:first-child { position: static; } }

/* ---------- Quote form ---------- */
.tm-quote { background: #fff; border: 1px solid var(--tm-sand); border-radius: 12px; padding: clamp(20px, 3vw, 32px); }
.tm-quote__title { margin: 0 0 6px; }
.tm-quote__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.tm-quote__field { margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.tm-quote__field--wide { grid-column: 1 / -1; }
.tm-quote__field label { font-size: 14px; font-weight: 600; }
.tm-quote__field label span { color: var(--tm-terracotta); }
.tm-quote input, .tm-quote textarea { font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid #D9CFC2; border-radius: 8px; background: #FBF9F6; color: var(--tm-charcoal); width: 100%; box-sizing: border-box; }
.tm-quote input:focus, .tm-quote textarea:focus { outline: 2px solid var(--tm-terracotta); outline-offset: 1px; background: #fff; }
.tm-quote__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 14px 0 0; font-size: 15px; color: var(--tm-muted); }
.tm-quote__actions .wp-element-button { border: 0; cursor: pointer; }
.tm-quote__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.tm-quote__notice { border-radius: 8px; padding: 14px 16px; margin: 0 0 14px; font-size: 15px; }
.tm-quote__notice--ok { background: #EEF6EE; border: 1px solid #B9D8B9; }
.tm-quote__notice--err { background: #FBEDEA; border: 1px solid #E8B9AD; }
@media (max-width: 600px) { .tm-quote__grid { grid-template-columns: 1fr; } }

/* ---------- Quote-only mode ---------- */
.tm-quote-only .wp-block-woocommerce-add-to-cart-form,
.tm-quote-only .wp-block-woocommerce-product-button,
.tm-quote-only .wc-block-components-product-button { display: none !important; }
.tm-quote-btn { background: transparent !important; color: var(--tm-terracotta) !important; border: 1.5px solid var(--tm-terracotta) !important; border-radius: 6px; font-weight: 700; }

/* ---------- Classic product grid ([products] shortcode) ---------- */
.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; display: flex; flex-direction: column; }
.woocommerce ul.products li.product .price { display: block; padding: 0 14px; margin: 0; }
.woocommerce ul.products li.product > *:not(.woocommerce-LoopProduct-link) { margin-left: 14px !important; margin-right: 14px !important; }
.woocommerce ul.products li.product .tinv-wraper { font-size: 13px; margin-top: 6px !important; }
@media (max-width: 900px) { .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* ---------- Mobile header polish ---------- */
@media (max-width: 781px) {
	.tm-utility .alignwide > p:first-child { display: none; }
	.tm-utility .alignwide { justify-content: center !important; }
	.tm-utility { padding-top: 8px !important; padding-bottom: 8px !important; }
	.tm-header .wp-block-navigation { margin-left: auto; }
}
