/*
 * Styles for jdhd/* blocks. Colours come from the theme's theme.json presets, with fallbacks
 * so the blocks still look right if the theme changes.
 */

:root {
	--jdhd-ink: var(--wp--preset--color--contrast, #141414);
	--jdhd-bg: var(--wp--preset--color--base, #ffffff);
	--jdhd-surface: var(--wp--preset--color--surface, #f4f1ec);
	--jdhd-placeholder: var(--wp--preset--color--placeholder, #dedede);
	--jdhd-line: var(--wp--preset--color--line, #e3e0da);
	--jdhd-muted: var(--wp--preset--color--muted, #6b6661);
	--jdhd-accent: var(--wp--preset--color--accent, #b4532a);
	--jdhd-accent-dark: var(--wp--preset--color--accent-dark, #8c3d1c);
	--jdhd-sale: var(--wp--preset--color--sale, #c8102e);
	--jdhd-radius: var(--wp--custom--radius--card, 11px);
	--jdhd-radius-tile: var(--wp--custom--radius--tile, 32px);
}

/* Buttons ----------------------------------------------------------- */
.jdhd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
	min-height: 2.75rem;
	padding: 0.6em 1.4em;
	border: 1px solid var(--jdhd-ink);
	border-radius: 999px;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.jdhd-btn--dark { background: var(--jdhd-ink); color: var(--jdhd-bg); }
.jdhd-btn--dark:hover, .jdhd-btn--dark:focus-visible { background: var(--jdhd-accent); border-color: var(--jdhd-accent); color: var(--jdhd-bg); }
.jdhd-btn--outline { background: transparent; color: var(--jdhd-ink); }
.jdhd-btn--outline:hover, .jdhd-btn--outline:focus-visible { background: var(--jdhd-ink); color: var(--jdhd-bg); }
.jdhd-btn--light { background: var(--jdhd-bg); border-color: var(--jdhd-bg); color: var(--jdhd-ink); }
.jdhd-btn--light:hover, .jdhd-btn--light:focus-visible { background: var(--jdhd-ink); border-color: var(--jdhd-ink); color: var(--jdhd-bg); }
.jdhd-btn.added::after { content: " ✓"; }
.jdhd-btn.loading { opacity: 0.6; pointer-events: none; }

/* Hero slider ------------------------------------------------------- */
.jdhd-hero {
	position: relative;
	overflow: hidden;
	background: var(--jdhd-placeholder);
	margin-block: 0 !important;
}
.jdhd-hero__track {
	display: flex;
	transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
	touch-action: pan-y;
}
@media (prefers-reduced-motion: reduce) {
	.jdhd-hero__track { transition: none; }
}
.jdhd-hero__slide {
	position: relative;
	flex: 0 0 100%;
	min-height: clamp(22rem, 37vw, 44.7rem);
	display: grid;
	place-items: center;
	text-align: center;
	color: var(--jdhd-ink);
	background: linear-gradient(135deg, var(--jdhd-placeholder), var(--jdhd-surface));
}
.jdhd-hero__slide:nth-child(3n + 2) { background: linear-gradient(135deg, var(--jdhd-surface), #e9dfd3); }
.jdhd-hero__slide:nth-child(3n + 3) { background: linear-gradient(135deg, #e8e2da, var(--jdhd-placeholder)); }
.jdhd-hero__slide.has-image { color: #fff; }
.jdhd-hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.jdhd-hero__slide.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, rgb(0 0 0 / 0.45), rgb(0 0 0 / 0.1) 60%);
}
.jdhd-hero__content {
	position: relative;
	z-index: 1;
	display: grid;
	justify-items: center;
	gap: 1rem;
	padding: 2rem 1rem 4rem;
}
.jdhd-hero__name {
	margin: 0;
	font-size: var(--wp--preset--font-size--display, clamp(3rem, 9vw, 11.25rem));
	font-weight: 300;
	line-height: 1;
	letter-spacing: -0.02em;
}
.jdhd-hero__tagline {
	margin: 0;
	max-width: 40ch;
	font-size: clamp(1.05rem, 1.6vw, 1.5rem);
}
.jdhd-hero__nav {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	z-index: 2;
	width: 3rem;
	height: 3rem;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.85);
	color: var(--jdhd-ink);
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}
.jdhd-hero__nav--prev { left: clamp(0.5rem, 2vw, 2rem); }
.jdhd-hero__nav--next { right: clamp(0.5rem, 2vw, 2rem); }
.jdhd-hero__dots {
	position: absolute;
	bottom: 1.25rem;
	left: 50%;
	translate: -50% 0;
	z-index: 2;
	display: flex;
	gap: 0.5rem;
}
.jdhd-hero__dots button {
	width: 0.75rem;
	height: 0.75rem;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: transparent;
	box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2);
	cursor: pointer;
}
.jdhd-hero__dots button[aria-current="true"] { background: #fff; }
@media (max-width: 600px) {
	.jdhd-hero__nav { display: none; }
}

/* Category hero ----------------------------------------------------- */
.jdhd-cat-hero {
	position: relative;
	display: grid;
	align-items: end;
	min-height: clamp(14rem, 26vw, 28rem);
	overflow: hidden;
	background: linear-gradient(135deg, var(--jdhd-placeholder), var(--jdhd-surface));
	margin-block-start: 0 !important;
}
.jdhd-cat-hero.has-image { color: #fff; }
.jdhd-cat-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jdhd-cat-hero.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.05) 70%); }
.jdhd-cat-hero__content {
	position: relative;
	z-index: 1;
	width: min(100%, 1720px);
	margin-inline: auto;
	padding: 3rem clamp(1rem, 5vw, 6.25rem);
}
.jdhd-cat-hero__name { margin: 0; font-size: clamp(2.5rem, 7vw, 7rem); font-weight: 300; line-height: 1; }
.jdhd-cat-hero__tagline { margin: 0.75rem 0 0; max-width: 34ch; font-size: clamp(1.1rem, 2vw, 1.75rem); font-weight: 600; line-height: 1.25; }

/* Product cards + carousels ----------------------------------------- */
.jdhd-carousel__head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid var(--jdhd-ink);
}
.jdhd-carousel__title { margin: 0; font-size: var(--wp--preset--font-size--xx-large, 2.5rem); }
.jdhd-carousel__nav { display: flex; gap: 0.5rem; margin-left: auto; }
.jdhd-carousel__nav button {
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--jdhd-ink);
	border-radius: 50%;
	background: var(--jdhd-bg);
	color: var(--jdhd-ink);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}
.jdhd-carousel__nav button:disabled { opacity: 0.3; cursor: default; }
.is-static .jdhd-carousel__nav { visibility: hidden; }
.jdhd-carousel__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: clamp(15rem, 22vw, 25rem);
	gap: clamp(1rem, 1.5vw, 1.7rem);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: 0.75rem;
}
.jdhd-carousel__track > * { scroll-snap-align: start; }

.jdhd-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.jdhd-card__media {
	display: block;
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--jdhd-radius-tile);
	background: var(--jdhd-placeholder);
}
.jdhd-card__media img,
.jdhd-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s;
}
.jdhd-card:hover .jdhd-card__media img { transform: scale(1.03); }
.jdhd-card__badge {
	position: absolute;
	top: 1rem;
	left: 1rem;
	padding: 0.2em 0.8em;
	border-radius: 999px;
	background: var(--jdhd-sale);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 700;
}
.jdhd-card__body { display: flex; flex: 1; flex-direction: column; gap: 0.15rem; padding: 1rem 0.25rem 0; }
.jdhd-card__title { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.jdhd-card__title a { color: inherit; text-decoration: none; }
.jdhd-card__label { margin: 0.35rem 0 0; color: var(--jdhd-muted); font-size: 0.75rem; font-weight: 300; text-transform: uppercase; letter-spacing: 0.06em; }
.jdhd-card__price { margin: 0; font-size: 1.5rem; font-weight: 600; }
.jdhd-card__price del { color: var(--jdhd-muted); font-size: 0.7em; font-weight: 400; }
.jdhd-card__price ins { color: var(--jdhd-sale); text-decoration: none; }
.jdhd-card__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 0.9rem; }
.jdhd-card__actions .jdhd-btn { flex: 1 1 8rem; }
.jdhd-card .added_to_cart { flex-basis: 100%; font-size: 0.875rem; }

.jdhd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
	gap: 2rem 1.5rem;
}

/* Favourite heart ---------------------------------------------------- */
.jdhd-fav {
	position: absolute;
	top: 0.9rem;
	right: 0.9rem;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.9);
	color: var(--jdhd-ink);
	cursor: pointer;
	transition: transform 0.15s;
}
.jdhd-fav:hover { transform: scale(1.08); }
.jdhd-fav svg { width: 1.4rem; height: 1.4rem; }
.jdhd-fav.is-active { color: var(--jdhd-sale); }
.jdhd-fav.is-active svg { fill: currentColor; }
.jdhd-product__head .jdhd-fav { position: static; flex: none; background: var(--jdhd-surface); }

.jdhd-favlink { position: relative; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; color: var(--jdhd-ink); }
.jdhd-favlink svg { width: 1.6rem; height: 1.6rem; }
.jdhd-favlink__count {
	position: absolute;
	top: 0;
	right: -0.1rem;
	min-width: 1.1rem;
	padding: 0 0.25rem;
	border-radius: 999px;
	background: var(--jdhd-accent);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.1rem;
	text-align: center;
}

/* Locations ---------------------------------------------------------- */
.jdhd-locations {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
	gap: clamp(1.5rem, 3vw, 5rem);
}
.jdhd-location { display: flex; flex-direction: column; gap: 0.5rem; }
.jdhd-location__name { order: -1; margin: 0 0 0.25rem; font-size: clamp(1.25rem, 1.7vw, 1.875rem); font-weight: 600; }
.jdhd-location__media {
	display: grid;
	place-items: center;
	aspect-ratio: 521 / 420;
	overflow: hidden;
	border-radius: var(--jdhd-radius);
	background: var(--jdhd-placeholder);
	color: var(--jdhd-muted);
}
.jdhd-location__media img, .jdhd-location__media iframe { width: 100%; height: 100%; border: 0; object-fit: cover; }
.jdhd-location__address { margin: 0.5rem 0 0; font-size: 1.125rem; }
.jdhd-location__phone { margin: 0; }
.jdhd-location__phone a { color: inherit; }
.jdhd-location__hours summary { cursor: pointer; color: var(--jdhd-muted); }
.jdhd-location__hours p { margin: 0.5rem 0 0; }
.jdhd-location__directions { align-self: center; margin-top: 0.5rem; }

/* Get in touch -------------------------------------------------------- */
.jdhd-touch {
	height: 100%;
	padding: clamp(1.5rem, 3vw, 3rem);
	border-radius: var(--jdhd-radius);
	background: var(--jdhd-surface);
}
.jdhd-touch__title { margin: 0 0 1.5rem; font-size: clamp(1.75rem, 2.3vw, 2.5rem); }
.jdhd-touch__list { display: grid; gap: 1.25rem; margin: 0; padding: 0; list-style: none; font-size: 1.125rem; }
.jdhd-touch__list li { display: flex; gap: 0.9rem; align-items: flex-start; }
.jdhd-touch__list a { color: inherit; }
.jdhd-touch__icon { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--jdhd-bg); }
.jdhd-touch__icon svg { width: 1.25rem; height: 1.25rem; }

/* Forms --------------------------------------------------------------- */
.jdhd-form { display: grid; gap: 1rem; }
.jdhd-form *, .jdhd-signup *, .jdhd-artwork * { box-sizing: border-box; }
.jdhd-form__group { display: grid; gap: 1rem; margin: 0 0 0.5rem; padding: 0; border: 0; }
.jdhd-form__group legend { margin-bottom: 0.75rem; padding: 0; font-size: 1.25rem; font-weight: 700; }
.jdhd-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.jdhd-field { display: grid; gap: 0.35rem; margin: 0; }
.jdhd-field label { font-weight: 600; font-size: 0.9375rem; }
.jdhd-field small { color: var(--jdhd-muted); }
.jdhd-field input:not([type="checkbox"]):not([type="file"]),
.jdhd-field select,
.jdhd-field textarea,
.jdhd-signup input {
	width: 100%;
	min-height: 2.9rem;
	padding: 0.7rem 1rem;
	border: 1px solid var(--jdhd-line);
	border-radius: var(--jdhd-radius);
	background: var(--jdhd-bg);
	color: var(--jdhd-ink);
	font: inherit;
}
.jdhd-field input[type="file"] {
	padding: 1rem;
	border: 1px dashed var(--jdhd-muted);
	border-radius: var(--jdhd-radius);
	background: var(--jdhd-surface);
}
.jdhd-field input:focus-visible, .jdhd-field select:focus-visible, .jdhd-field textarea:focus-visible, .jdhd-signup input:focus-visible {
	outline: 2px solid var(--jdhd-accent);
	outline-offset: 1px;
	border-color: transparent;
}
.jdhd-field--check { display: flex; gap: 0.6rem; align-items: flex-start; }
.jdhd-field--check input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.jdhd-field--check label { font-weight: 400; }
.jdhd-form__privacy { margin: 0; color: var(--jdhd-muted); font-size: 0.875rem; }
.jdhd-form .jdhd-btn { justify-self: start; min-width: 12rem; }
.jdhd-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.jdhd-notice { padding: 0.9rem 1.1rem; border-radius: var(--jdhd-radius); font-weight: 600; }
.jdhd-notice--success { background: #e6f4ea; color: #1e5b2e; }
.jdhd-notice--error { background: #fdecea; color: #8a1c1c; }

.jdhd-artwork { display: grid; gap: 0.9rem; margin: 0 0 1.25rem; padding: 1.1rem; border-radius: var(--jdhd-radius); background: var(--jdhd-surface); }

/* Newsletter signup -------------------------------------------------- */
.jdhd-signup { display: grid; gap: 0.75rem; flex: 1 1 26rem; max-width: 40rem; }
.jdhd-signup__row { display: flex; gap: 0.5rem; }
.jdhd-signup input { border-radius: 999px; }

/* Social links ------------------------------------------------------- */
.jdhd-social { display: flex; gap: 0.75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.jdhd-social a { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--jdhd-ink); color: var(--jdhd-bg); }
.jdhd-social a:hover { background: var(--jdhd-accent); }
.jdhd-social svg { width: 1.25rem; height: 1.25rem; }

/* Testimonials & customer photos ------------------------------------ */
.jdhd-quote { margin: 0; padding: 1.75rem; border-radius: var(--jdhd-radius); background: var(--jdhd-surface); }
.jdhd-quote__stars { margin: 0 0 0.5rem; color: var(--jdhd-accent); letter-spacing: 0.1em; }
.jdhd-quote blockquote { margin: 0 0 1rem; font-size: 1.0625rem; }
.jdhd-quote figcaption { display: flex; gap: 0.6rem; align-items: center; }
.jdhd-quote__avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; }
.jdhd-stories__head { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; }
.jdhd-stories__head p { margin: 0; color: var(--jdhd-muted); }
.jdhd-stories__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.jdhd-story { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--jdhd-radius); background: var(--jdhd-placeholder); }
.jdhd-story img { width: 100%; height: 100%; object-fit: cover; }
.jdhd-story__handle { position: absolute; left: 0.6rem; bottom: 0.6rem; padding: 0.15em 0.6em; border-radius: 999px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 0.8125rem; }

/* Request status badges ---------------------------------------------- */
.jdhd-status { display: inline-block; padding: 0.15em 0.7em; border-radius: 999px; background: #eee; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.jdhd-status--new { background: #e8f0fe; color: #1a4ba0; }
.jdhd-status--quoted { background: #fff4e0; color: #8a5300; }
.jdhd-status--paid, .jdhd-status--in_production { background: #e6f4ea; color: #1e5b2e; }
.jdhd-status--ready { background: #d9f2ec; color: #0f5846; }
.jdhd-status--cancelled { background: #fdecea; color: #8a1c1c; }

/* WhatsApp floating button ------------------------------------------- */
.jdhd-whatsapp {
	position: fixed;
	right: clamp(1rem, 2vw, 1.75rem);
	bottom: clamp(1rem, 2vw, 1.75rem);
	z-index: 100;
	display: grid;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	box-shadow: 0 6px 20px rgb(0 0 0 / 0.2);
	transition: transform 0.15s;
}
.jdhd-whatsapp:hover { transform: scale(1.06); color: #fff; }
.jdhd-whatsapp svg { width: 2rem; height: 2rem; }

/* Phones: compact cards, two per carousel view with a peek of the next ------------------- */
@media (max-width: 600px) {
	.jdhd-carousel__track { grid-auto-columns: calc((100% - 0.75rem) / 2.2); gap: 0.75rem; }
	.jdhd-carousel__title { font-size: 1.75rem; }
	.jdhd-carousel__nav button { width: 2.25rem; height: 2.25rem; font-size: 1.2rem; }
	.jdhd-card__media { border-radius: 16px; }
	.jdhd-card__title { font-size: 0.9375rem; }
	.jdhd-card__price { font-size: 1.125rem; }
	.jdhd-card__actions { flex-direction: column; flex-wrap: nowrap; gap: 0.4rem; }
	.jdhd-card__actions .jdhd-btn { flex: none; width: 100%; min-height: 2.25rem; padding: 0.45em 0.75em; font-size: 0.8125rem; white-space: normal; }
	.jdhd-fav { top: 0.5rem; right: 0.5rem; width: 2.25rem; height: 2.25rem; }
	.jdhd-fav svg { width: 1.15rem; height: 1.15rem; }
	.jdhd-card__badge { top: 0.5rem; left: 0.5rem; font-size: 0.75rem; }
	.jdhd-btn { white-space: normal; }
}
