/*
 * Shopolyst brand layer.
 * Realises the active Novamira design ("Shopolyst Storefront") on top of
 * Blocksy + WooCommerce. Only enforces what the design declares as hard rules:
 * one accent, square corners with pill badges, and no elevation anywhere.
 */

:root {
	--sp-bg: #FFFFFF;
	--sp-surface: #F4F4F4;
	--sp-ink: #121212;
	--sp-accent: #B66D4C;
	--sp-accent-hover: #8F5238;
	--sp-highlight: #FACC15;
	--sp-muted: #6B6560;
	--sp-border: #E2DDD8;
	--sp-grid-gap: 8px;

	--theme-font-family: "Sour Gummy", system-ui, -apple-system, sans-serif;
	--theme-headings-font-family: "Lora", Georgia, "Times New Roman", serif;
	--theme-button-border-radius: 0px;
}

body,
.entry-content {
	font-family: var(--theme-font-family);
	color: var(--sp-ink);
	background-color: var(--sp-bg);
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.woocommerce-loop-product__title {
	font-family: var(--theme-headings-font-family);
	color: var(--sp-ink);
}

/* Display type sits tight; the browser default reads as untouched. */
h1, h2 { line-height: 1.1; }
h3, h4 { line-height: 1.2; }

/* Product titles use the body face so a long title never fights a section heading. */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--theme-font-family);
	font-size: 15px;
	line-height: 1.35;
	font-weight: 400;
}

/* ---- One accent, and only for actions ---- */

a { color: var(--sp-accent); text-decoration: none; }
a:hover { color: var(--sp-accent-hover); text-decoration: underline; }

.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce ul.products li.product .button,
.wp-element-button,
.wc-block-components-button {
	background-color: var(--sp-accent);
	color: #FFFFFF;
	border: 1px solid var(--sp-accent);
	border-radius: 0;
	box-shadow: none;
	font-family: var(--theme-font-family);
	font-weight: 700;
	letter-spacing: 0;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce ul.products li.product .button:hover,
.wc-block-components-button:hover {
	background-color: var(--sp-accent-hover);
	border-color: var(--sp-accent-hover);
	color: #FFFFFF;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt {
	background-color: var(--sp-accent);
	color: #FFFFFF;
}

/* Secondary: white ground, accent stroke. */
.woocommerce a.button.wc-backward,
.button.is-secondary {
	background-color: #FFFFFF;
	color: var(--sp-accent);
	border: 1px solid var(--sp-accent);
}

.woocommerce .price,
.woocommerce ul.products li.product .price {
	color: var(--sp-ink);
	font-family: var(--theme-font-family);
}

.woocommerce .price del { color: var(--sp-muted); font-weight: 400; }
.woocommerce .price ins { text-decoration: none; font-weight: 700; }

/* ---- Square everywhere; pills only for badges ---- */

.woocommerce ul.products li.product img,
.woocommerce div.product div.images img,
.wp-post-image,
.woocommerce ul.products li.product,
.woocommerce-page .card,
input, select, textarea,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
	border-radius: 0 !important;
}

.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale,
.wc-block-components-product-sale-badge {
	background-color: var(--sp-highlight);
	color: var(--sp-ink);
	border-radius: 999px;
	box-shadow: none;
	font-family: var(--theme-font-family);
	font-weight: 700;
	text-transform: none;
	min-height: 0;
	min-width: 0;
	line-height: 1;
	padding: 7px 14px;
}

/* ---- No elevation. Hierarchy comes from scale, weight and the accent ---- */

.woocommerce ul.products li.product,
.woocommerce div.product,
.woocommerce-page .card,
.ct-media-container,
[class*="ct-"] .entry-card {
	box-shadow: none !important;
	border: 0;
}

/* ---- Dense catalogue grid: the 8px gap does the separating ---- */

.woocommerce ul.products {
	gap: var(--sp-grid-gap);
	column-gap: var(--sp-grid-gap);
	row-gap: calc(var(--sp-grid-gap) * 3);
}

.woocommerce ul.products li.product { margin-bottom: 0; }

/* ---- Hairlines instead of cards ---- */

.woocommerce div.product .woocommerce-tabs ul.tabs,
.woocommerce table.shop_table,
.woocommerce table.shop_table td,
hr {
	border-color: var(--sp-border);
}

