/* CWD Single Product Widgets */

/* ─── Gallery ──────────────────────────────────── */
.cwd-product-gallery {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

/* Thumbs LEFT */
.cwd-product-gallery.cwd-thumbs-left {
	flex-direction: row;
}
.cwd-product-gallery.cwd-thumbs-left .cwd-gallery-thumbs {
	order: 0;
	flex-direction: column;
	flex-shrink: 0;
}
.cwd-product-gallery.cwd-thumbs-left .cwd-gallery-main {
	order: 1;
	flex: 1;
}

/* Thumbs RIGHT */
.cwd-product-gallery.cwd-thumbs-right {
	flex-direction: row;
}
.cwd-product-gallery.cwd-thumbs-right .cwd-gallery-main {
	order: 0;
	flex: 1;
}
.cwd-product-gallery.cwd-thumbs-right .cwd-gallery-thumbs {
	order: 1;
	flex-direction: column;
	flex-shrink: 0;
}

/* Thumbs BOTTOM */
.cwd-product-gallery.cwd-thumbs-bottom {
	flex-direction: column;
}
.cwd-product-gallery.cwd-thumbs-bottom .cwd-gallery-main {
	order: 0;
	width: 100%;
}
.cwd-product-gallery.cwd-thumbs-bottom .cwd-gallery-thumbs {
	order: 1;
	flex-direction: row;
	flex-wrap: wrap;
}

/* Gallery Main */
.cwd-gallery-main {
	position: relative;
	line-height: 0;
	overflow: hidden;
}

.cwd-gallery-main .cwd-main-image {
	width: 100%;
	height: auto;
	display: block;
}

.cwd-gallery-main .cwd-main-lightbox {
	display: block;
	line-height: 0;
}

/* Video embed */
.cwd-gallery-video {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
}
.cwd-gallery-video iframe,
.cwd-gallery-video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Navigation arrows — overlay approach */
.cwd-gallery-arrows-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 10px;
	pointer-events: none;
	z-index: 5;
}

.cwd-gallery-prev,
.cwd-gallery-next {
	position: static;
	transform: none;
	pointer-events: all;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s ease;
}
.cwd-gallery-prev:hover,
.cwd-gallery-next:hover {
	background: rgba(0, 0, 0, 0.7);
}

/* Thumbnails */
.cwd-gallery-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cwd-thumb-item {
	cursor: pointer;
	position: relative;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	flex-shrink: 0;
	transition: border-color 0.2s ease;
}

.cwd-thumb-item img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	display: block;
}

.cwd-thumb-item.is-active {
	border-color: #333;
}

.cwd-play-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	font-size: 22px;
	pointer-events: none;
}

/* ─── Add to Cart ──────────────────────────────── */
.cwd-add-to-cart-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.cwd-atc-btn {
	padding: 12px 24px;
	background: #333;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	transition: background-color 0.3s ease;
}

.cwd-atc-btn:hover {
	background: #555;
}

/* ─── Product Tabs ─────────────────────────────── */
.cwd-product-tabs {
	margin-top: 24px;
}

/* Horizontal */
.cwd-product-tabs.cwd-tabs-horizontal .cwd-tab-nav {
	display: flex;
	border-bottom: 2px solid #e5e5e5;
	flex-wrap: wrap;
}

/* Vertical */
.cwd-product-tabs.cwd-tabs-vertical {
	display: flex;
}
.cwd-product-tabs.cwd-tabs-vertical .cwd-tab-nav {
	display: flex;
	flex-direction: column;
	min-width: 160px;
	border-right: 2px solid #e5e5e5;
	border-bottom: none;
}
.cwd-product-tabs.cwd-tabs-vertical .cwd-tab-panels {
	flex: 1;
}

/* Tab title button */
.cwd-tab-title {
	padding: 12px 20px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	color: #555;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: color 0.2s ease, background-color 0.2s ease;
	white-space: nowrap;
}
.cwd-tabs-vertical .cwd-tab-title {
	border-bottom: none;
	border-right: 2px solid transparent;
	margin-bottom: 0;
	margin-right: -2px;
	text-align: left;
}

.cwd-tab-title.is-active {
	color: #333;
	border-bottom-color: #333;
	font-weight: 600;
}
.cwd-tabs-vertical .cwd-tab-title.is-active {
	border-bottom-color: transparent;
	border-right-color: #333;
}

/* Tab panels */
.cwd-tab-panel {
	display: none;
	padding: 20px;
}
.cwd-tab-panel.is-active {
	display: block;
}

/* Accordion */
.cwd-accordion-item {
	border-bottom: 1px solid #e5e5e5;
}
.cwd-accordion-trigger {
	width: 100%;
	text-align: left;
	padding: 14px 16px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: color 0.2s ease;
}
.cwd-accordion-trigger::after { content: '+'; font-size: 20px; line-height: 1; }
.cwd-accordion-trigger.is-active::after { content: '−'; }

