/*
 * db-new-arrivals.css v1.2.1
 * Rounded-corner product tile grid for new arrivals.
 *
 * Colors, sizes and weights use the site design tokens from styles.css,
 * each with a hardcoded fallback. Two color schemes, set by instance.mvt:
 *   .db-new-arrivals--scheme-dark   light text on a dark background (Texture, Flat Dark, Custom + light text)
 *   .db-new-arrivals--scheme-light  dark text on a light background (Light, Custom + dark text)
 * The texture image and Custom background are inline styles from instance.mvt.
 *
 * Hover colors use !important with higher specificity so they win over the
 * ".db-new-arrivals a:hover" rule in styles.css (which can be removed once this version is live).
 *
 * Contrast (WCAG AA):
 *   dark  - name #ff3b30 on #2a2a2a 4.05 (passes as large text: 20px bold - keep name at xl + bold),
 *           name hover #ff7a6b 5.64, price #aaaaaa 6.18, focus ring white
 *   light - name #94111e on #f1f1f1 7.88, hover #800017 9.63, price #333333 11.19,
 *           heading #333333 on white 12.63, focus ring #c32b2a 5.03
 */

/* -- Outer wrapper -- */
.db-new-arrivals {
	width: 100%;
	clear: both;
	padding-bottom: 20px;
	font-family: var(--font-primary, 'Lato', sans-serif);
}