/* ---- Announcement strip: the two strongest conversion lines on the old store ---- */

.sp-announcement {
	background-color: var(--sp-ink);
	color: #FFFFFF;
	font-family: var(--theme-font-family);
	font-size: 13px;
	line-height: 1;
	letter-spacing: 0.02em;
	padding: 11px 16px;
	text-align: center;
}

.sp-announcement strong { color: var(--sp-highlight); font-weight: 700; }

@media (max-width: 600px) {
	.sp-announcement { font-size: 12px; padding: 9px 12px; }
}

/* ---- Homepage journal teaser (two items, never a row of three) ---- */

.sp-journal {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	gap: 32px;
	align-items: start;
	width: 100%;
}

.sp-journal__item { display: block; color: var(--sp-ink); text-decoration: none; }
.sp-journal__item:hover { color: var(--sp-accent); text-decoration: none; }

.sp-journal__media { display: block; margin-bottom: 14px; }
.sp-journal__media img { display: block; width: 100%; height: auto; border-radius: 0; }

.sp-journal__title {
	display: block;
	font-family: var(--theme-headings-font-family);
	font-size: 19px;
	line-height: 1.2;
	margin-bottom: 6px;
}

.sp-journal__date { display: block; font-size: 13px; color: var(--sp-muted); }

.sp-journal__all {
	align-self: center;
	white-space: nowrap;
	border-bottom: 1px solid var(--sp-accent);
	padding-bottom: 2px;
	font-weight: 700;
}

.sp-journal__all:hover { text-decoration: none; }

@media (max-width: 880px) {
	.sp-journal { grid-template-columns: 1fr; gap: 28px; }
	.sp-journal__all { justify-self: start; }
}

/* ---- Collection tiles on the homepage ---- */

.woocommerce ul.products li.product-category .woocommerce-loop-category__title {
	font-family: var(--theme-font-family);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	padding-top: 10px;
	color: var(--sp-ink);
}

.woocommerce ul.products li.product-category .woocommerce-loop-category__title .count {
	background: transparent;
	color: var(--sp-muted);
	font-weight: 400;
}

/* =========================================================================
   Product gallery (replaces Blocksy's non-initialising flexy slider)
   ========================================================================= */

.sp-gallery {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
}

.sp-gallery__stage {
	position: relative;
	order: 2;
	background: var(--sp-bg);
	border: 1px solid var(--sp-border);
}

/* Square stage with contain: product shots arrive at mixed crops from the
   supplier, and cropping them loses the product itself. */
.sp-gallery__open {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	overflow: hidden;
}

.sp-gallery__main {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	border-radius: 0;
	transition: transform .35s ease;
}

.sp-gallery__open:hover .sp-gallery__main { transform: scale(1.04); }
.sp-gallery__open:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }

.sp-gallery__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	background: var(--sp-highlight);
	color: var(--sp-ink);
	font-family: var(--theme-font-family);
	font-weight: 700;
	font-size: 12px;
	line-height: 1;
	padding: 7px 12px;
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
}

.sp-gallery__rail {
	order: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 620px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.sp-gallery__thumb {
	flex: none;
	width: 84px;
	height: 84px;
	padding: 0;
	border: 1px solid var(--sp-border);
	background: var(--sp-bg);
	cursor: pointer;
	overflow: hidden;
	transition: border-color .15s ease;
}

.sp-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-gallery__thumb:hover { border-color: var(--sp-muted); }
.sp-gallery__thumb.is-active { border-color: var(--sp-accent); border-width: 2px; }
.sp-gallery__thumb:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 1px; }

@media (max-width: 780px) {
	.sp-gallery { grid-template-columns: 1fr; }
	.sp-gallery__stage { order: 1; }
	.sp-gallery__rail {
		order: 2;
		flex-direction: row;
		max-height: none;
		overflow-x: auto;
		padding-bottom: 4px;
	}
}

/* ---- Lightbox ---- */

.sp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(18, 18, 18, .93);
	display: grid;
	place-items: center;
	padding: 32px;
	cursor: zoom-out;
}

.sp-lightbox[hidden] { display: none !important; }
.sp-lightbox img { max-width: min(1100px, 92vw); max-height: 90vh; object-fit: contain; }

