/* =============================================================
   Woo 3D Frame Builder — Default Front-end CSS (Universal)
   Theme-agnostic. Works with Astra, Storefront, Hello Elementor,
   GeneratePress, Kadence, and any standard WooCommerce theme.
   CSS variables at the top let any theme override the palette.
   ============================================================= */

:root {
	--w3dfb-accent:        #28606f;
	--w3dfb-accent-strong: #074480;
	--w3dfb-cta:           #38a5c7;
	--w3dfb-text:          #1a1a1a;
	--w3dfb-muted:         #666666;
	--w3dfb-line:          #e5e5e5;
	--w3dfb-card-bg:       #ffffff;
	--w3dfb-page-bg:       #f8f8f8;
	--w3dfb-radius:        4px;
	--w3dfb-radius-lg:     10px;
}

/* ---------- Single product layout reset ---------- */
/*
 * Layout overrides for the legacy default-template mode have been
 * moved into class-w3dfb-assets.php → inject_default_template_css(),
 * which only fires when the "Auto-render on default WC product page"
 * toggle is ON. This keeps the native WC gallery + summary intact
 * by default; only opted-in sites hide them.
 */

/* Our wrapper that holds 3D block (left) + summary (right) in one row. */
.w3dfb-product-flex {
	display: flex;
	gap: 30px;
	align-items: center;
	margin: 0 0 30px 0;
	flex-wrap: wrap;
}
.w3dfb-product-flex > .product-modal-wrap {
	flex: 1 1 50%;
	max-width: 50%;
	margin-bottom: 0;
}
.w3dfb-product-flex > .summary {
	flex: 1 1 45%;
	max-width: 45%;
}
@media (max-width: 900px) {
	.w3dfb-product-flex > .product-modal-wrap,
	.w3dfb-product-flex > .summary {
		flex: 1 1 100%;
		max-width: 100%;
	}
}

.woocommerce div.product .product-modal-wrap {
	display: flex;
	flex-direction: row;
	gap: 10px;
	margin-bottom: 25px;
}

/* ---------- Banner ---------- */
.product-banner {
	position: relative;
	height: 500px;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-bottom: 30px;
}
.banner-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}
.banner-content {
	position: relative;
	z-index: 2;
	text-align: center;
}
.banner-content h1 {
	color: #fff;
	font-size: 38px;
	margin: 0;
	padding: 0;
	line-height: 1.2;
}

/* ---------- Wrapper around the summary ---------- */
.custom-parent-wrapper { width: 100%; }


/* ---------- Custom thumbnail gallery ---------- */
.custom-gallery-wrap {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 90px;
	flex-shrink: 0;
}
.gallery-item {
	width: 90px;
	height: 90px;
	border: 1px solid var(--w3dfb-line);
	border-radius: var(--w3dfb-radius);
	overflow: hidden;
	cursor: pointer;
	background: #fff;
	transition: border-color 0.15s;
	position: relative;
}
.gallery-item:hover { border-color: var(--w3dfb-text); }
.gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.gallery-item .gallery-3d {
	width: 100%;
	height: 100%;
	display: block;
	--poster-color: transparent;
}

/* ---------- Image viewer (when a gallery image thumb is clicked) ---------- */
#custom-image-viewer {
	width: 500px;
	height: 500px;
	display: none;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border: 1px solid var(--w3dfb-line);
	border-radius: var(--w3dfb-radius);
}

/* ---------- Main 3D preview frame + "VIEW IN 3D" button ---------- */
.custom-frame-preview-wrapper {
	position: relative;
	width: 100%;
	display: block;
	border: 1px solid var(--w3dfb-line);
	overflow: hidden;
	background: #fff;
	border-radius: var(--w3dfb-radius);
}
.custom-frame-preview-wrapper.is-active { display: block; }
.view-3d-overlay-btn {
	position: absolute;
	bottom: 15px;
	right: 15px;
	z-index: 20;
	background: #000;
	color: #fff;
	padding: 10px 18px;
	border-radius: var(--w3dfb-radius);
	cursor: pointer;
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 1px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: background 0.2s;
}
.view-3d-overlay-btn:hover { background: #222; }

/* ---------- Fullscreen 3D modal ---------- */
#main-3d-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.95);
	z-index: 1000000;
	display: none;
	align-items: center;
	justify-content: center;
}
#main-3d-modal.open { display: flex; }
.close-3d {
	position: absolute;
	top: 20px;
	right: 30px;
	color: #fff;
	font-size: 40px;
	line-height: 1;
	cursor: pointer;
	z-index: 1;
}
.modal-3d-inner {
	width: 90%;
	height: 85%;
	background: #fff;
	position: relative;
	border-radius: var(--w3dfb-radius);
	overflow: hidden;
}

