/* Dhi Astro Core – component styles. Colours come from theme tokens with sensible fallbacks. */
.dhi-scope, :root {
	--dhi-c-primary: var(--dhi-purple-900, #2a1650);
	--dhi-c-royal: var(--dhi-purple-700, #4b2a86);
	--dhi-c-gold: var(--dhi-gold-400, #d4af37);
	--dhi-c-gold-text: var(--dhi-gold-700, #7d5e12);
	--dhi-c-ink: var(--dhi-ink, #1f1830);
	--dhi-c-muted: var(--dhi-muted, #5b5468);
	--dhi-c-surface: var(--dhi-surface, #ffffff);
	--dhi-c-ivory: var(--dhi-ivory, #fbf7ef);
	--dhi-c-line: var(--dhi-line, #e7e0f0);
	--dhi-c-radius: var(--dhi-radius, 16px);
	--dhi-c-shadow: var(--dhi-shadow, 0 1px 2px rgba(42, 22, 80, .06), 0 8px 24px rgba(42, 22, 80, .08));
}

.dhi-icon { display: block; }

/* Buttons (fallback; theme restyles) */
.dhi-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 44px; padding: .7em 1.4em; border-radius: 999px; border: 2px solid transparent;
	font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.dhi-btn--primary { background: var(--dhi-c-gold); color: var(--dhi-c-primary); }
.dhi-btn--primary:hover, .dhi-btn--primary:focus-visible { background: #e6c45c; color: var(--dhi-c-primary); }
.dhi-btn--ghost { border-color: var(--dhi-c-royal); color: var(--dhi-c-royal); background: transparent; }
.dhi-btn--ghost:hover, .dhi-btn--ghost:focus-visible { background: var(--dhi-c-royal); color: #fff; }

/* ---------- Product cards ---------- */
.dhi-cards {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: clamp(16px, 2.5vw, 28px);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.dhi-card {
	display: flex; flex-direction: column; overflow: hidden; margin: 0;
	background: var(--dhi-c-surface); border: 1px solid var(--dhi-c-line);
	border-radius: var(--dhi-c-radius); box-shadow: var(--dhi-c-shadow);
	transition: transform .25s ease, box-shadow .25s ease;
}
.dhi-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(42,22,80,.08), 0 16px 36px rgba(42,22,80,.14); }
.dhi-card__media { display: block; aspect-ratio: 4 / 3; background: var(--dhi-c-ivory); overflow: hidden; }
.dhi-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; }
.dhi-card__body { display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem 1.25rem 1.4rem; flex: 1; }
.dhi-card__title { margin: 0; font-size: 1.35rem; line-height: 1.25; }
.dhi-card__title a { color: var(--dhi-c-primary); text-decoration: none; }
.dhi-card__title a:hover, .dhi-card__title a:focus-visible { color: var(--dhi-c-royal); text-decoration: underline; text-underline-offset: 3px; }
.dhi-card__meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.dhi-card__meta li { font-size: .8rem; padding: .2rem .65rem; border-radius: 999px; background: #f3eefa; color: var(--dhi-c-royal); margin: 0; }
.dhi-card__excerpt { margin: 0; color: var(--dhi-c-muted); font-size: .97rem; }
.dhi-card__footer { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.dhi-card__price { font-weight: 600; color: var(--dhi-c-primary); font-size: 1.1rem; }
.dhi-card__price del { color: var(--dhi-c-muted); font-weight: 400; font-size: .9em; margin-right: .3em; }
.dhi-card__price ins { text-decoration: none; }

/* States */
.dhi-state, .dhi-empty {
	padding: clamp(24px, 4vw, 40px); border-radius: var(--dhi-c-radius); text-align: center;
	background: var(--dhi-c-ivory); border: 1px dashed #d9cdea; color: var(--dhi-c-ink);
}
.dhi-state p { margin: 0 0 .75rem; }
.dhi-state p:last-child { margin-bottom: 0; }
.dhi-state--error { border-style: solid; border-color: #e5b4b4; background: #fff6f6; }
.dhi-state__admin { font-size: .875rem; color: var(--dhi-c-muted); text-align: left; background: #fff; padding: .75rem 1rem; border-radius: 8px; }

/* Pagination */
.dhi-pagination { margin-top: 2rem; }
.dhi-pagination ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; padding: 0; margin: 0; }
.dhi-pagination a, .dhi-pagination span { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--dhi-c-line); text-decoration: none; color: var(--dhi-c-royal); }
.dhi-pagination .current { background: var(--dhi-c-primary); color: #fff; border-color: var(--dhi-c-primary); }

/* Product page facts */
.dhi-product-facts { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin: 0 0 1.25rem; padding: .9rem 1.1rem; border-radius: 12px; background: var(--dhi-c-ivory); border: 1px solid var(--dhi-c-line); }
.dhi-product-facts div { margin: 0; }
.dhi-product-facts dt { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dhi-c-gold-text); font-weight: 600; }
.dhi-product-facts dd { margin: 0; font-weight: 500; color: var(--dhi-c-ink); }

/* ---------- Testimonial carousel ---------- */
.dhi-carousel { position: relative; }
.dhi-carousel__track {
	list-style: none; margin: 0; padding: 4px 4px 12px;
	display: grid; grid-auto-flow: column; grid-auto-columns: 85%;
	gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scroll-padding-inline: 4px;
	scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) { .dhi-carousel__track { grid-auto-columns: calc((100% - 20px) / 2); } }
@media (min-width: 1024px) { .dhi-carousel__track { grid-auto-columns: calc((100% - 40px) / 3); } }
.dhi-carousel.is-ready .dhi-carousel__track { scrollbar-width: none; }
.dhi-carousel.is-ready .dhi-carousel__track::-webkit-scrollbar { display: none; }
.dhi-carousel__track:focus-visible { outline: 3px solid var(--dhi-c-gold); outline-offset: 4px; border-radius: 8px; }
.dhi-carousel__slide { scroll-snap-align: start; margin: 0; }
.dhi-carousel__slide .dhi-lightbox-link,
.dhi-tgrid__item .dhi-lightbox-link {
	display: block; position: relative; border-radius: var(--dhi-c-radius); overflow: hidden;
	background: var(--dhi-c-surface); border: 1px solid var(--dhi-c-line); box-shadow: var(--dhi-c-shadow);
}
.dhi-carousel__slide .dhi-lightbox-link { height: clamp(300px, 42vw, 420px); display: flex; align-items: center; justify-content: center; padding: 12px; }
.dhi-carousel__slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; margin: 0; border-radius: 8px; }
.dhi-lightbox-link:focus-visible { outline: 3px solid var(--dhi-c-gold); outline-offset: 3px; }
.dhi-carousel__controls { display: none; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.dhi-carousel.is-ready .dhi-carousel__controls { display: flex; }
.dhi-carousel.is-static .dhi-carousel__controls { display: none; }
.dhi-carousel__btn {
	width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--dhi-c-line);
	background: var(--dhi-c-surface); color: var(--dhi-c-primary); font-size: 28px; line-height: 1;
	display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--dhi-c-shadow);
	padding: 0 0 4px;
}
.dhi-carousel__btn:hover:not(:disabled), .dhi-carousel__btn:focus-visible { background: var(--dhi-c-primary); color: #fff; }
.dhi-carousel__btn:disabled { opacity: .35; cursor: default; }
.dhi-carousel__btn:focus-visible, .dhi-carousel__dot:focus-visible { outline: 3px solid var(--dhi-c-gold); outline-offset: 2px; }
.dhi-carousel__dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.dhi-carousel__dot { width: 24px; height: 24px; border: 0; padding: 0; background: transparent; cursor: pointer; position: relative; }
.dhi-carousel__dot::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #cfc3e3; transition: background .2s, transform .2s; }
.dhi-carousel__dot[aria-current="true"]::before { background: var(--dhi-c-gold); transform: scale(1.25); }

/* ---------- Testimonial grid (masonry via columns: never crops screenshots) ---------- */
.dhi-tgrid { list-style: none; margin: 0; padding: 0; columns: 1; column-gap: 20px; }
@media (min-width: 600px) { .dhi-tgrid { columns: 2; } }
@media (min-width: 1024px) { .dhi-tgrid { columns: 3; } }
.dhi-tgrid__item { break-inside: avoid; margin: 0 0 20px; }
.dhi-tgrid__item img { width: 100%; height: auto; display: block; margin: 0; }

/* ---------- Lightbox ---------- */
.dhi-lightbox {
	width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 56px 64px;
	border: 0; background: transparent; color: #fff; overflow: hidden;
}
.dhi-lightbox::backdrop { background: rgba(18, 8, 38, .9); }
.dhi-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.dhi-lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dhi-lightbox__figure img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 8px; background: #fff; }
.dhi-lightbox__count { font-size: .9rem; opacity: .85; }
.dhi-lightbox__close, .dhi-lightbox__nav {
	position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
	width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0 0 4px;
}
.dhi-lightbox__close { top: 12px; right: 12px; }
.dhi-lightbox__prev { left: 10px; top: 50%; transform: translateY(-50%); }
.dhi-lightbox__next { right: 10px; top: 50%; transform: translateY(-50%); }
.dhi-lightbox__close:hover, .dhi-lightbox__nav:hover, .dhi-lightbox__close:focus-visible, .dhi-lightbox__nav:focus-visible { background: var(--dhi-c-gold); color: var(--dhi-c-primary); outline: none; }
.dhi-lightbox.is-single .dhi-lightbox__nav { display: none; }
html.dhi-lightbox-open { overflow: hidden; }
@media (max-width: 600px) { .dhi-lightbox { padding: 64px 8px 72px; } .dhi-lightbox__prev, .dhi-lightbox__next { top: auto; bottom: 12px; transform: none; } }

/* ---------- Contact form ---------- */
.dhi-form { display: grid; gap: 1.1rem; }
.dhi-form__note, .dhi-form__privacy { margin: 0; font-size: .9rem; color: var(--dhi-c-muted); }
.dhi-field { display: grid; gap: .4rem; }
.dhi-field label { font-weight: 600; color: var(--dhi-c-ink); }
.dhi-req { color: #a3262a; }
.dhi-field input, .dhi-field textarea {
	width: 100%; min-height: 48px; padding: .75rem 1rem; font: inherit; font-size: 1rem; color: var(--dhi-c-ink);
	background: #fff; border: 1.5px solid #cfc6dc; border-radius: 12px; box-sizing: border-box;
}
.dhi-field textarea { resize: vertical; min-height: 150px; }
.dhi-field input:focus, .dhi-field textarea:focus { outline: 3px solid rgba(212, 175, 55, .55); outline-offset: 1px; border-color: var(--dhi-c-royal); }
.dhi-field.has-error input, .dhi-field.has-error textarea { border-color: #a3262a; }
.dhi-field__error { margin: 0; color: #a3262a; font-size: .9rem; }
.dhi-form button[type="submit"] { justify-self: start; }
.dhi-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.dhi-alert { padding: 1rem 1.2rem; border-radius: 12px; margin-bottom: 1.25rem; font-weight: 500; }
.dhi-alert:focus { outline: 3px solid var(--dhi-c-gold); outline-offset: 2px; }
.dhi-alert--success { background: #edf7ef; border: 1px solid #9ccfa6; color: #1d5a2a; }
.dhi-alert--error { background: #fff4f4; border: 1px solid #e5b4b4; color: #8a1c20; }

/* Contact details */
.dhi-details dl { margin: 0; display: grid; gap: 1rem; }
.dhi-details__row { margin: 0; }
.dhi-details dt { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dhi-c-gold-text); font-weight: 600; }
.dhi-details dd { margin: .2rem 0 0; }
.dhi-placeholder dd { color: #8a1c20; font-style: italic; }
.dhi-social { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.dhi-social li { margin: 0; }
.dhi-social a { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--dhi-c-line); color: var(--dhi-c-royal); }
.dhi-social a:hover, .dhi-social a:focus-visible { background: var(--dhi-c-royal); color: #fff; border-color: var(--dhi-c-royal); }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
	overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}

@media (prefers-reduced-motion: reduce) {
	.dhi-card, .dhi-btn, .dhi-carousel__dot::before { transition: none; }
	.dhi-card:hover { transform: none; }
	.dhi-carousel__track { scroll-behavior: auto; }
}