.db-new-arrivals--scheme-dark {
	background-color: var(--surface-dark, #1a1a1a); /* also the fallback behind the texture image */
}

.db-new-arrivals--scheme-light {
	background-color: var(--color-white, #ffffff);
}

/* -- Section heading -- */
.db-new-arrivals__heading {
	padding: 20px 20px 10px;
	text-align: center;
}

.db-new-arrivals .db-new-arrivals__heading h2 {
	font-family: var(--font-display, 'Besom', 'Permanent Marker', cursive);
	font-size: var(--font-size-display, 75px);
	font-weight: normal; /* Besom has a single weight - no faux bold in bolder text mode */
	line-height: 1.1;
	margin: 0;
	text-align: center;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.db-new-arrivals--scheme-dark .db-new-arrivals__heading h2 {
	color: var(--color-white, #ffffff);
}

.db-new-arrivals--scheme-light .db-new-arrivals__heading h2 {
	color: var(--text-body, #333333);
}

/* Heading steps down on smaller screens, matching the site h2 */
@media (max-width: 900px) {
	.db-new-arrivals .db-new-arrivals__heading h2 {
		font-size: var(--font-size-6xl, 56px);
	}
}

@media (max-width: 767px) {
	.db-new-arrivals .db-new-arrivals__heading h2 {
		font-size: var(--font-size-5xl, 40px);
	}
}

@media (max-width: 375px) {
	.db-new-arrivals .db-new-arrivals__heading h2 {
		font-size: var(--font-size-4xl, 35px);
	}
}

/* -- Red line divider (decorative) -- */
.db-new-arrivals__divider {
	width: 100%;
	height: 2px;
	background-color: var(--brand-red-dark, #94111e);
	margin: 0 0 12px 0;
}

/* -- Grid (ul) -- */
.db-new-arrivals .db-new-arrivals__grid {
	display: grid;
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 12px 16px 0;
	width: 100%;
	box-sizing: border-box;
}

.db-new-arrivals--cols-4 .db-new-arrivals__grid {
	grid-template-columns: repeat(4, 1fr);
}

.db-new-arrivals--cols-3 .db-new-arrivals__grid {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
	.db-new-arrivals--cols-4 .db-new-arrivals__grid,
	.db-new-arrivals--cols-3 .db-new-arrivals__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.db-new-arrivals--cols-4 .db-new-arrivals__grid,
	.db-new-arrivals--cols-3 .db-new-arrivals__grid {
		grid-template-columns: 1fr;
	}
}

/* -- Tile (li) -- */
.db-new-arrivals .db-new-arrivals__tile {
	list-style: none;
	margin: 0;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0; /* lets long names wrap inside narrow grid columns */
}

.db-new-arrivals--scheme-dark .db-new-arrivals__tile {
	background: #2a2a2a; /* no site token for this raised dark surface */
}

.db-new-arrivals--scheme-light .db-new-arrivals__tile {
	background: var(--surface-muted, #f1f1f1);
	border: 1px solid var(--border-light, #dddddd);
}

/* -- Tile image -- */
.db-new-arrivals__tile-link {
	display: block;
	width: 100%;
}

.db-new-arrivals__image {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 10px 10px 0 0;
}

/* -- Tile info area -- */
.db-new-arrivals__info {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	padding: 0 10px;
	box-sizing: border-box;
}

/* -- Product name -- */
.db-new-arrivals__name {
	margin: 16px 0 10px 0;
	width: 100%;
	text-align: center;
	overflow-wrap: anywhere;
}

.db-new-arrivals .db-new-arrivals__name a {
	font-family: var(--font-primary, 'Lato', sans-serif);
	font-size: var(--font-size-xl, 20px);     /* keep xl + bold: the dark scheme red needs large text */
	font-weight: var(--font-weight-bold, 700);
	line-height: 1.3;
	letter-spacing: var(--letter-spacing-body, normal);
	word-spacing: var(--word-spacing-body, normal);
	text-decoration: none !important;
}

.db-new-arrivals--scheme-dark .db-new-arrivals__name a {
	color: var(--color-link-on-dark, #ff3b30);
}

.db-new-arrivals--scheme-light .db-new-arrivals__name a {
	color: var(--brand-red-dark, #94111e);
}

.db-new-arrivals.db-new-arrivals--scheme-dark .db-new-arrivals__name a:hover {
	color: var(--color-link-hover-on-dark, #ff7a6b) !important;
	text-decoration: underline !important;
}

.db-new-arrivals.db-new-arrivals--scheme-light .db-new-arrivals__name a:hover {
	color: var(--brand-red-deep, #800017) !important;
	text-decoration: underline !important;
}

/* -- Price -- */
.db-new-arrivals__price {
	font-family: var(--font-primary, 'Lato', sans-serif);
	font-size: var(--font-size-lg, 18px);
	font-weight: var(--font-weight-bold, 700);
	letter-spacing: var(--letter-spacing-body, normal);
	word-spacing: var(--word-spacing-body, normal);
	text-align: center;
	margin: 0 0 10px 0;
	width: 100%;
}

.db-new-arrivals--scheme-dark .db-new-arrivals__price {
	color: #aaaaaa; /* no site token for muted text on dark - 6.18 on #2a2a2a */
}

.db-new-arrivals--scheme-light .db-new-arrivals__price {
	color: var(--text-body, #333333);
}

/* -- Shop Now button (mouse/touch only - the name link is the keyboard stop) -- */
.db-new-arrivals .db-new-arrivals__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 260px;
	min-height: 33px; /* grows with larger text instead of clipping */
	margin: 0 auto 16px auto;
	padding: 6px 10px;
	box-sizing: border-box;
	background-image: url('https://www.deliciousboutique.com/mm5/graphics/store-button-background.jpg');
	background-color: var(--brand-red-dark, #94111e);
	background-size: cover;
	color: var(--color-white, #ffffff) !important;
	font-family: var(--font-primary, 'Lato', sans-serif);
	font-size: var(--font-size-md, 16px);
	font-weight: var(--font-weight-black, 900);
	line-height: 1.2;
	letter-spacing: var(--letter-spacing-body, normal);
	word-spacing: var(--word-spacing-body, normal);
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	border-radius: 0;
}

/* Beats ".db-new-arrivals a:hover" in styles.css, which turned the text salmon */
.db-new-arrivals .db-new-arrivals__btn:hover,
.db-new-arrivals .db-new-arrivals__btn:focus {
	opacity: 0.9;
	color: var(--color-white, #ffffff) !important;
}

/* -- When no button shown, add bottom padding to info area -- */
.db-new-arrivals__info:not(:has(.db-new-arrivals__btn)) {
	padding-bottom: 16px;
}

/* -- Keyboard focus -- */
.db-new-arrivals a:focus-visible {
	outline: 2px solid;
	outline-offset: 2px;
}

.db-new-arrivals--scheme-dark a:focus-visible {
	outline-color: var(--color-white, #ffffff);
}

.db-new-arrivals--scheme-light a:focus-visible {
	outline-color: var(--color-focus, #c32b2a);
}

/* -- Empty state placeholder -- */
.db-new-arrivals__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	font-family: var(--font-primary, 'Lato', sans-serif);
	font-size: var(--font-size-sm, 14px);
	font-style: italic;
	text-align: center;
	padding: 1rem;
	box-sizing: border-box;
	border: 2px dashed;
	margin: 12px 16px;
	border-radius: 10px;
}

.db-new-arrivals--scheme-dark .db-new-arrivals__placeholder {
	color: #aaaaaa;
	border-color: #444444; /* decorative */
}

.db-new-arrivals--scheme-light .db-new-arrivals__placeholder {
	color: var(--text-muted, #5f5f5f);
	border-color: var(--border-medium, #bbbbbb); /* decorative */
}

/* -- Accessibility modes not covered by the tokens -- */

/* High contrast: dark scheme uses pure black tiles with a white outline.
   Name links already turn white via --color-link-on-dark. The light scheme follows the tokens:
   tiles turn white and the border darkens to #767676. */
html[data-contrast="high"] .db-new-arrivals--scheme-dark .db-new-arrivals__tile {
	background: var(--color-black, #000000);
	border: 1px solid var(--color-white, #ffffff);
}

html[data-contrast="high"] .db-new-arrivals--scheme-dark .db-new-arrivals__price,
html[data-contrast="high"] .db-new-arrivals--scheme-dark .db-new-arrivals__placeholder {
	color: var(--color-white, #ffffff);
}

/* Underline links mode: the name rule above (text-decoration none !important) is more
   specific than the site's html[data-links="underline"] a rule, so restate it here */
html[data-links="underline"] .db-new-arrivals .db-new-arrivals__name a,
html[data-links="underline"] .db-new-arrivals .db-new-arrivals__btn {
	text-decoration: underline !important;
	text-decoration-thickness: max(1px, 0.06em) !important;
	text-underline-offset: 0.15em;
}

/* Readable spacing: WCAG 1.4.12 asks for at least 1.5 line height */
html[data-spacing="wide"] .db-new-arrivals .db-new-arrivals__name a,
html[data-spacing="wide"] .db-new-arrivals .db-new-arrivals__btn {
	line-height: 1.5;
}

/* -- Mobile product limit -------------------------------------------------
   Tiles beyond the max_products_mobile setting are hidden at mobile
   breakpoints. They remain in the DOM (server-side count is the desktop
   max) but are visually hidden on small screens.
   ------------------------------------------------------------------------ */
@media (max-width: 767px) {
	.db-new-arrivals .db-new-arrivals__tile--mobile-hidden {
		display: none !important;
	}
}
