/**
 * Nomas Product Page Builder — Frontend styles.
 * Vanilla CSS, no dependencies. Mobile-first.
 */

/* ---------- Base ---------- */
.nomas-ppb {
	max-width: 100%;
	box-sizing: border-box;
}

.nomas-ppb *,
.nomas-ppb *::before,
.nomas-ppb *::after {
	box-sizing: border-box;
}

.nomas-ppb img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ---------- Gallery ---------- */
/*
 * Gallery UI redesign (1.0.2) — minimal + premium.
 * Scoped strictly to .nomas-gallery. All rules below only affect the Nomas
 * product gallery; the rest of the stylesheet and the site are untouched.
 */
.nomas-gallery {
	position: relative;
	width: 100%;
	--nomas-gallery-icon-color: #222;
	--nomas-gallery-icon-size: 20px;
	--nomas-gallery-arrow-hit: 40px;
	--nomas-gallery-zoom-hit: 38px;
	--nomas-gallery-edge: 12px;
}

.nomas-gallery-viewport {
	position: relative;
	overflow: hidden;
	background: #fff;
	border-radius: var(--nomas-gallery-radius, 12px);
}

.nomas-gallery-track {
	display: flex;
	width: 100%;
	transition: transform 0.35s ease;
}

.nomas-gallery-slide {
	flex: 0 0 100%;
	width: 100%;
	display: none;
	justify-content: center;
	align-items: center;
}

.nomas-gallery-slide.is-active {
	display: flex;
}

/* Product image stays perfectly centered inside the viewport. */
.nomas-gallery-slide img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	margin: 0 auto;
	object-fit: contain;
}

/*
 * Minimal floating icon controls (previous / next / fullscreen).
 * Transparent background, no border, no shadow, no circle fill, no emoji.
 * The clickable area stays 34-40px for usability while the VISIBLE icon
 * stays small (16-20px, see .nomas-gallery-icon).
 */