/* ---------- Material/frame selector buttons ---------- */
.model-buttons-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 15px 0;
	width: 100%;
}
.btn-3d-trigger {
    text-align: center;
    border-width: 1px;
    padding: 8px;
    border-color: #b3b3b3;
    border-style: solid;
    display: inline-block;
    margin: 4px 4px 4px 4px;
    border-radius: 2px;
    min-width: 65px;
    color: #000;
    height: 42px;
}
.btn-3d-trigger:hover {
    background: transparent;
    color: #9b3257;
}
.btn-3d-trigger.is-active {
    background: transparent;
    color: #000;
}
.btn-3d-trigger img.btn-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ---------- Hide default Woo gallery when our 3D is active ---------- */
.hide-original-gallery,
.woocommerce-product-gallery.hide-original-gallery {
    display: none !important;
}

/* ---------- Variations table tweaks ---------- */
.woocommerce div.product form.cart .variations {
    background: #f4f4f4;
    padding: 15px;
    border: 1px solid var(--w3dfb-line);
    border-radius: var(--w3dfb-radius);
    width: 100%;
}

/* ---------- Add-to-cart button ---------- */
.woocommerce div.product form.cart .button.single_add_to_cart_button,
button.single_add_to_cart_button.button.alt.disabled.wc-variation-selection-needed {
    background: var(--w3dfb-cta);
    padding: 12px 20px;
    border-radius: var(--w3dfb-radius-lg);
    color: #fff;
}
.woocommerce div.product form.cart .button.single_add_to_cart_button:hover {
    background: var(--w3dfb-accent-strong);
}
.woocommerce .quantity input.qty {
    border-radius: var(--w3dfb-radius-lg);
}

/* Native WooCommerce sections — rating, meta, related products,
   reviews tab `p.stars` — kept VISIBLE by default. Earlier versions
   hid them via `display: none !important`. Now controlled per-product
   via the "3D Display Settings" meta box, or via Elementor controls
   in the widget. Theme / Elementor styles can override freely. */

/* ---------- Section heading (used by tags, liked, related, etc.) ---------- */
.w3dfb-section-title,
.acf-title,
.premium-title,
.liked-title,
.reviews-title,
.accordion-header,
.custom-tax strong {
	font-weight: 600;
	color: var(--w3dfb-accent);
	font-size: 18px;
	display: block;
	letter-spacing: 1px;
	padding: 20px 0 10px 0;
	margin: 0 0 20px 0;
	border-bottom: 1px solid var(--w3dfb-accent);
	text-transform: uppercase;
}

/* ---------- Additional products grid ---------- */
.acf-additional-products { margin: 40px 0; }
.acf-products-grid {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 22px;
}
.acf-product-card a {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: var(--w3dfb-text);
}
.acf-frame {
	position: relative;
	height: 140px;
	border: 1px solid var(--w3dfb-line);
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border-radius: var(--w3dfb-radius);
}
.acf-frame:hover { border-color: var(--w3dfb-text); }
.acf-thumb { width: 100%; height: 100%; object-fit: contain; }
.acf-3d { position: absolute; inset: 0; width: 100%; height: 100%; }
.acf-product-title {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	text-align: center;
	margin-top: 8px;
}

