/**
 * Shirley May - Product Page Styles
 *
 * Styles for WooCommerce single product layout, image zoom, reviews, specifications,
 * related products, and sticky buy button.
 *
 * @package ShirleyMay
 */

.product-template-default .site-main {
	padding-top: var(--spacing-xl);
}

.single-product-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--spacing-xl);
	margin-bottom: var(--spacing-md);
}

@media (min-width: 992px) {
	.single-product-grid {
		grid-template-columns: 1.2fr 0.8fr;
	}
}

/* ==========================================================================
   Product Gallery
   ========================================================================== */
.product-gallery {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-sm);
}

.product-gallery__main {
	position: relative;
	display: grid;
	place-items: center;
	overflow: hidden;
	aspect-ratio: 5/6;
	padding: 20px;
	box-sizing: border-box;
	background: #ffffff;
	border: 1px solid #eeeeee;
}

.product-gallery__main img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	margin: auto;
	object-fit: contain;
	object-position: center;
	cursor: zoom-in;
}

/* Custom Zoom Indicator */
.product-gallery__zoom-target {
	transition: transform 0.15s ease-out;
	transform-origin: center center;
}

/*
 * Some of the supplied product images include more empty canvas on the left
 * than on the right.  Centre the visible product on small screens without
 * changing the source artwork or the desktop gallery composition.
 */
@media (max-width: 767px) {
	.single-product-grid,
	.product-gallery {
		min-width: 0;
	}

	.product-gallery__main {
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 12px;
	}

	.product-gallery__main .product-gallery__zoom-target {
		position: relative;
		left: -8%;
		max-width: 108%;
	}
}

.product-gallery__thumbs {
	display: flex;
	gap: var(--spacing-xs);
	overflow-x: auto;
}

.product-gallery__thumb {
	width: 80px;
	height: 96px;
	object-fit: contain;
	cursor: pointer;
	border: 1px solid var(--glass-border);
	opacity: 0.5;
	transition: all var(--transition-fast);
}

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover {
	opacity: 1;
	border-color: var(--color-accent);
}

/* ==========================================================================
   Product Information
   ========================================================================== */
.product-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow-wrap: break-word;
	word-break: break-word;
}

.product-info__title {
	font-size: clamp(1.4rem, 5vw, 2.5rem);
	margin-bottom: var(--spacing-xs);
	word-break: break-word;
	overflow-wrap: break-word;
}

.product-info__price {
	font-size: 1.4rem;
	color: var(--color-accent);
	font-weight: 500;
	margin-bottom: var(--spacing-md);
}

.product-info__price del {
	color: var(--color-text-muted);
	font-size: 1.1rem;
	margin-right: var(--spacing-xs);
}

.product-info__desc {
	margin-bottom: var(--spacing-lg);
	font-size: 0.95rem;
	line-height: 1.7;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Quantity and Add to Bag Form */
.product-info__cart-form {
	margin-bottom: var(--spacing-lg);
	border-bottom: 1px solid var(--glass-border);
	padding-bottom: var(--spacing-lg);
}

.cart-form-actions {
	display: flex;
	gap: var(--spacing-sm);
	align-items: center;
	flex-wrap: wrap;
}

.quantity-picker {
	display: flex;
	border: 1px solid var(--color-light-gray);
	height: 50px;
	background: var(--color-dark-gray);
	border-radius: 4px;
	overflow: hidden;
}

.quantity-picker__btn {
	background: none;
	border: none;
	color: var(--color-black);
	width: 44px;
	cursor: pointer;
	font-size: 1.3rem;
	font-weight: 600;
	transition: background var(--transition-fast), color var(--transition-fast);
	display: flex;
	align-items: center;
	justify-content: center;
}

.quantity-picker__btn:hover {
	background: var(--color-black);
	color: var(--color-white);
}

.quantity-picker input[type="number"] {
	border: none;
	text-align: center;
	width: 54px;
	background: none;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--color-black);
	padding: 0;
	pointer-events: none;
	-moz-appearance: textfield;
}

.quantity-picker input[type="number"]::-webkit-inner-spin-button,
.quantity-picker input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
}

.cart-form-actions .btn {
	flex-grow: 1;
	height: 50px;
	min-width: 0;
}