.nomas-gallery-arrow,
.nomas-gallery-zoom {
	position: absolute;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	background: transparent;
	background-image: none;
	border: none;
	border-radius: 50%;
	box-shadow: none;
	outline: none;
	color: var(--nomas-gallery-icon-color, #222);
	line-height: 0;
	text-shadow: none;
	cursor: pointer;
	transition: all 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

/* Arrows: absolutely positioned so they never affect image centering. */
.nomas-gallery-arrow {
	top: 50%;
	transform: translateY(-50%);
	width: var(--nomas-gallery-arrow-hit, 40px);
	height: var(--nomas-gallery-arrow-hit, 40px);
}

.nomas-gallery-prev {
	left: var(--nomas-gallery-edge, 12px);
}

.nomas-gallery-next {
	right: var(--nomas-gallery-edge, 12px);
}

/* Fullscreen: bottom-right corner of the main gallery viewport. */
.nomas-gallery-zoom {
	right: var(--nomas-gallery-edge, 12px);
	bottom: var(--nomas-gallery-edge, 12px);
	width: var(--nomas-gallery-zoom-hit, 38px);
	height: var(--nomas-gallery-zoom-hit, 38px);
}

/* Inline SVG icons — visible size is driven by --nomas-gallery-icon-size. */
.nomas-gallery-icon {
	display: block;
	width: var(--nomas-gallery-icon-size, 20px);
	height: var(--nomas-gallery-icon-size, 20px);
	pointer-events: none;
}

/* Extremely subtle hover / focus feedback. */
.nomas-gallery-arrow:hover,
.nomas-gallery-arrow:focus-visible,
.nomas-gallery-zoom:hover,
.nomas-gallery-zoom:focus-visible {
	color: #000;
	background-color: rgba(0, 0, 0, 0.04);
}

.nomas-gallery-arrow:hover,
.nomas-gallery-arrow:focus-visible {
	transform: translateY(-50%) scale(1.05);
}

.nomas-gallery-zoom:hover,
.nomas-gallery-zoom:focus-visible {
	transform: scale(1.05);
}

/* Thumbnail row stays horizontally centered (behaviour unchanged). */
.nomas-gallery-thumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}

.nomas-gallery-thumb {
	width: var(--nomas-thumb-size, 80px);
	height: var(--nomas-thumb-size, 80px);
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	background: #f5f5f5;
	transition: border-color 0.2s ease, opacity 0.2s ease;
	opacity: 0.7;
}

.nomas-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nomas-gallery-thumb.is-active {
	border-color: var(--nomas-accent, #7f54b3);
	opacity: 1;
}

/* Gallery controls — responsive sizing (desktop / tablet / mobile). */
@media (max-width: 1024px) {
	.nomas-gallery {
		--nomas-gallery-icon-size: 18px;
	}
}

@media (max-width: 768px) {
	.nomas-gallery {
		--nomas-gallery-icon-size: 17px;
		--nomas-gallery-arrow-hit: 38px;
		--nomas-gallery-zoom-hit: 36px;
		--nomas-gallery-edge: 10px;
	}
}

@media (max-width: 480px) {
	.nomas-gallery {
		--nomas-gallery-icon-size: 16px;
		--nomas-gallery-arrow-hit: 36px;
		--nomas-gallery-zoom-hit: 34px;
		--nomas-gallery-edge: 6px;
	}

	.nomas-gallery-zoom {
		right: 8px;
		bottom: 8px;
	}
}

/* Zoom overlay */
.nomas-gallery-zoom-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: zoom-out;
}

.nomas-gallery-zoom-overlay img {
	max-width: 92vw;
	max-height: 92vh;
	object-fit: contain;
}

/* ---------- Title ---------- */
.nomas-title-wrap {
	margin: 0 0 12px;
}

.nomas-product-title {
	margin: 0;
	line-height: 1.2;
	word-break: break-word;
}

/* ---------- Price ---------- */
.nomas-price-wrap {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 14px;
}

.nomas-price {
	font-weight: 700;
}

.nomas-price del {
	color: var(--nomas-price-regular, #777);
	font-weight: 400;
	font-size: 0.75em;
}

.nomas-price ins {
	text-decoration: none;
}

.nomas-price-discount {
	background: #b12704;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 4px;
}

/* ---------- Rating ---------- */
.nomas-rating-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
}

.nomas-rating-stars {
	display: inline-flex;
	font-size: 18px;
	line-height: 1;
	color: #d5d5d5;
}

.nomas-star.is-full,
.nomas-star.is-half {
	color: #f5a623;
}

.nomas-rating-count {
	font-size: 13px;
	color: #666;
}

/* ---------- Add to cart ---------- */
.nomas-atc-wrap {
	margin-top: var(--nomas-atc-mt, 16px);
}

.nomas-atc-wrap .single_add_to_cart_button,
.nomas-atc-wrap .button {
	background: var(--nomas-atc-bg, #7f54b3);
	color: #fff;
	border-radius: var(--nomas-atc-radius, 6px);
	font-size: var(--nomas-atc-fs, 16px);
	padding: 12px 24px;
	border: none;
	cursor: pointer;
	transition: background 0.2s ease;
	display: inline-block;
}

.nomas-atc-wrap .single_add_to_cart_button:hover,
.nomas-atc-wrap .button:hover {
	background: var(--nomas-atc-hover, #6d3fa8);
	color: #fff;
}

.nomas-atc-wrap .quantity {
	margin-right: 8px;
}

.nomas-atc-wrap .quantity input {
	width: 60px;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: var(--nomas-atc-radius, 6px);
}

/* ---------- Trust block ---------- */
.nomas-trust-wrap {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin: 16px 0;
}

.nomas-trust-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	background: #f7f7f7;
	border-radius: 8px;
	font-size: 13px;
}

.nomas-trust-icon {
	font-size: 20px;
	line-height: 1;
}

/* ---------- Tabs / accordion ---------- */
.nomas-tabs {
	margin: 24px 0;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	overflow: hidden;
}

.nomas-tab + .nomas-tab {
	border-top: 1px solid #e2e2e2;
}

.nomas-tab-header {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	background: #fff;
	border: none;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	text-align: left;
}

.nomas-tab-header:hover {
	background: #fafafa;
}

.nomas-tab-toggle {
	width: 10px;
	height: 10px;
	border-right: 2px solid #666;
	border-bottom: 2px solid #666;
	transform: rotate(45deg);
	transition: transform 0.25s ease;
	flex-shrink: 0;
}

.nomas-tab-header[aria-expanded="true"] .nomas-tab-toggle {
	transform: rotate(225deg);
}

.nomas-tab-panel {
	overflow: hidden;
}

.nomas-tab-panel[hidden] {
	display: none;
}

.nomas-tab-content {
	padding: 18px;
	animation: nomas-fade-in 0.25s ease;
}

@keyframes nomas-fade-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Specifications table */
.nomas-specs-table {
	width: 100%;
	border-collapse: collapse;
}

.nomas-specs-table th,
.nomas-specs-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	text-align: left;
	vertical-align: top;
}

.nomas-specs-table th {
	width: 40%;
	font-weight: 600;
	color: #333;
}

/* Reviews */
.nomas-reviews .commentlist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nomas-no-reviews {
	color: #666;
}

/* ---------- Conversion components ---------- */
.nomas-components {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0;
}

.nomas-block {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background: #fff;
}

.nomas-block-icon {
	font-size: 22px;
	line-height: 1;
}

.nomas-block-body {
	display: flex;
	flex-direction: column;
}

.nomas-block-title {
	font-weight: 600;
	color: #1a1a1a;
}

.nomas-block-text {
	font-size: 13px;
	color: #666;
}

.nomas-block-stock.is-in .nomas-block-title { color: #0f834d; }
.nomas-block-stock.is-low .nomas-block-title { color: #e67e22; }
.nomas-block-stock.is-out .nomas-block-title { color: #b12704; }

/* Badges */
.nomas-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
}

.nomas-badge {
	display: inline-block;
	background: var(--nomas-badge-color, #7f54b3);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	padding: 4px 10px;
	border-radius: 4px;
}

/* ---------- Related products ---------- */
.nomas-related-wrap {
	margin: 32px 0;
}

.nomas-related-title {
	margin: 0 0 16px;
	font-size: 22px;
}

.nomas-related-grid {
	display: grid;
	grid-template-columns: repeat(var(--nomas-cols-d, 4), 1fr);
	gap: 16px;
}

.nomas-related-card {
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 12px;
	text-align: center;
	transition: box-shadow 0.2s ease;
}

.nomas-related-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.nomas-related-thumb {
	display: block;
	margin-bottom: 10px;
}

.nomas-related-thumb img {
	width: 100%;
	height: auto;
}

.nomas-related-name {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	text-decoration: none;
	margin-bottom: 6px;
}

.nomas-related-name:hover {
	color: #7f54b3;
}

.nomas-related-price {
	font-weight: 700;
	color: #b12704;
}

/* ---------- Elementor template shell ---------- */
.nomas-ppb-main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 16px;
}

.nomas-ppb-template {
	width: 100%;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.nomas-related-grid {
		grid-template-columns: repeat(var(--nomas-cols-t, 2), 1fr);
	}

	.nomas-ppb,
	.nomas-gallery,
	.nomas-gallery-viewport,
	.nomas-gallery-track {
		overflow-x: hidden;
	}
}

@media (max-width: 414px) {
	.nomas-related-grid {
		grid-template-columns: repeat(var(--nomas-cols-m, 1), 1fr);
	}

	.nomas-trust-wrap {
		grid-template-columns: 1fr 1fr;
	}

	.nomas-gallery-thumb {
		width: 60px;
		height: 60px;
	}
}

@media (max-width: 375px) {
	.nomas-trust-wrap {
		grid-template-columns: 1fr;
	}
}