/* ---------- Custom taxonomies (Wood Print / Wall Art tags) ---------- */
.custom-taxonomies-wrapper {
	clear: both;
	display: block;
	width: 100%;
	margin: 30px 0;
}
.custom-tax { margin-bottom: 16px; }
.custom-tax a { text-decoration: none; }
.custom-tax span {
	display: inline-block;
	background: #f1f1f1;
	color: #444;
	padding: 6px 12px;
	margin: 4px 6px 4px 0;
	border-radius: 6px;
	font-size: 13px;
	border: 1px solid var(--w3dfb-line);
	transition: all 0.2s ease;
}
.custom-tax a:hover span { background: #e2e2e2; color: var(--w3dfb-text); }

/* ---------- Comment/review form ---------- */
.custom-review-form { margin-top: 30px; }
.accordion-header { cursor: pointer; }
.accordion-content {
	display: none;
	padding: 15px 0;
}
.accordion-content.active { display: block; }
.review-form textarea,
.review-form input[type="file"] {
	width: 100%;
	margin-bottom: 10px;
	padding: 8px;
	border: 1px solid var(--w3dfb-line);
	border-radius: var(--w3dfb-radius);
}
.review-form button {
	background: #000;
	color: #fff;
	padding: 10px 20px;
	border: 0;
	cursor: pointer;
	border-radius: var(--w3dfb-radius);
}
.review-form button:hover { background: #222; }
.stars a {
	font-size: 22px;
	color: #ccc;
	text-decoration: none;
}
.stars a.active, .stars a:hover { color: #f5a623; }
.review-image img {
	margin-top: 10px;
	width: 80px;
	border-radius: var(--w3dfb-radius);
}

/* ---------- Reviews list ---------- */
.custom-reviews-section { margin-top: 40px; }
.reviews-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px 40px;
}
.review-card {
	border-bottom: 1px solid var(--w3dfb-line);
	padding-bottom: 20px;
}
.review-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}
.review-left { max-width: 80%; }
.review-header strong { display: block; font-size: 13px; font-weight: 600; }
.review-date { font-size: 11px; color: #888; display: block; margin-top: 2px; }
.review-body {
	display: flex;
	gap: 12px;
	margin-top: 8px;
	align-items: flex-start;
}
.review-thumb { width: 60px; height: auto; border-radius: var(--w3dfb-radius); object-fit: cover; }
.review-text { font-size: 13px; color: #333; line-height: 1.5; }
.review-stars { color: #f5a623; font-size: 14px; white-space: nowrap; margin-top: 2px; }
.review-body.d-flex.gap-2 img { width: 120px; height: 120px; }
.reviews-btn-wrap { text-align: center; margin-top: 20px; }
.reviews-btn {
	border: 1px solid #ccc;
	padding: 10px 20px;
	background: transparent;
	cursor: pointer;
	color: var(--w3dfb-text);
	transition: all 0.2s ease;
	border-radius: var(--w3dfb-radius);
}
.reviews-btn:hover { background: var(--w3dfb-text); color: #fff; }

/* ---------- Premium related products ---------- */
.premium-related-wrap { margin: 40px 0; }
.premium-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 25px;
}
.premium-card {
	position: relative;
	border-radius: var(--w3dfb-radius);
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	height: 100%;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
	padding: 10px;
}
.premium-card a {
	text-decoration: none;
	color: inherit;
	display: block;
}
.premium-img {
	position: relative;
	width: 100%;
	height: 220px;
	overflow: hidden;
}
.premium-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s;
}
.premium-card:hover img { transform: scale(1.05); }
.premium-content {
	padding: 15px;
	flex-grow: 1;
}
.premium-content h3 {
	text-align: center;
	font-weight: 600;
	color: var(--w3dfb-accent);
	font-size: 16px;
	font-style: italic;
	margin: 0 0 10px;
}
.premium-card .price, .premium-bottom {
	text-align: center;
	font-weight: 400;
	color: var(--w3dfb-accent);
	font-size: 16px;
	font-style: italic;
}
.premium-btn-wrap {
	padding: 15px;
	margin-top: auto;
}
.premium-btn-wrap a.button {
	display: block;
	text-align: center;
	background: var(--w3dfb-cta);
	color: #fff;
	border-radius: var(--w3dfb-radius-lg);
	padding: 12px;
	font-size: 14px;
	width: 100%;
	text-decoration: none;
}
.premium-btn-wrap a.button:hover { background: var(--w3dfb-accent-strong); }
.button.disabled {
	display: block;
	text-align: center;
	background: rgba(17, 17, 17, 0.78);
	color: #fff;
	border-radius: var(--w3dfb-radius-lg);
	padding: 12px;
	font-size: 14px;
	width: 100%;
	cursor: not-allowed;
}

/* ---------- Product title ---------- */
.woocommerce div.product .product_title {
	font-family: 'Hind', sans-serif;
	font-size: 24px;
	font-weight: 200;
}
.single-product-category { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
	#custom-image-viewer { width: 100%; }
}
@media (max-width: 1024px) {
	.premium-grid { grid-template-columns: repeat(3, 1fr); }
	.acf-products-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 768px) {
	.premium-grid { grid-template-columns: repeat(2, 1fr); }
	.acf-products-grid { grid-template-columns: repeat(4, 1fr); }
	.reviews-grid { grid-template-columns: 1fr; }
	.review-row { flex-direction: column; gap: 5px; }
	.review-left { max-width: 100%; }
	.review-stars { margin-top: 5px; }
	.product-banner { height: 320px; }
	.banner-content h1 { font-size: 28px; }
}
@media (max-width: 600px) {
	.woocommerce div.product .product-modal-wrap {
		flex-direction: column-reverse;
	}
	.custom-gallery-wrap {
		flex-direction: row;
		flex-wrap: wrap;
		width: 100%;
	}
	.gallery-item { width: 80px; height: 80px; }
}
@media (max-width: 480px) {
	.premium-grid { grid-template-columns: 1fr; }
	.acf-products-grid { grid-template-columns: repeat(2, 1fr); }
	.banner-content h1 { font-size: 24px; }
	.product-banner { height: 240px; }
	.model-buttons-wrapper button { width: 46%; }
}

/* ---------- Custom variations (Shape + Size + Price) ---------- */
.w3dfb-custom-variations {
	background: #f4f4f4;
	border: 1px solid var(--w3dfb-line);
	border-radius: var(--w3dfb-radius);
	padding: 15px;
	margin: 15px 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.w3dfb-cv-row {
	display: flex;
	align-items: center;
	gap: 12px;
}
.w3dfb-cv-row label {
	min-width: 70px;
	font-weight: 600;
	font-size: 14px;
	color: var(--w3dfb-text);
}
.w3dfb-cv-select {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid var(--w3dfb-line);
	border-radius: var(--w3dfb-radius);
	background: #fff;
	font-size: 14px;
}
.w3dfb-cv-select:disabled { opacity: 0.5; cursor: not-allowed; }
.w3dfb-cv-price {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--w3dfb-line);
	margin-top: 4px;
}
.w3dfb-cv-price-label {
	font-size: 13px;
	color: var(--w3dfb-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.w3dfb-cv-price-value {
	font-size: 22px;
	font-weight: 700;
	color: var(--w3dfb-accent);
}
.woocommerce div.product form.cart .button.single_add_to_cart_button.disabled,
.woocommerce div.product form.cart .button.single_add_to_cart_button[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}