/* ============================================================
   product-single.css — Single product page styles
   Loaded only on is_singular('product')
   Design tokens: --wine #8B1A2B | --wine-dark #6A1221
                  --text #1C1C1C | --muted #6B6B6B | --border #E0DBD4
   ============================================================ */

/* ── Outer wrapper ── */
.sp-wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 32px 80px;
}

@media (max-width: 767px) {
	.sp-wrap {
		padding: 0 16px 60px;
	}
}

/* WooCommerce injects its own wrapper divs; neutralise them */
.woocommerce .sp-wrap,
.woocommerce-page .sp-wrap {
	max-width: 1100px;
}

/* ── Neutralise WooCommerce float-based layout ──
   WC sets: div.images { float:left; width:48% } and div.summary { float:right; width:48% }
   Our layout is CSS grid — floats must be cancelled so grid cells fill 100%. */
.sp-gallery-col .woocommerce-product-gallery,
.sp-summary-col div.summary {
	float: none !important;
	width: 100% !important;
	clear: none !important;
}

/* ================================================================
   HERO CARD — white background for gallery + summary
   ================================================================ */

.sp-hero {
	background: #fff;
	border-radius: 16px;
	padding: 36px 36px 44px;
	margin-bottom: 40px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .06), 0 0 0 1px rgba(0, 0, 0, .04);
}

@media (max-width: 767px) {
	.sp-hero {
		padding: 20px 16px 28px;
		margin-bottom: 28px;
		border-radius: 12px;
	}
}

/* ── Two-column product layout ── */
.sp-layout {
	display: grid;
	grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
	gap: 0 32px;
	align-items: start;
}

@media (max-width: 860px) {
	.sp-layout {
		grid-template-columns: 1fr;
		gap: 28px;
	}
}

/* ================================================================
   GALLERY COLUMN
   ================================================================ */

.sp-gallery-col {
	position: sticky;
	top: 24px;
}

@media (max-width: 860px) {
	.sp-gallery-col {
		position: static;
	}
}