.cwd-accordion-panel {
	display: none;
	padding: 12px 16px 20px;
}
.cwd-accordion-panel.is-active { display: block; }

/* ─── Price ────────────────────────────────────── */
.cwd-product-price .price del { color: #aaa; margin-right: 6px; }
.cwd-product-price .price ins { text-decoration: none; color: #e44; }

/* ─── Related Products ─────────────────────────── */
.cwd-related-heading {
	font-size: 20px;
	margin-bottom: 20px;
}
.cwd-related-grid {
	display: grid;
	grid-template-columns: repeat(var(--cwd-cols, 4), 1fr);
	gap: 20px;
}

/* ─── Editor Notice ────────────────────────────── */
.cwd-editor-notice {
	background: #fff3cd;
	border: 1px solid #ffc107;
	padding: 10px 14px;
	border-radius: 4px;
	font-size: 13px;
	color: #856404;
}

/* ─── Modal (shared) ───────────────────────────── */
.cwd-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
}
.cwd-modal.is-open {
	display: flex;
}
.cwd-modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
}
.cwd-modal__container {
	background: #fff;
	border-radius: 6px;
	max-width: 640px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	padding: 32px;
}
.cwd-modal__close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: none;
	border: none;
	font-size: 20px;
	cursor: pointer;
	color: #555;
	line-height: 1;
}
.cwd-modal__close:hover { color: #000; }

/* ─── Quick View ───────────────────────────────── */
.cwd-quick-view-inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}
.cwd-qv-title    { margin: 0 0 12px; font-size: 20px; }
.cwd-qv-price    { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.cwd-qv-excerpt  { font-size: 14px; color: #555; margin-bottom: 16px; }
.cwd-qv-view-full {
	display: inline-block;
	padding: 10px 20px;
	background: #333;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
}

/* ─── Breadcrumb ────────────────────────────────── */
.cwd-breadcrumb {
	font-size: 14px;
	color: #888;
}
.cwd-breadcrumb-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
}
.cwd-breadcrumb-item {
	display: inline-flex;
	align-items: center;
}
.cwd-breadcrumb-item a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}
.cwd-breadcrumb-item a:hover { color: #333; }
.cwd-breadcrumb-sep {
	margin: 0 6px;
	color: #ccc;
}
.cwd-breadcrumb-current span {
	color: #333;
}

/* ─── Product Meta ──────────────────────────────── */
.cwd-product-meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 14px;
	color: #555;
}
.cwd-meta-item {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
}
.cwd-meta-label {
	font-weight: 600;
	color: #333;
	flex-shrink: 0;
}
.cwd-meta-value a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}
.cwd-meta-value a:hover { text-decoration: underline; }

/* ─── Product Badge (single) ──────────────────── */
.cwd-badge-single {
	display: inline-flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

/* Shared badge tokens (also used in archive) */
.cwd-badge {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.cwd-badge-sale { background: #e53935; color: #fff; }
.cwd-badge-new  { background: #43a047; color: #fff; }

/* ─── Quantity Selector ────────────────────────── */
.cwd-quantity-wrap .quantity {
	display: inline-flex;
	align-items: stretch;
}

/* WooCommerce JS-injected +/- buttons */
.cwd-quantity-wrap .quantity .minus,
.cwd-quantity-wrap .quantity .plus {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	background: #f5f5f5;
	border: 1px solid #ddd;
	cursor: pointer;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	padding: 0;
	color: #333;
	transition: background 0.2s ease, color 0.2s ease;
	flex-shrink: 0;
}
.cwd-quantity-wrap .quantity .minus { border-radius: 4px 0 0 4px; border-right: none; }
.cwd-quantity-wrap .quantity .plus  { border-radius: 0 4px 4px 0; border-left: none; }
.cwd-quantity-wrap .quantity .minus:hover,
.cwd-quantity-wrap .quantity .plus:hover {
	background: #e0e0e0;
	color: #000;
}

.cwd-quantity-wrap .quantity input.qty {
	text-align: center;
	width: 56px;
	height: 36px;
	border: 1px solid #ddd;
	border-radius: 0;
	padding: 0 4px;
	font-size: 15px;
	-moz-appearance: textfield;
	appearance: textfield;
}
/* Hide native spinners when +/- buttons are present */
.cwd-quantity-wrap .quantity input.qty::-webkit-inner-spin-button,
.cwd-quantity-wrap .quantity input.qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

@media (max-width: 768px) {
	.cwd-quick-view-inner { grid-template-columns: 1fr; }
	.cwd-product-gallery.cwd-thumbs-left,
	.cwd-product-gallery.cwd-thumbs-right { flex-direction: column; }
}
