/*
Theme Name: Haulpoint
Theme URI: https://example.com/haulpoint
Author: Haulpoint
Description: A lightweight block theme for wholesale (B2B) WooCommerce stores. Every color, font, layout and section is editable from Appearance → Editor, with four ready-made style variations. Pair it with the Haulpoint B2B plugin for hidden prices, account approval and price levels.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
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: haulpoint
Tags: block-patterns, full-site-editing, e-commerce, style-variations, wide-blocks, custom-colors, editor-style
*/

/* Small layer of CSS for things theme.json can't express. Colors always come from the palette,
   so changing a color in Appearance → Editor → Styles updates these too. */

:root {
	--hp-radius: var(--wp--custom--radius--card, 6px);
	--hp-radius-btn: var(--wp--custom--radius--button, 4px);
}

body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

/* ---------- Header ---------- */
.wp-site-blocks > .wp-block-template-part:first-child { position: sticky; top: 0; z-index: 50; }
.admin-bar .wp-site-blocks > .wp-block-template-part:first-child { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > .wp-block-template-part:first-child { top: 0; } }
.wp-site-blocks > * + * { margin-block-start: 0; }
.hp-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.hp-topline { padding-block: 6px; }
.hp-topline p { margin: 0; }
.hp-mainbar { padding-block: 12px; }
.hp-mainbar > * + * { margin-block-start: 10px; }
.hp-brand { gap: 10px; }
.hp-actions { gap: 4px; }
.hp-header .wp-block-site-title a { text-decoration: none; }
.hp-header .wp-block-search { flex: 1 1 320px; max-width: 560px; }
.hp-header .wp-block-search__inside-wrapper { border: 1.5px solid var(--wp--preset--color--line); border-radius: var(--hp-radius-btn); background: var(--wp--preset--color--base); overflow: hidden; padding: 0; }
.hp-header .wp-block-search__input { border: 0; background: transparent; padding: 10px 14px; color: var(--wp--preset--color--contrast); }
.hp-header .wp-block-search__button { margin: 0; border-radius: 0; }
.hp-header .wp-block-search__inside-wrapper:focus-within { border-color: var(--wp--preset--color--accent); }
.hp-logo-text { line-height: 1; }
.hp-logo-text a { text-decoration: none; }
.hp-catnav { border-top: 1px solid var(--wp--preset--color--line); }
.hp-catnav .wp-block-navigation-item__content { padding: 10px 2px; border-bottom: 2px solid transparent; }
.hp-catnav .wp-block-navigation-item__content:hover { border-bottom-color: var(--wp--preset--color--accent); }
@media (max-width: 781px) {
	.hp-header .hp-desktop-search { display: none; }
	.hp-catnav { display: none; }
}
@media (min-width: 782px) {
	.hp-header .hp-mobile-search { display: none; }
	.hp-header .hp-mobile-menu { display: none; }
}