/* Main gallery container — no border, no radius (hero card provides the frame) */
.sp-gallery-col .woocommerce-product-gallery {
	margin: 0 !important;
	border-radius: 0;
	overflow: visible;
	background: transparent;
	border: none;
	width: 100% !important;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

/* Hide zoom magnifier icon and jQuery Zoom overlay (we use our own lightbox) */
.sp-gallery-col .woocommerce-product-gallery__trigger {
	display: none !important;
}

/* Kill jQuery Zoom overlay regardless of theme support cache */
.zoomContainer,
.zoomImg {
	display: none !important;
}

/* Flexslider viewport must fill column width */
.sp-gallery-col .woocommerce-product-gallery .flex-viewport {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1.02;
	border-radius: 10px;
	background: #fff;
	overflow: hidden;
}

/* Main product image wrapper
   Do not force the flexslider track or slide widths here.
   WooCommerce writes inline widths for multi-image galleries. */
.sp-gallery-col .woocommerce-product-gallery__wrapper {
	margin: 0;
}

.sp-gallery-col .woocommerce-product-gallery__image {
	padding: 18px 20px;
	background: #fff;
	box-sizing: border-box;
	min-height: 100%;
	height: 100%;
	display: flex !important;
	align-items: center;
	justify-content: center;
}

.sp-gallery-col .woocommerce-product-gallery__image a {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: zoom-in;
	width: 100%;
	min-height: 100%;
}

.sp-gallery-col .woocommerce-product-gallery__image img {
	width: auto !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: calc(100% - 8px);
	display: block;
	margin: 0 auto;
	border-radius: 0;
	object-fit: contain;
}

@media (max-width: 767px) {
	.sp-gallery-col .woocommerce-product-gallery .flex-viewport {
		aspect-ratio: 1 / 1.04;
		border-radius: 8px;
	}

	.sp-gallery-col .woocommerce-product-gallery__image {
		padding: 16px;
	}

	.sp-gallery-col .woocommerce-product-gallery__image img {
		max-height: calc(100% - 8px);
	}
}

/* Thumbnail strip */
.sp-gallery-col .flex-control-thumbs {
	display: flex;
	flex-wrap: nowrap;
	gap: 12px;
	padding: 12px 0 0;
	margin: 0 !important;
	list-style: none;
	border-top: none;
	background: transparent;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	scroll-padding-inline: 0;
}

.sp-gallery-col .flex-control-thumbs li {
	margin: 0;
	padding: 0;
	flex: 0 0 64px;
	width: 64px !important;
}

.sp-gallery-col .flex-control-thumbs li img {
	width: 64px !important;
	height: 82px !important;
	object-fit: contain;
	padding: 0;
	background: transparent;
	border-radius: 0;
	border: none;
	cursor: pointer;
	display: block;
	opacity: .72;
	box-shadow: none;
	transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}

.sp-gallery-col .flex-control-thumbs li img:hover {
	opacity: 1;
	transform: translateY(-1px);
}

.sp-gallery-col .flex-control-thumbs li img.flex-active {
	opacity: 1;
	transform: translateY(-1px);
	box-shadow: 0 2px 0 0 var(--wine, #8B1A2B);
}

.sp-gallery-col .flex-control-thumbs::-webkit-scrollbar {
	display: none;
}

.sp-gallery-col .flex-control-thumbs::-webkit-scrollbar-thumb {
	display: none;
}

@media (max-width: 767px) {
	.sp-gallery-col .flex-control-thumbs {
		gap: 8px;
		padding-top: 10px;
	}

	.sp-gallery-col .flex-control-thumbs li {
		flex-basis: 56px;
		width: 56px !important;
	}

	.sp-gallery-col .flex-control-thumbs li img {
		width: 56px !important;
		height: 72px !important;
	}
}

/* ── Product badges ── */
.sp-gallery-col {
	position: relative;
}

/* Badge container — stacks badges vertically over the gallery */
.sp-badges {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	pointer-events: none;
}

/* Base badge */
.sp-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 5px 12px;
	border-radius: 4px;
	line-height: 1.2;
	white-space: nowrap;
}

/* Sale — wine red */
.sp-badge--sale {
	background: var(--wine, #8B1A2B);
	color: #fff;
}

/* Featured — dark charcoal */
.sp-badge--featured {
	background: #1c1c1c;
	color: #fff;
}

/* Custom (from _winespot_badge meta) — amber */
.sp-badge--custom {
	background: #c47c2b;
	color: #fff;
}

/* WC default .onsale class — neutralise WC's own styles and reroute to sp-badge look */
.sp-gallery-col .onsale {
	position: static !important;
	margin: 0 !important;
	top: auto !important;
	left: auto !important;
	min-height: auto !important;
	min-width: auto !important;
	display: inline-block;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 5px 12px;
	border-radius: 4px;
	line-height: 1.2;
	white-space: nowrap;
	background: var(--wine, #8B1A2B);
	color: #fff;
}

/* ================================================================
   SUMMARY COLUMN
   ================================================================ */

.sp-summary-col .summary {
	padding: 0;
}

/* ── Product title ── */
.sp-summary-col .product_title,
.sp-summary-col h1.product_title {
	font-family: var(--serif, 'Hepta Slab', Georgia, serif);
	font-size: clamp(20px, 3vw, 28px);
	font-weight: 700;
	line-height: 1.2;
	color: var(--text, #1C1C1C);
	margin: 0 0 8px;
}

/* ── Price ── */
.sp-summary-col .price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 4px;
}

.sp-summary-col .price .woocommerce-Price-amount bdi,
.sp-summary-col .price .woocommerce-Price-amount {
	color: var(--wine, #8B1A2B);
	font-size: 22px;
	font-weight: 700;
}

.sp-summary-col .price del {
	color: var(--muted, #6B6B6B);
	font-size: 15px;
	font-weight: 400;
	opacity: .8;
}

.sp-summary-col .price del .woocommerce-Price-amount bdi,
.sp-summary-col .price del .woocommerce-Price-amount {
	color: var(--muted, #6B6B6B);
	font-size: 15px;
	font-weight: 400;
}

.sp-summary-col .price ins {
	text-decoration: none;
}

/* ── Short description ── */
.sp-summary-col .woocommerce-product-details__short-description {
	font-size: 14px;
	color: var(--muted, #6B6B6B);
	line-height: 1.7;
	margin: 10px 0 16px !important;
	min-width: 0;
}

.sp-summary-col .woocommerce-product-details__short-description p {
	margin: 0 0 .5em;
	text-align: justify;
}

.sp-summary-col .woocommerce-product-details__short-description p:last-child {
	margin-bottom: 0;
}

/* ── Add to cart form ── */
.sp-summary-col form.cart {
	margin-top: 20px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

/* ── Quantity stepper (built by product-cart.js) ── */
.sp-stepper {
	display: inline-flex;
	align-items: stretch;
	height: 46px;
	border: 2px solid var(--border, #E0DBD4);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	transition: border-color .2s;
	flex-shrink: 0;
}

.sp-stepper:focus-within {
	border-color: var(--wine, #8B1A2B);
}

.sp-stepper__btn {
	width: 42px;
	border: none;
	background: #f5f2ee;
	cursor: pointer;
	color: var(--text, #1C1C1C);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	flex-shrink: 0;
	transition: background .15s, color .15s;
	user-select: none;
}

.sp-stepper__btn:hover:not(:disabled) {
	background: #e8e1da;
	color: var(--wine, #8B1A2B);
}

.sp-stepper__btn:disabled {
	opacity: .35;
	cursor: default;
}

.sp-stepper__val {
	min-width: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 600;
	color: var(--text, #1C1C1C);
	border-left: 1px solid var(--border, #E0DBD4);
	border-right: 1px solid var(--border, #E0DBD4);
	padding: 0 6px;
	user-select: none;
}

/* Add to cart button */
.sp-summary-col .single_add_to_cart_button,
.sp-summary-col button.single_add_to_cart_button {
	background-color: #d85d25;
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 0 28px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease, transform .15s ease, box-shadow .2s ease;
	text-transform: none;
	letter-spacing: .02em;
	height: 46px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.sp-summary-col .single_add_to_cart_button:hover,
.sp-summary-col button.single_add_to_cart_button:hover {
	background-color: #b94d1c;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(216, 93, 37, .32);
}

.sp-summary-col .single_add_to_cart_button:active {
	transform: translateY(0);
	box-shadow: none;
}

.sp-summary-col .single_add_to_cart_button.disabled,
.sp-summary-col .single_add_to_cart_button:disabled {
	background-color: #c8bdb8;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* AJAX states */
.sp-summary-col .single_add_to_cart_button.sp-btn-loading {
	opacity: .75;
	cursor: wait;
}

.sp-summary-col .single_add_to_cart_button.sp-btn-added {
	background-color: #2e7d32 !important;
	transform: none;
	box-shadow: none;
}

.sp-summary-col .single_add_to_cart_button.sp-btn-error {
	background-color: #c62828 !important;
	transform: none;
	box-shadow: none;
}

/* Hide WC's auto-inserted "View Cart" link — feedback is on the button itself */
.sp-summary-col a.added_to_cart {
	display: none !important;
}

/* Cart error notice */
.sp-cart-notice {
	font-size: 13px;
	padding: 10px 14px;
	border-radius: 6px;
	background: #fde8e8;
	color: #c62828;
	border: 1px solid #f5c6c6;
	margin-top: 8px;
	width: 100%;
}

/* ── Product meta (SKU, categories) ── */
.sp-summary-col .product_meta {
	margin-top: 18px;
	font-size: 12.5px;
	color: var(--muted, #6B6B6B);
	line-height: 1.8;
	border-top: 1px solid var(--border, #E0DBD4);
	padding-top: 12px;
}

.sp-summary-col .product_meta span {
	display: block;
}

.sp-summary-col .product_meta .sku_wrapper {
	color: var(--muted, #6B6B6B);
}

.sp-summary-col .product_meta a {
	color: var(--wine, #8B1A2B);
	text-decoration: none;
}

.sp-summary-col .product_meta a:hover {
	text-decoration: underline;
}

/* ================================================================
   PRODUCT ATTRIBUTES (.product-attributes) — Feather Icons design
   ================================================================ */

.product-attributes {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 1.5rem 0 1.75rem !important;
	align-self: start;
	padding-right: 0;
} 

.product-attributes-group {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px 16px;
}

.product-attr {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	min-width: 0;
}

.attr-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	flex-shrink: 0;
	background: #fff;
	border: 1px solid #d8d8d8;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
	transition: transform .2s ease;
}

.attr-icon svg {
	width: 14px;
	height: 14px;
	color: #8a8a8a;
	stroke: #8a8a8a;
}

/* Keep colored inline backgrounds from PHP subdued and consistent with the compact UI */
.attr-icon[style] {
	border: 1.5px solid rgba(0, 0, 0, .12);
}

.attr-icon[style] svg {
	color: #fff;
	stroke: #fff;
}

.attr-icon[style].attr-icon--light svg {
	color: #fff;
	stroke: #fff;
}

/* Light icon treatment stays neutral and slightly darker for readability */
.attr-icon--light svg {
	color: #767676;
	stroke: #767676;
}

.product-attr:hover .attr-icon {
	transform: scale(1.06);
}

.attr-content {
	display: flex;
	flex-direction: column;
	gap: 1px;
	flex: 1;
	min-width: 0;
	padding-top: 1px;
}

.attr-label {
	font-size: 9.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--muted, #6B6B6B);
	line-height: 1.2;
}

.attr-value {
	font-size: 12px;
	font-weight: 500;
	color: var(--text, #1C1C1C);
	line-height: 1.35;
	display: block;
	min-width: 0;
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: auto;
}

.attr-value .color-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, .1);
	flex-shrink: 0;
	display: inline-block;
}

.attr-value .fi {
	width: 14px;
	height: 10px;
	border-radius: 2px;
	display: inline-block;
	background-size: cover;
	flex-shrink: 0;
	margin-right: 4px;
	vertical-align: baseline;
}

@media (max-width: 480px) {
	.attr-icon {
		width: 28px;
		height: 28px;
	}

	.attr-icon svg {
		width: 13px;
		height: 13px;
	}
}

@media (max-width: 980px) {
	.product-attributes-group {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 10px 12px;
	}
}

@media (max-width: 767px) {
	.product-attributes {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px 12px;
	}

	.product-attributes-group {
		display: contents;
	}

	.sp-summary-col form.cart {
		flex-wrap: nowrap;
		align-items: stretch;
		gap: 8px;
	}

	.sp-stepper {
		height: 42px;
		border-radius: 9px;
	}

	.sp-stepper__btn {
		width: 36px;
	}

	.sp-stepper__val {
		min-width: 36px;
		padding: 0 4px;
		font-size: 14px;
	}

	.sp-summary-col .single_add_to_cart_button,
	.sp-summary-col button.single_add_to_cart_button {
		height: 42px;
		padding: 0 18px;
		font-size: 13px;
		border-radius: 22px;
		flex: 1 1 auto;
		min-width: 0;
		justify-content: center;
		white-space: nowrap;
	}

	.attr-label {
		font-size: 9px;
	}

	.attr-value {
		font-size: 11.5px;
		line-height: 1.4;
	}
}

/* ================================================================
   FULL DESCRIPTION (.sp-desc) — replaces tabs
   ================================================================ */

.sp-desc {
	padding: 40px 0 8px;
	margin-bottom: 48px;
}

.sp-desc-title {
	font-family: var(--serif, 'Hepta Slab', Georgia, serif);
	font-size: 20px;
	font-weight: 700;
	color: var(--text, #1C1C1C);
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--border, #E0DBD4);
}

.sp-desc p,
.sp-desc li {
	font-size: 14.5px;
	color: var(--text, #1C1C1C);
	line-height: 1.85;
	text-align: justify;
}

.sp-desc p {
	margin: 0 0 1em;
}

.sp-desc p:last-child {
	margin-bottom: 0;
}

.sp-desc h3,
.sp-desc h4 {
	font-family: var(--serif, 'Hepta Slab', Georgia, serif);
	font-size: 16px;
	font-weight: 700;
	color: var(--text, #1C1C1C);
	margin: 1.5em 0 .5em;
}

.sp-desc ul,
.sp-desc ol {
	padding-left: 1.4em;
	margin: 0 0 1em;
}

/* ================================================================
   BRAND BLOCK (.sp-brand-block)
   ================================================================ */

.sp-brand-block {
	margin: 0 0 40px;
	border: 1px solid var(--border, #E0DBD4);
	border-radius: 12px;
	overflow: hidden;
	background: #f9f7f5;
}

.sp-brand-inner {
	display: flex;
	gap: 0;
	align-items: stretch;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .2s ease;
}

.sp-brand-inner:hover {
	box-shadow: 0 4px 20px rgba(139, 26, 44, .1);
}

.sp-brand-img-col {
	width: 160px;
	flex-shrink: 0;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0px;
	border-right: 1px solid var(--border, #E0DBD4);
}

.sp-brand-img-col img {
	max-width: 100%;
	max-height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	height: 100%;
	width: 100%;
}

.sp-brand-body {
	padding: 20px 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.sp-brand-eyebrow {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--wine, #8B1A2B);
	margin: 0 0 5px;
}

.sp-brand-name {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 8px;
	font-family: var(--serif, 'Hepta Slab', Georgia, serif);
	color: var(--text, #1C1C1C);
	line-height: 1.2;
}

.sp-brand-desc {
	font-size: 13px;
	color: var(--muted, #6B6B6B);
	line-height: 1.6;
	margin: 0 0 12px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sp-brand-cta {
	font-size: 12px;
	font-weight: 600;
	color: var(--wine, #8B1A2B);
	display: inline-flex;
	align-items: center;
	gap: 5px;
	text-decoration: none;
	transition: gap .15s ease;
}

.sp-brand-cta::after {
	content: '→';
	font-size: 13px;
}

.sp-brand-inner:hover .sp-brand-cta {
	gap: 8px;
}

.sp-brand-img-placeholder {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #ede8e3;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted, #6B6B6B);
	font-size: 20px;
}

@media (max-width: 600px) {
	.sp-brand-inner {
		flex-direction: column;
	}

	.sp-brand-img-col {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid var(--border, #E0DBD4);
		padding: 0px;
		height: 100px;
	}
}

/* ================================================================
   UPSELLS & RELATED PRODUCTS
   ================================================================ */

.sp-wrap .related.products,
.sp-wrap .upsells.products {
	clear: both;
	margin-bottom: 48px;
}

.sp-wrap .related.products > h2,
.sp-wrap .upsells.products > h2 {
	font-family: var(--serif, 'Hepta Slab', Georgia, serif);
	font-size: 20px;
	font-weight: 700;
	color: var(--text, #1C1C1C);
	margin: 0 0 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--border, #E0DBD4);
}

.sp-wrap .related.products ul.products,
.sp-wrap .upsells.products ul.products {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 900px) {
	.sp-wrap .related.products ul.products,
	.sp-wrap .upsells.products ul.products {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 600px) {
	.sp-wrap .related.products ul.products,
	.sp-wrap .upsells.products ul.products {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
}

/* ================================================================
   BREADCRUMB
   ================================================================ */

.sp-wrap .woocommerce-breadcrumb {
	font-size: 0.6rem;
	color: #8b7a70;
	margin: 5px 5px 5px;
	padding: 0;
	opacity: 0.4;
}

.sp-wrap .woocommerce-breadcrumb a {
	color: var(--muted, #6B6B6B);
	text-decoration: none;
}

.sp-wrap .woocommerce-breadcrumb a:hover {
	color: var(--wine, #8B1A2B);
	text-decoration: underline;
}

/* ================================================================
   NOTICES
   ================================================================ */

.sp-wrap .woocommerce-message,
.sp-wrap .woocommerce-error,
.sp-wrap .woocommerce-info {
	border-radius: 8px;
	font-size: 14px;
	margin-bottom: 20px;
	padding: 14px 20px;
}
