/* Diwan Canada – Favourites & Sign-in Links
   Colours follow the Diwan Canada palette:
   red #C63D32 · orange #F28A3A · cream #FFF8EF · graphite #2D2926 · blush #F7DFD0 */

:root {
	--dwf-red: #C63D32;
	--dwf-orange: var(--diwan-orange, #F28A3A);
	--dwf-cream: #FFF8EF;
	--dwf-ink: var(--diwan-graphite, #2D2926);
	--dwf-blush: #F7DFD0;
	--dwf-font: var(--cs-font-primary-family, "Plus Jakarta Sans"), "Plus Jakarta Sans", sans-serif;
}

/* ---------- heart on book cards ---------- */

li.product > button.dwf-heart.dwf-heart {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	color: var(--dwf-ink);
	box-shadow: 0 1px 5px rgba(45, 41, 38, 0.2);
	line-height: 1;
	cursor: pointer;
	transition: transform 0.15s ease, color 0.15s ease;
}

li.product > button.dwf-heart.dwf-heart:hover {
	color: var(--dwf-red);
	transform: scale(1.06);
}

li.product > button.dwf-heart.dwf-heart:focus-visible,
button.dwf-save.dwf-save:focus-visible {
	outline: 2px solid var(--dwf-red);
	outline-offset: 2px;
}

li.product > button.dwf-heart[aria-pressed="true"] {
	color: var(--dwf-red);
}

.dwf-heart svg,
.dwf-save svg {
	width: 20px;
	height: 20px;
	pointer-events: none;
}

.dwf-heart[aria-pressed="true"] svg path,
.dwf-save[aria-pressed="true"] svg path {
	fill: currentColor;
}

.dwf-pop {
	animation: dwf-pop 0.3s ease;
}

@keyframes dwf-pop {
	50% { transform: scale(1.18); }
}

/* ---------- product page button ---------- */

button.dwf-save.dwf-save {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 48px;
	margin: 12px 0 0;
	padding: 0 20px;
	border: 1px solid var(--dwf-ink);
	border-radius: 10px;
	background: transparent;
	color: var(--dwf-ink);
	font-family: var(--dwf-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

button.dwf-save.dwf-save:hover {
	border-color: var(--dwf-red);
	color: var(--dwf-red);
}

button.dwf-save[aria-pressed="true"] {
	border-color: var(--dwf-red);
	background: var(--dwf-cream);
	color: var(--dwf-red);
}

/* ---------- header links ---------- */

.dwf-header {
	display: flex;
	align-items: center;
	gap: 20px;
}

.diwan-header__actions .dwf-header__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	color: var(--cs-color-primary, var(--dwf-ink));
	text-decoration: none;
	background: none;
}

.dwf-header__link svg {
	flex: none;
	width: 20px;
	height: 20px;
}

.dwf-header__label {
	font-family: var(--dwf-font);
	font-size: 12px;
	font-weight: 700;
}

.dwf-header__label span {
	padding-bottom: 0.25em;
	background-image: linear-gradient(to right, currentColor 0%, currentColor 98%);
	background-repeat: no-repeat;
	background-position: left 100%;
	background-size: 0 1px;
	transition: background-size 0.25s ease;
}

.dwf-header__link:hover .dwf-header__label span {
	background-size: 100% 1px;
}

.dwf-header__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 2px;
	background: var(--dwf-orange);
	color: var(--dwf-ink);
	font-family: var(--dwf-font);
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
}

.dwf-header__count[hidden] {
	display: none;
}

@media (max-width: 991px) {
	.dwf-header {
		gap: 4px;
	}
	.dwf-header__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
	.diwan-header__actions .dwf-header__link {
		min-width: 36px;
		justify-content: center;
	}
	.dwf-header__count {
		position: absolute;
		top: 4px;
		right: -4px;
	}
}

/* On small phones the centred logo needs the room: Sign in stays in the
   footer menu and on the Favourites page instead. */
@media (max-width: 519px) {
	.diwan-header__actions .dwf-header__account {
		display: none;
	}
}

/* ---------- toast ---------- */

.dwf-toast {
	position: fixed;
	left: 50%;
	bottom: 20px;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: calc(100% - 32px);
	max-width: 420px;
	padding: 14px 14px 14px 18px;
	border-radius: 12px;
	background: var(--dwf-ink);
	color: #fff;
	box-shadow: 0 8px 28px rgba(45, 41, 38, 0.28);
	font-family: var(--dwf-font);
	font-size: 14px;
	line-height: 1.45;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 12px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.dwf-toast.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.dwf-toast__body {
	flex: 1;
}

.dwf-toast__title,
.dwf-toast__text {
	display: block;
}

.dwf-toast__title {
	margin-bottom: 2px;
	font-weight: 700;
}

.dwf-toast__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: 12px;
}

.dwf-toast a.dwf-toast__btn {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 8px;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.dwf-toast a.dwf-toast__btn--primary {
	border-color: var(--dwf-red);
	background: var(--dwf-red);
}

.dwf-toast a.dwf-toast__link {
	color: #fff;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

button.dwf-toast__close.dwf-toast__close {
	flex: none;
	width: 28px;
	height: 28px;
	min-height: 0;
	margin: -4px -4px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 20px;
	line-height: 28px;
	cursor: pointer;
}

/* ---------- Favourites page ---------- */

.dwf-page {
	font-family: var(--dwf-font);
}

.dwf-page__count {
	margin: 0 0 8px;
	color: var(--dwf-ink);
	font-weight: 600;
}

.dwf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 32px 24px;
	margin: 16px 0 32px;
	padding: 0;
	list-style: none;
}

.dwf-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	text-align: center;
}

.dwf-item::before {
	display: none;
}

.dwf-page a.dwf-item__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
	color: var(--dwf-ink);
	text-decoration: none;
}

.dwf-item__cover {
	display: block;
	width: 100%;
	aspect-ratio: 2 / 3;
	margin-bottom: 8px;
	overflow: hidden;
	background: var(--dwf-cream);
	box-shadow: 0 2px 8px rgba(45, 41, 38, 0.12);
}

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

.dwf-item__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.dwf-item__author {
	color: #6b6461;
	font-size: 13px;
}

.dwf-page a.dwf-item__link:hover .dwf-item__title {
	color: var(--dwf-red);
}

button.dwf-item__remove.dwf-item__remove {
	min-height: 0;
	margin-top: 10px;
	padding: 4px 6px;
	border: 0;
	background: none;
	color: #6b6461;
	font-family: var(--dwf-font);
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

button.dwf-item__remove.dwf-item__remove:hover {
	color: var(--dwf-red);
}

.dwf-empty {
	max-width: 460px;
	margin: 24px auto 32px;
	padding: 40px 24px;
	border-radius: 16px;
	background: var(--dwf-cream);
	text-align: center;
}

.dwf-empty__icon {
	display: inline-flex;
	color: var(--dwf-red);
}

.dwf-empty__icon svg {
	width: 36px;
	height: 36px;
}

.dwf-empty__icon svg path {
	fill: currentColor;
}

.dwf-page .dwf-empty__title {
	margin: 12px 0 8px;
	font-size: 22px;
}

.dwf-page a.dwf-button,
.dw-join.dw-join .wp-block-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 24px;
	border-radius: 10px;
	background: var(--dwf-red);
	color: #fff;
	font-family: var(--dwf-font);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.dwf-page a.dwf-button:hover,
.dw-join.dw-join .wp-block-button .wp-block-button__link:hover {
	background: var(--dwf-ink);
	color: #fff;
}

.dwf-page__note {
	color: #6b6461;
	font-size: 14px;
	text-align: center;
}

.dwf-page .dwf-page__note a {
	color: var(--dwf-red);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Sign in / Join page (blocks with dw-join classes) ---------- */

.dw-join {
	font-family: var(--dwf-font);
	color: var(--dwf-ink);
}

.dw-join .dw-join__intro {
	margin: 0 0 28px;
	font-size: 20px;
	font-weight: 600;
}

.dw-join .dw-join__cols {
	gap: 24px;
	margin-bottom: 40px;
}

.dw-join .dw-join__card {
	padding: 32px 28px;
	border: 1px solid #eadfd6;
	border-radius: 16px;
	background: #fff;
}

.dw-join .dw-join__card--join {
	border-color: var(--dwf-blush);
	background: var(--dwf-cream);
}

.dw-join .dw-join__eyebrow {
	margin: 0 0 6px;
	color: var(--dwf-red);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.dw-join .dw-join__card h2 {
	margin: 0 0 12px;
	font-size: 26px;
	line-height: 1.2;
}

.dw-join .dw-join__card h3 {
	margin: 28px 0 8px;
	font-size: 16px;
}

.dw-join .dw-join__benefits {
	margin: 16px 0 20px;
	padding: 0;
	list-style: none;
}

.dw-join .dw-join__benefits li {
	position: relative;
	margin: 0 0 10px;
	padding-left: 28px;
}

.dw-join .dw-join__benefits li::before {
	content: "♡";
	position: absolute;
	top: 0;
	left: 0;
	color: var(--dwf-red);
	font-weight: 700;
}

.dw-join .dw-join__gift {
	margin: 0 0 20px;
	padding: 14px 16px;
	border-left: 4px solid var(--dwf-orange);
	border-radius: 8px;
	background: #fff;
}

.dw-join p.dw-join__small {
	margin: 12px 0 0;
	color: #6b6461;
	font-size: 14px;
}

.dw-join .dw-join__links {
	margin: 0;
	padding-left: 18px;
}

.dw-join .dw-join__links li {
	margin-bottom: 6px;
}

.dw-join a:not(.wp-block-button__link) {
	color: var(--dwf-red);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dw-join .dw-join__privacy {
	max-width: 760px;
	padding-top: 8px;
	border-top: 1px solid #eadfd6;
	font-size: 15px;
}

.dw-join .dw-join__privacy h2 {
	margin: 24px 0 12px;
	font-size: 20px;
}

@media (max-width: 781px) {
	.dw-join .dw-join__card {
		padding: 24px 20px;
	}
	.dw-join.dw-join .wp-block-button,
	.dw-join.dw-join .wp-block-button .wp-block-button__link {
		width: 100%;
	}
}

/* ---------- Collection pages (Browse all) ---------- */

/* A smaller page title, the same size as the homepage section headings. */
.woocommerce-area .woocommerce-products-header .woocommerce-products-header__title {
	font-size: 2.25rem;
	line-height: 1.2;
}

@media (max-width: 767px) {
	.woocommerce-area .woocommerce-products-header .woocommerce-products-header__title {
		font-size: 1.875rem;
	}
}