/* ---------- Page sections ---------- */
.hp-main { padding-bottom: clamp(40px, 6vw, 64px); }
.hp-page { padding-top: clamp(24px, 4vw, 40px); }
.hp-section { margin-block-start: clamp(40px, 6vw, 64px) !important; }
.hp-section-head { margin-bottom: 22px; }
.hp-section-head h2 { margin: 0; }
.hp-more-link { margin: 0; font-weight: 600; }
.hp-more-link a { color: var(--wp--preset--color--accent); text-decoration: none; }
.hp-eyebrow { letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Hero ---------- */
.hp-hero { padding-block: clamp(36px, 6vw, 64px); margin-block-start: 0 !important; }
.hp-hero .hp-lead { max-width: 46ch; }
.hp-hero-search { max-width: 540px; }
.hp-hero-search .wp-block-search__inside-wrapper { border: 1.5px solid var(--wp--preset--color--hero-muted); border-radius: var(--hp-radius-btn); background: var(--wp--preset--color--hero-2); overflow: hidden; padding: 0; }
.hp-hero-search .wp-block-search__input { border: 0; background: transparent; color: var(--wp--preset--color--hero-text); padding: 14px 16px; }
.hp-hero-search .wp-block-search__input::placeholder { color: var(--wp--preset--color--hero-muted); }
.hp-hero-search .wp-block-search__button { margin: 0; border-radius: 0; }
.hp-hero-buttons { margin-top: 18px; }
.hp-hero .is-style-outline .wp-block-button__link { color: var(--wp--preset--color--hero-text); border: 1.5px solid var(--wp--preset--color--hero-muted); background: transparent; }
.hp-hero .is-style-outline .wp-block-button__link:hover { border-color: var(--wp--preset--color--hero-text); }

.hp-hero {
	background-image:
		linear-gradient(var(--wp--preset--color--hero-2) 1px, transparent 1px),
		linear-gradient(90deg, var(--wp--preset--color--hero-2) 1px, transparent 1px);
	background-size: 28px 28px;
}
.hp-hero h1 mark, .hp-accent-text { background: none; color: var(--wp--preset--color--accent); }
.hp-hero .wp-block-image img { width: 100%; height: auto; }

/* ---------- Facts strip ---------- */
.hp-facts-band { border-bottom: 1px solid var(--wp--preset--color--line); padding-block: 18px; margin-block-start: 0 !important; }
.hp-fact p { margin: 0; }
.hp-fact-title { font-weight: 700; letter-spacing: .02em; }
.hp-facts > .wp-block-group { border-left: 1px solid var(--wp--preset--color--line); padding-left: 16px; }
.hp-facts > .wp-block-group:first-child { border-left: 0; padding-left: 0; }
@media (max-width: 781px) { .hp-facts > .wp-block-group { border-left: 0; padding-left: 0; } }

/* ---------- Cards (categories, steps) ---------- */
.hp-card { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: var(--hp-radius); transition: border-color .15s; }
.hp-card:hover { border-color: var(--wp--preset--color--subtle); }
.hp-cat { display: grid !important; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; padding: 12px; }
.hp-cat .wp-block-image { margin: 0; }
.hp-cat .wp-block-image img { border-radius: calc(var(--hp-radius) - 2px); display: block; }
.hp-cat h3 a { text-decoration: none; }
.hp-cat h3 a::after { content: ""; position: absolute; inset: 0; }
.hp-cat { position: relative; }
.hp-cat h3, .hp-cat p { margin: 0; }
.hp-cat > .wp-block-group > * + * { margin-block-start: 2px; }
@media (max-width: 480px) { .hp-cats { grid-template-columns: 1fr 1fr !important; } .hp-cat { grid-template-columns: 52px 1fr; gap: 10px; padding: 10px; } }
.hp-step { padding: 22px; }
.hp-step > * { margin: 0; }
.hp-step > * + * { margin-block-start: 8px; }
.hp-cta-band { margin-top: 16px; padding: 18px 22px; border-radius: var(--hp-radius); }
.hp-cta-band p { margin: 0; }

/* ---------- Product cards (WooCommerce blocks) ---------- */
.wc-block-product-template .wc-block-product,
.wp-block-woocommerce-product-template .wc-block-product,
.wc-block-grid__product {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--hp-radius);
	overflow: hidden;
	display: flex; flex-direction: column;
	padding-bottom: 14px;
	transition: border-color .15s;
}
.wc-block-product:hover { border-color: var(--wp--preset--color--subtle); }
.wc-block-product .wc-block-components-product-image { margin: 0 0 12px !important; background: var(--wp--preset--color--surface-2); }
.wc-block-product .wc-block-components-product-image img { aspect-ratio: 5 / 4; object-fit: contain; }
.wc-block-product > *:not(.wc-block-components-product-image) { padding-left: 14px; padding-right: 14px; }
.wc-block-product .wp-block-post-title { font-family: var(--wp--preset--font-family--body); text-transform: none !important; letter-spacing: 0; font-size: 15px; font-weight: 600; line-height: 1.3; margin: 2px 0 6px; }
.wc-block-product .wp-block-post-title a { text-decoration: none; }
.wc-block-product .wc-block-components-product-sku { margin: 0; }
.wc-block-product > * + * { margin-block-start: 4px; }
.wc-block-product .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }
.wc-block-product .wc-block-components-product-button { margin-top: auto; }
.wc-block-components-product-price,
.wp-block-woocommerce-product-price { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Stock status: show only In stock / Out of stock */
.stock.in-stock, .wc-block-components-product-stock-indicator--in-stock { color: var(--wp--preset--color--success); font-weight: 600; }
.stock.out-of-stock, .wc-block-components-product-stock-indicator--out-of-stock { color: var(--wp--preset--color--danger); font-weight: 600; }

/* Single product */
.single-product .wp-block-post-title { text-transform: uppercase; }
.woocommerce div.product form.cart .button,
.wc-block-components-button:not(.is-link) { border-radius: var(--hp-radius-btn); }
.woocommerce-tabs table.shop_attributes th { font-weight: 500; color: var(--wp--preset--color--muted); }
.woocommerce-tabs table.shop_attributes td { font-family: var(--wp--preset--font-family--mono); font-size: .9em; }

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], select, textarea {
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: var(--hp-radius-btn);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	padding: 9px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 1px; }

/* Footer */
.hp-footer { padding-block: 44px 24px; }
.hp-footer .hp-logo-text { font-size: 1.75rem; }
.hp-footer h4 { letter-spacing: .08em; }
.hp-footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.hp-footer .hp-legal { padding-top: 18px; margin-top: 28px; }
.hp-footer .hp-legal p { margin: 0; }
.hp-footer a { text-decoration: none; }
.hp-footer a:hover { color: var(--wp--preset--color--hero-text); }
.hp-footer .hp-legal { border-top: 1px solid var(--wp--preset--color--hero-2); }

:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Fixes after visual check */
.hp-footer a, .hp-footer .wp-block-site-title a { color: inherit; }
.hp-footer .wp-block-site-title a { color: var(--wp--preset--color--hero-text); }
@media (max-width: 600px) {
	.hp-topline-phone { display: none; }
	.hp-facts { grid-template-columns: 1fr 1fr !important; gap: 14px 16px !important; }
	.hp-fact-title { font-size: 1.3rem !important; }
}