.sp-lightbox__close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 40px;
	height: 40px;
	font-size: 30px;
	line-height: 1;
	color: #FFFFFF;
	background: none;
	border: 0;
	cursor: pointer;
}

/* =========================================================================
   Catalogue cards — square, never letterboxed, never distorted
   ========================================================================= */

.woocommerce ul.products li.product img,
.woocommerce ul.products li.product .ct-media-container,
.woocommerce ul.products li.product-category img {
	aspect-ratio: 1 / 1 !important;
	object-fit: cover;
	width: 100%;
	height: auto;
}

.woocommerce ul.products li.product .ct-media-container { display: block; }

/* Even card heights so a long title never staggers the row. */
.woocommerce ul.products li.product {
	display: flex;
	flex-direction: column;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
}

.woocommerce ul.products li.product .price { margin-top: auto; }

/* =========================================================================
   Header: legible navigation and a visible basket
   ========================================================================= */

.ct-header [data-id="menu"] .menu > li > a,
header nav a {
	font-size: 14px !important;
	letter-spacing: 0.02em;
}

.sp-cart {
	position: fixed;
	top: 52px;
	right: 22px;
	z-index: 9990;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--sp-ink);
	background: var(--sp-bg);
	border: 1px solid var(--sp-border);
	padding: 8px 12px;
	line-height: 1;
	text-decoration: none;
	transition: border-color .15s ease, color .15s ease;
}

.sp-cart:hover { color: var(--sp-accent); border-color: var(--sp-accent); text-decoration: none; }

.sp-cart__count {
	font-family: var(--theme-font-family);
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	min-width: 18px;
	height: 18px;
	display: grid;
	place-items: center;
	background: var(--sp-accent);
	color: #FFFFFF;
	border-radius: 999px;
	padding: 0 5px;
}

@media (max-width: 900px) {
	.sp-cart { top: auto; bottom: 18px; right: 16px; box-shadow: 0 2px 10px rgba(18,18,18,.12); }
}

/* =========================================================================
   Journal strip — one aspect ratio, so a portrait image can't double the row
   ========================================================================= */

.sp-journal__media {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--sp-surface);
}

.sp-journal__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---- Summary detail ---- */

.sp-more-tags { color: var(--sp-muted); }

.woocommerce div.product .product_meta { font-size: 13px; color: var(--sp-muted); }
.woocommerce div.product .product_meta a { color: var(--sp-accent); }

/* =========================================================================
   Footer — replaces Blocksy's unconfigured vendor-credit strip
   ========================================================================= */

.ct-footer { display: none !important; }

.sp-footer {
	background: var(--sp-ink);
	color: #FFFFFF;
	font-family: var(--theme-font-family);
	margin-top: 72px;
}

.sp-footer a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.sp-footer a:hover { color: var(--sp-highlight); text-decoration: none; }

.sp-footer__inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 56px 20px 44px;
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr 1.1fr;
	gap: 40px;
	align-items: start;
}

.sp-footer__mark {
	font-family: var(--theme-font-family);
	font-weight: 700;
	font-size: 22px;
	color: var(--sp-accent);
	display: block;
	margin-bottom: 12px;
}

.sp-footer__brand p {
	margin: 0 0 14px;
	font-size: 14px;
	line-height: 1.6;
	color: rgba(255, 255, 255, .7);
	max-width: 34ch;
}

.sp-footer__promise { font-size: 13px; }
.sp-footer__promise strong { color: var(--sp-highlight); font-weight: 700; }

.sp-footer__col h2 {
	font-family: var(--theme-font-family);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .5);
	margin: 0 0 14px;
}

.sp-footer__col ul { list-style: none; margin: 0; padding: 0; }
.sp-footer__col li { margin-bottom: 9px; font-size: 14px; }

.sp-footer__contact p {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.65;
	color: rgba(255, 255, 255, .7);
}

.sp-footer__bar { border-top: 1px solid rgba(255, 255, 255, .13); }

.sp-footer__inner--bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 18px 20px;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .55);
}

@media (max-width: 900px) {
	.sp-footer__inner { grid-template-columns: 1fr 1fr; gap: 32px; padding: 40px 18px 32px; }
	.sp-footer__brand { grid-column: 1 / -1; }
	.sp-footer__inner--bar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
	.sp-footer__inner { grid-template-columns: 1fr; }
}