/* Sticky Buy Button (Mobile-first floating action) */
.sticky-buy {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background: var(--color-white);
	border-top: 2px solid #19427B;
	padding: var(--spacing-sm) var(--spacing-md);
	z-index: 998;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transform: translateY(100%);
	transition: transform var(--transition-smooth);
	box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.sticky-buy.is-visible {
	transform: translateY(0);
}

.sticky-buy__details {
	display: flex;
	align-items: center;
	gap: var(--spacing-sm);
	flex: 1;
	min-width: 0;
}

.sticky-buy__title {
	font-family: var(--font-headings);
	font-size: 0.95rem;
	font-weight: 600;
	color: #111111;
	margin-bottom: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sticky-buy__price {
	color: #111111;
	font-size: 0.95rem;
	font-weight: 700;
	white-space: nowrap;
}

#sticky-buy-submit-btn {
	flex-shrink: 0;
	margin-left: var(--spacing-sm);
}

@media (max-width: 767px) {
	body.single-product .back-to-top {
		bottom: 90px !important;
	}
}

/* ==========================================================================
   Product Tabs (Description, Spec, Reviews)
   ========================================================================== */
.product-tabs-container {
	margin-bottom: var(--spacing-xxl);
	position: relative;
}

/* Fade-out gradient hint on the right to signal scrollability */
.product-tabs-container::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 60px;
	height: calc(100% - var(--spacing-lg));
	max-height: 52px;
	pointer-events: none;
	background: linear-gradient(to left, var(--color-black, #0a0a0a) 0%, transparent 100%);
	z-index: 2;
	display: none;
}

@media (max-width: 767px) {
	.product-tabs-container::after {
		display: block;
	}
}

.product-tabs-nav {
	display: flex;
	border-bottom: 1px solid var(--glass-border);
	margin-bottom: var(--spacing-lg);
	overflow-x: auto;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	/* Hide scrollbar for a cleaner look */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.product-tabs-nav::-webkit-scrollbar {
	display: none;
}

.product-tabs-nav__btn {
	background: none;
	border: none;
	color: var(--color-text-muted);
	padding: 1rem var(--spacing-md);
	font-family: var(--font-body);
	font-size: 0.85rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: all var(--transition-fast);
	white-space: nowrap;
	flex-shrink: 0;
}

.product-tabs-nav__btn.is-active {
	color: var(--color-accent);
	border-color: var(--color-accent);
}

.product-tab-panel {
	display: none;
	animation: fadeIn var(--transition-smooth);
}

.product-tab-panel.is-active {
	display: block;
}

.product-community-reviews {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 2rem;
}

.product-community-reviews h3 {
	grid-column: 1 / -1;
	margin: 0 0 0.2rem;
	color: var(--color-black);
	font-size: 1.15rem;
}

.product-community-review {
	padding: 1.25rem;
	border: 1px solid rgba(25, 66, 123, 0.12);
	border-radius: 10px;
	background: #f9fbfe;
}

.product-community-review__stars {
	margin-bottom: 0.65rem;
	color: #bc8b34;
	font-size: 0.82rem;
	letter-spacing: 0.08em;
}

.product-community-review p {
	margin: 0 0 0.9rem;
	color: #3e4a5a;
	font-size: 0.88rem;
	line-height: 1.7;
}

.product-community-review footer {
	color: #19427b;
	font-size: 0.74rem;
	font-weight: 700;
}

@media (max-width: 767px) {
	.product-community-reviews {
		grid-template-columns: 1fr;
	}
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ==========================================================================
   Recently Viewed & Related Products
   ========================================================================== */
.recently-viewed-section {
	margin-top: var(--spacing-xxl);
	border-top: 1px solid var(--glass-border);
	padding-top: var(--spacing-xxl);
}

.recently-viewed-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--spacing-md);
}

@media (min-width: 768px) {
	.recently-viewed-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.recently-viewed-item {
	background: var(--color-dark-gray);
	border: 1px solid var(--glass-border);
	border-radius: var(--border-radius-md);
	overflow: hidden;
	transition: all var(--transition-fast);
}

.recently-viewed-item:hover {
	transform: translateY(-3px);
}

.recently-viewed-item__img {
	aspect-ratio: 5/6;
	overflow: hidden;
}

.recently-viewed-item__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.recently-viewed-item__info {
	padding: var(--spacing-sm);
}

.recently-viewed-item__title {
	font-family: var(--font-headings);
	font-size: 0.95rem;
	margin-bottom: 2px;
}

.recently-viewed-item__price {
	color: var(--color-accent);
	font-size: 0.85rem;
}

/* ==========================================================================
   Premium purchase controls
   ========================================================================== */
.product-info__cart-form .cart-form-actions {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 0.75rem;
}

.product-info__cart-form .quantity-picker {
	display: grid;
	grid-template-columns: 44px 52px 44px;
	height: 52px;
	border: 1px solid #173f78;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 6px 16px rgba(25, 66, 123, 0.08);
}

.product-info__cart-form .quantity-picker__btn {
	width: 44px;
	height: 50px;
	color: #173f78;
	font-size: 1.25rem;
	font-weight: 500;
}

.product-info__cart-form .quantity-picker__btn:hover {
	background: #173f78;
	color: #fff;
}

.product-info__cart-form .quantity-picker input[type="number"] {
	width: 52px;
	height: 50px;
	border-left: 1px solid #dbe3ef;
	border-right: 1px solid #dbe3ef;
	background: #fff;
	color: #173f78;
	font-size: 1rem;
	font-weight: 700;
	line-height: 50px;
}

.product-info__cart-form .single_add_to_cart_button {
	height: 52px;
	border-radius: 6px;
	box-shadow: 0 10px 20px rgba(25, 66, 123, 0.2);
	letter-spacing: 0.1em;
}

/* ==========================================================================
   Related products
   ========================================================================== */
.related.products {
	display: block !important;
	margin-top: var(--spacing-xxl) !important;
	padding-top: var(--spacing-xl);
	border-top: 1px solid #e5e9ef;
}

.related.products > h2 {
	margin: 0 0 2rem;
	color: #173f78;
	font-family: var(--font-headings);
	font-size: clamp(1.8rem, 3vw, 2.6rem);
	font-weight: 600;
	letter-spacing: -0.03em;
}

.related.products > ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 1.5rem !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

/* WooCommerce's legacy clearfix pseudo-elements otherwise occupy grid cells. */
.related.products > ul.products::before,
.related.products > ul.products::after {
	content: none !important;
	display: none !important;
}

.related.products > ul.products li.product.product-card {
	display: flex !important;
	grid-column: auto !important;
	margin: 0 !important;
	border: 1px solid #e2e7ef;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(20, 42, 77, 0.06);
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.related.products > ul.products li.product.product-card:hover {
	border-color: #d0dae8;
	box-shadow: 0 16px 34px rgba(20, 42, 77, 0.12);
	transform: translateY(-5px);
}

.related.products .product-card__img-wrapper {
	aspect-ratio: 4 / 5;
	background: #f8f9fb;
}

.related.products .product-card__img-wrapper img,
.woocommerce .related.products ul.products li.product.product-card .product-card__img-wrapper img {
	padding: 0;
	object-fit: contain;
}

.related.products .product-card__info {
	min-height: 0;
	padding: 1rem 1rem 1.1rem;
}

.related.products .product-card__meta {
	display: none;
}

.related.products .product-card__title {
	margin-bottom: 0.45rem;
	font-size: 1rem;
	font-weight: 600;
}

.related.products .product-card__price-rating {
	margin-top: 0;
}

.related.products .product-card__price {
	color: #173f78;
	font-weight: 600;
}

.related.products .product-card__buy-row {
	margin-top: 1rem;
}

@media (max-width: 991px) {
	.related.products > ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 575px) {
	/* Restructure Add to Bag form on small screens */
	.product-info__cart-form .cart-form-actions {
		display: grid;
		grid-template-columns: auto 1fr auto;
		grid-template-rows: auto auto;
		align-items: center;
		gap: 10px;
	}

	/* Quantity picker: row 1, col 1 */
	.product-info__cart-form .quantity-picker {
		grid-column: 1;
		grid-row: 1;
	}

	/* Wishlist button: row 1, col 3 (right side) */
	.product-info__cart-form .single-product-wishlist-btn {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
	}

	/* Add to Bag: row 2, full width */
	.product-info__cart-form .single_add_to_cart_button {
		grid-column: 1 / -1;
		grid-row: 2;
		width: 100%;
	}

	.related.products > ul.products {
		grid-template-columns: 1fr !important;
	}
}

/* ==========================================================================
   Why Shirley May – Trust Block
   ========================================================================== */
.sm-why-shirley {
	margin-top: 1.25rem;
	border: 1px solid #e5e9ef;
	border-radius: 10px;
	overflow: hidden;
	background: #f8fafd;
}

.sm-why-shirley__heading {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #19427b;
	margin: 0;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #e5e9ef;
	background: #eef4ff;
}

.sm-why-shirley__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sm-why-shirley__list li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 1rem;
	border-bottom: 1px solid #f0f3f8;
	font-size: 0.78rem;
	color: #3e4a5a;
	line-height: 1.4;
}

.sm-why-shirley__list li:last-child {
	border-bottom: none;
}

.sm-why-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #dbe5f4;
	color: #19427b;
	flex-shrink: 0;
}

.sm-why-icon svg {
	width: 14px;
	height: 14px;
}

.sm-why-shirley__list strong {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	color: #1a2535;
	margin-bottom: 1px;
}

.sm-why-shirley__list small {
	font-size: 0.72rem;
	color: #6b7a8d;
}
