/**
 * FSC Etsy-style product page — prototype styles (v0.4).
 *
 * Scoped to body.fsc-etsy-product, which is only added on product pages
 * whose "_fsc_etsy_style" meta flag is On. Every other product page is
 * untouched. Modelled on the layout of a typical Etsy listing page:
 * vertical thumbnail rail + large main photo on the left, a single
 * buy column on the right (title, big price, option fields, one large
 * black pill button), icon info lines under the buy box, and the
 * description/details as stacked collapsible sections in that column.
 */

/* --- Overall two-column layout ------------------------------------- */
body.fsc-etsy-product div.product {
	display: flex;
	flex-wrap: wrap;
	column-gap: 56px;
	align-items: flex-start;
}

body.fsc-etsy-product div.product .woocommerce-product-gallery {
	float: none;
	width: auto;
	flex: 1 1 52%;
	min-width: 320px;
	display: flex;
	flex-direction: row;
	gap: 12px;
	opacity: 1 !important; /* flexslider sets opacity 1 when ready anyway */
}

body.fsc-etsy-product div.product .summary {
	float: none;
	width: auto;
	flex: 1 1 38%;
	min-width: 320px;
}

/* Anything after the two columns (related products etc.) stays full width. */
body.fsc-etsy-product div.product > .woocommerce-tabs,
body.fsc-etsy-product div.product > section.products,
body.fsc-etsy-product div.product > .related {
	flex: 1 1 100%;
}

/* --- Gallery: vertical thumbnail rail (Etsy style) ------------------ */
body.fsc-etsy-product .woocommerce-product-gallery .flex-viewport {
	order: 2;
	flex: 1 1 auto;
	border-radius: 12px;
}

body.fsc-etsy-product .woocommerce-product-gallery .flex-control-thumbs {
	order: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 68px;
	flex: 0 0 68px;
	margin: 0;
	padding: 0;
}

body.fsc-etsy-product .woocommerce-product-gallery .flex-control-thumbs li {
	float: none !important;
	width: 68px !important;
	margin: 0 !important;
}

body.fsc-etsy-product .woocommerce-product-gallery .flex-control-thumbs img {
	border-radius: 8px;
	opacity: 0.75;
}

body.fsc-etsy-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active,
body.fsc-etsy-product .woocommerce-product-gallery .flex-control-thumbs img:hover {
	opacity: 1;
	outline: 2px solid #222;
	outline-offset: 1px;
}

body.fsc-etsy-product .woocommerce-product-gallery__image img {
	border-radius: 12px;
}

/* Gallery prev/next arrows + favourite heart (buttons added by JS). */
body.fsc-etsy-product .woocommerce-product-gallery {
	position: relative;
}

.fsc-gallery-arrow,
.fsc-fav-btn {
	position: absolute;
	z-index: 30;
	width: 42px;
	height: 42px;
	border-radius: 999px;
	border: none;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
	color: #222;
	font-size: 20px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}

.fsc-gallery-arrow.prev { left: 92px; top: 50%; transform: translateY(-50%); }
.fsc-gallery-arrow.next { right: 12px; top: 50%; transform: translateY(-50%); }

.fsc-fav-btn { top: 12px; right: 58px; }
.fsc-fav-btn svg { width: 21px; height: 21px; fill: none; stroke: #222; stroke-width: 2; }
.fsc-fav-btn.active svg { fill: #d92b3a; stroke: #d92b3a; }

/* --- Buy column typography ------------------------------------------ */
body.fsc-etsy-product .product_title {
	font-size: 30px;
	font-weight: 500;
	line-height: 1.3;
	color: #222;
	margin-bottom: 10px;
}

body.fsc-etsy-product .summary .price {
	font-size: 28px;
	font-weight: 700;
	color: #222;
}

body.fsc-etsy-product .summary .price .amount {
	font-weight: 700;
}

/* --- Option fields: Etsy-like tall rounded inputs -------------------- */
body.fsc-etsy-product .summary select,
body.fsc-etsy-product .summary input[type="text"],
body.fsc-etsy-product .summary input[type="number"] {
	min-height: 46px;
	border: 1px solid #949494;
	border-radius: 8px;
	padding: 0.5em 0.75em;
	background: #fff;
	width: 100%;
}

body.fsc-etsy-product .summary label {
	font-size: 14px;
	font-weight: 600;
	color: #222;
}

/* Builder form inside the buy column: drop the fieldset boxes for a
   cleaner Etsy-like stack (the builder's own colours/logic are kept). */
body.fsc-etsy-product .fsc-builder {
	max-width: none;
	margin-top: 10px;
}

body.fsc-etsy-product .fsc-fieldset {
	border: none;
	padding: 0;
	margin: 0 0 20px;
}

body.fsc-etsy-product .fsc-fieldset legend {
	font-size: 16px;
	font-weight: 600;
	padding: 0;
	margin-bottom: 10px;
}

body.fsc-etsy-product .fsc-member label {
	flex: 1 1 140px;
}

/* Secondary buttons: outlined pill (Etsy secondary actions). */
body.fsc-etsy-product .fsc-add-member,
body.fsc-etsy-product .fsc-remove-member {
	background: #fff;
	border: 2px solid #222;
	border-radius: 999px;
	color: #222;
	font-weight: 600;
}

/* Primary action: one large black pill, full width. */
body.fsc-etsy-product .fsc-submit,
body.fsc-etsy-product .single_add_to_cart_button.button.alt {
	background: #222 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	width: 100%;
	min-height: 54px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

body.fsc-etsy-product .fsc-submit:disabled {
	background: #a8a8a8 !important;
	cursor: not-allowed;
}

/* --- Icon info lines (delivery / returns / shipping / ships from) ---- */
.fsc-etsy-info {
	margin: 24px 0 4px;
	border-top: 1px solid #e2e2e2;
	padding-top: 18px;
}

.fsc-etsy-info-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 12px;
	font-size: 15px;
	color: #222;
}

.fsc-etsy-info-row svg {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	stroke: #222;
	fill: none;
	stroke-width: 1.7;
	margin-top: 1px;
}

.fsc-etsy-info-row .fsc-etsy-info-main { font-weight: 600; }
.fsc-etsy-info-row .fsc-etsy-info-sub { display: block; font-weight: 400; color: #595959; font-size: 14px; }

/* --- Details as stacked collapsible sections (JS accordion) ---------- */
body.fsc-etsy-product .summary .woocommerce-tabs {
	margin-top: 28px;
}

body.fsc-etsy-product .summary .woocommerce-tabs ul.tabs {
	display: none !important;
}

body.fsc-etsy-product .summary .woocommerce-Tabs-panel {
	display: none;
	border-top: 1px solid #ddd;
	padding: 14px 0 18px;
	margin: 0;
}

body.fsc-etsy-product .summary .woocommerce-Tabs-panel.fsc-open {
	display: block;
}

body.fsc-etsy-product .summary .woocommerce-Tabs-panel > h2 {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 10px;
	cursor: pointer;
}

/* --- Mobile: stack; thumbnails become a row under the main photo ----- */
@media (max-width: 768px) {
	body.fsc-etsy-product div.product { flex-direction: column; }
	body.fsc-etsy-product .woocommerce-product-gallery { flex-direction: column; }
	body.fsc-etsy-product .woocommerce-product-gallery .flex-control-thumbs {
		order: 2;
		flex-direction: row;
		width: auto;
		flex: none;
		overflow-x: auto;
	}
	.fsc-gallery-arrow.prev { left: 12px; }
}