/* ---- Add-to-cart disabled state: readable, not washed out ---- */

.woocommerce div.product form.cart .button.disabled,
.woocommerce div.product form.cart .button:disabled,
.woocommerce button.button.disabled {
	background-color: var(--sp-surface) !important;
	border-color: var(--sp-border) !important;
	color: var(--sp-muted) !important;
	cursor: not-allowed;
	opacity: 1;
}

/* ---- Variation selects: give them the same weight as the buy button ---- */

.woocommerce div.product form.cart .variations select {
	border: 1px solid var(--sp-border);
	padding: 12px 14px;
	font-family: var(--theme-font-family);
	font-size: 15px;
	background-color: var(--sp-bg);
	color: var(--sp-ink);
	width: 100%;
}

.woocommerce div.product form.cart .variations select:focus-visible {
	outline: 2px solid var(--sp-accent);
	outline-offset: 1px;
}

/* =========================================================================
   Spacing corrections
   ========================================================================= */

/* The hero opened with a dead band above the headline on small screens,
   because the section padding stacked on top of the header's own. */
@media (max-width: 900px) {
	body.home .elementor > .e-con:first-child { padding-top: 24px !important; }
	body.home .elementor > .e-con { padding-top: 40px !important; padding-bottom: 40px !important; }
	body.home .elementor > .e-con .e-con-inner { row-gap: 28px; }
}

/* Announcement strip reads as one line wherever it fits. */
.sp-announcement { text-wrap: balance; }

/* Breadcrumbs are navigation, not a headline. */
.woocommerce-breadcrumb,
.ct-breadcrumbs {
	font-size: 12px;
	letter-spacing: 0.03em;
	color: var(--sp-muted);
}

/* Single product: let the summary breathe next to the square stage. */
.woocommerce div.product .entry-summary > * { margin-bottom: 18px; }
.woocommerce div.product .entry-summary .price { font-size: 26px; }

/* Related products heading matches the rest of the site's section headings. */
.woocommerce .related > h2,
.woocommerce .up-sells > h2 {
	font-family: var(--theme-headings-font-family);
	font-size: 26px;
	line-height: 1.15;
	margin-bottom: 20px;
}

/* Blog archive cards: one ratio, like everywhere else. */
.ct-post-inner .ct-media-container img,
.entries .ct-image-container img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	width: 100%;
}

/* =========================================================================
   About page — alternating text/image rows
   ========================================================================= */

.sp-about { display: grid; gap: 64px; }

.sp-about__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: center;
}

.sp-about__row--flip .sp-about__media { order: -1; }

.sp-about__text h2 {
	font-family: var(--theme-headings-font-family);
	font-size: 30px;
	line-height: 1.12;
	margin: 0 0 14px;
}

.sp-about__text p { margin: 0 0 14px; max-width: 46ch; color: var(--sp-ink); }

.sp-about__img { display: block; width: 100%; height: auto; border-radius: 0; }

.sp-about__cta {
	display: inline-block;
	background: var(--sp-accent);
	color: #FFFFFF;
	font-weight: 700;
	padding: 14px 28px;
	margin-top: 6px;
}

.sp-about__cta:hover { background: var(--sp-accent-hover); color: #FFFFFF; text-decoration: none; }

.sp-about__mission { position: relative; }
.sp-about__img--wide { aspect-ratio: 21 / 9; object-fit: cover; }

.sp-about__missiontext {
	background: var(--sp-ink);
	color: #FFFFFF;
	padding: 32px 36px;
	max-width: 560px;
	margin-top: -60px;
	margin-left: 40px;
	position: relative;
}

.sp-about__missiontext h2 { color: #FFFFFF; margin: 0 0 10px; font-size: 26px; }
.sp-about__missiontext p { margin: 0; color: rgba(255,255,255,.8); }

@media (max-width: 820px) {
	.sp-about { gap: 40px; }
	.sp-about__row { grid-template-columns: 1fr; gap: 22px; }
	.sp-about__row--flip .sp-about__media { order: 0; }
	.sp-about__missiontext { margin: -30px 0 0; padding: 24px; max-width: none; }
	.sp-about__img--wide { aspect-ratio: 16 / 10; }
}
