/* Letters page layout and slider controls */
main#primary {
	padding-top: 90px;
}

.sfadi-slider {
	position: relative;
	width: 100vw;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	box-sizing: border-box;
}

.sfadi-slide {
	min-height: 100vh;
	display: flex;
	align-items: center;
	padding: 1rem 0;
}

.sfadi-slide .container {
	max-width: min(1560px, 96vw);
	margin: 0 auto;
}

.sfadi-slider-prev,
.sfadi-slider-next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 40;
}

.sfadi-slider-prev {
	left: 12px;
}

.sfadi-slider-next {
	right: 12px;
}

.sfadi-slider-indicators {
	display: none !important;
}

.sfadi-slider-dot {
	margin: 0 4px;
	opacity: 0.6;
}

.sfadi-slider-dot.active {
	opacity: 1;
}

/* Letter media framing */
.letter-pdf-canvas-wrapper {
	display: flex;
	justify-content: center;
}

.letter-frame {
	background: #fff;
	padding: 12px;
	border: 1px solid #eee;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.letter-pdf-canvas {
	max-width: 100%;
	width: 100%;
	height: auto;
	display: block;
}

.letter-image img {
	display: block;
	margin: 0 auto;
	width: 100%;
	max-width: 100%;
}

.letter-pdf-fallback {
	display: block;
	text-align: center;
	margin-top: 8px;
}

.letter-pdf-canvas-wrapper .sfadi-canvas-controls {
	left: 50% !important;
	right: auto !important;
	transform: translateX(-50%);
	top: 8px !important;
}

/* Split layout: letter left, products right */
.sfadi-pdf-item {
	margin-bottom: 1rem;
	height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
}

.sfadi-pdf-item-meta {
	font-size: 1.05rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.sfadi-letter-split {
	--bs-gutter-x: 1.25rem;
	flex: 1 1 auto;
	min-height: 0;
}

.sfadi-letter-split > [class*="col-"] {
	display: flex;
	min-height: 0;
}

.sfadi-letter-split > .col-lg-7,
.sfadi-letter-split > .col-lg-5 {
	flex: 0 0 50%;
	max-width: 50%;
}

.sfadi-letter-split .letter-embed,
.sfadi-letter-split .letter-image,
.sfadi-letter-split .letter-doc-link {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: stretch;
	justify-content: stretch;
}

.sfadi-letter-split .letter-image img,
.sfadi-letter-split .letter-pdf-thumb {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.sfadi-letter-split .letter-pdf-canvas-wrapper {
	width: 100%;
	height: 100%;
	justify-content: stretch;
	align-items: stretch;
}

.sfadi-letter-split .letter-frame {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	max-height: 100%;
	overflow: hidden;
}

.sfadi-products-panel {
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
	padding: 14px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.sfadi-products-title {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 0.75rem;
}

.sfadi-products-list {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 0.75rem;
	overflow-y: auto;
	padding-right: 4px;
}

.sfadi-product-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.65rem 0.75rem;
	border: 1px solid #ececec;
	border-radius: 8px;
	background: #fafafa;
}

.sfadi-product-copy {
	min-width: 0;
}

.sfadi-product-name {
	font-weight: 600;
	line-height: 1.3;
	word-break: break-word;
}

.sfadi-product-sku {
	font-size: 0.85rem;
	color: #666;
}

.sfadi-gift-link.button {
	white-space: nowrap;
	text-decoration: none;
	padding: 0.45rem 0.9rem;
	border-radius: 6px;
	font-size: 0.9rem;
	line-height: 1;
}

.sfadi-gift-link-missing {
	color: #888;
	font-size: 0.95rem;
}

.sfadi-products-table {
	margin-bottom: 0;
	font-size: 0.92rem;
}

.sfadi-products-table th {
	font-weight: 700;
	white-space: nowrap;
}

.sfadi-products-empty {
	color: #666;
	font-size: 0.92rem;
}

@media (max-width: 768px) {
	.sfadi-slide {
		min-height: auto;
		padding: 0.75rem 0;
	}

	.sfadi-pdf-item {
		height: auto;
	}

	.sfadi-letter-split {
		display: flex;
		flex-direction: column;
		gap: 0.75rem;
		min-height: calc(100vh - 130px);
	}

	.sfadi-letter-split > .col-lg-7,
	.sfadi-letter-split > .col-lg-5 {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.sfadi-letter-split > .col-lg-7 {
		height: 75vh;
	}

	.sfadi-letter-split > .col-lg-5 {
		height: 25vh;
	}

	.sfadi-letter-split .letter-frame {
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.letter-pdf-canvas,
	.letter-image img {
		max-width: 100%;
		max-height: 100%;
	}

	.letter-frame {
		padding: 10px;
	}

	.sfadi-products-panel {
		padding: 12px;
	}

	.sfadi-products-list {
		justify-content: flex-start;
	}
}

@media (max-width: 480px) {
	.sfadi-letter-split {
		min-height: calc(100vh - 110px);
	}

	.sfadi-letter-split > .col-lg-7 {
		height: 75vh;
	}

	.sfadi-letter-split > .col-lg-5 {
		height: 25vh;
	}

	.letter-pdf-canvas,
	.letter-image img {
		max-width: 100%;
	}

	.letter-frame {
		padding: 8px;
		margin: 0 12px;
	}

	.letter-pdf-canvas-wrapper {
		padding: 0 8px;
	}
}
