/**
 * WooVar Swatch + Gallery + Listing Styles
 * Version: 3.0.0
 */

/* ========================================
   1. SWATCH STYLES
   ======================================== */

.variations_form select {
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	position: absolute !important;
	z-index: -100;
	left: 0;
	pointer-events: none;
}

.variations .w-select-arrow,
.variations td.value::after,
.variations div::after {
	display: none !important;
	content: none !important;
}

.variations td { background: none !important; }
.variations tbody, .variations tr, .variations td {
	display: block !important;
	width: 100% !important;
	border: none !important;
	padding: 0 !important;
}

.variations th.label {
	display: block !important;
	margin-bottom: 8px !important;
	padding: 0 !important;
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	color: #222;
	text-align: left !important;
}

.variations td.value { margin-bottom: 20px !important; }

.woovar-swatch-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.woovar-swatch-item {
	padding: 10px 18px;
	border: 2px solid #e0e0e0;
	cursor: pointer;
	background: #fff;
	color: #333;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
	user-select: none;
	text-align: center;
	min-width: 44px;
}

.woovar-swatch-item:hover { border-color: #999; }
.woovar-swatch-item.woovar-selected {
	border-color: #000;
	background: #000;
	color: #fff;
	font-weight: 600;
}

.woovar-swatch-item.woovar-disabled {
	opacity: 0.4;
	pointer-events: none;
	text-decoration: line-through;
	background: #f8f8f8;
	border-color: #eee;
}

.woovar-swatch-item.woovar-image-swatch {
	width: 54px;
	height: 72px;
	padding: 0;
	border-radius: 8px;
	background-size: cover;
	background-position: center top;
	border: 2px solid #e0e0e0;
	position: relative;
	overflow: hidden;
}

.woovar-swatch-item.woovar-image-swatch:hover {
	border-color: #666;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.woovar-swatch-item.woovar-image-swatch.woovar-selected {
	border-color: #000;
	box-shadow: 0 0 0 2px #000;
}

.woovar-swatch-item.woovar-image-swatch span { display: none; }

/* ========================================
   2. GALLERY STYLES
   ======================================== */

.woovar-gallery {
	width: 100%;
	max-width: 100%;
}

.woovar-gallery-main {
	position: relative;
	margin-bottom: 12px;
	border-radius: 12px;
	overflow: hidden;
	background: #f5f5f5;
}

.woovar-main-image {
	position: relative;
	cursor: zoom-in;
	aspect-ratio: 3 / 4;
	display: flex;
	align-items: center;
	justify-content: center;
}

.woovar-main-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.woovar-main-image:hover img { transform: scale(1.02); }

.woovar-zoom-icon {
	position: absolute;
	bottom: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	background: rgba(255,255,255,0.95);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.woovar-main-image:hover .woovar-zoom-icon { opacity: 1; }
.woovar-zoom-icon svg { width: 20px; height: 20px; color: #333; }

.woovar-gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

.woovar-gallery-thumbs[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.woovar-gallery-thumbs[data-columns="5"] { grid-template-columns: repeat(5, 1fr); }
.woovar-gallery-thumbs[data-columns="6"] { grid-template-columns: repeat(6, 1fr); }

.woovar-thumb {
	aspect-ratio: 3 / 4;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all 0.2s ease;
	background: #f5f5f5;
}

.woovar-thumb:hover { border-color: #ccc; }
.woovar-thumb.active { border-color: #000; }
.woovar-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ========================================
   3. LIGHTBOX STYLES
   ======================================== */

.woovar-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
}

.woovar-lightbox.active { display: flex; }

.woovar-lightbox-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.95);
	cursor: pointer;
}

.woovar-lightbox-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.woovar-lightbox-image { max-width: 100%; max-height: 85vh; }
.woovar-lightbox-image img {
	max-width: 100%;
	max-height: 85vh;
	object-fit: contain;
	display: block;
}

.woovar-lightbox-close {
	position: fixed;
	top: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	background: rgba(255,255,255,0.1);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 32px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.woovar-lightbox-close:hover { background: rgba(255,255,255,0.2); }

.woovar-lightbox-prev,
.woovar-lightbox-next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	background: rgba(255,255,255,0.1);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.woovar-lightbox-prev:hover,
.woovar-lightbox-next:hover { background: rgba(255,255,255,0.2); }
.woovar-lightbox-prev { left: 20px; }
.woovar-lightbox-next { right: 20px; }

.woovar-lightbox-counter {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 14px;
	padding: 8px 16px;
	background: rgba(0,0,0,0.5);
	border-radius: 20px;
}

body.woovar-lightbox-open { overflow: hidden; }

/* ========================================
   4. PRODUCT LISTING STYLES
   ======================================== */

.woovar-listing {
	width: 100%;
}

/* Toolbar */
.woovar-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid #eee;
}

.woovar-toolbar-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.woovar-toolbar-right {
	display: flex;
	align-items: center;
}

.woovar-filter-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.woovar-filter-toggle:hover,
.woovar-filter-toggle.active {
	border-color: #000;
	background: #000;
	color: #fff;
}

.woovar-filter-toggle svg {
	width: 18px;
	height: 18px;
}

.woovar-filter-count {
	background: #e53935;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 10px;
	min-width: 18px;
	text-align: center;
}

.woovar-clear-filters {
	font-size: 13px;
	color: #666;
	text-decoration: none;
}

.woovar-clear-filters:hover {
	color: #e53935;
	text-decoration: underline;
}

.woovar-sort-select {
	padding: 10px 36px 10px 16px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
	appearance: none;
	cursor: pointer;
	min-width: 180px;
	transition: all 0.2s ease;
}

.woovar-sort-select:hover {
	border-color: #999;
}

.woovar-sort-select:focus {
	outline: none;
	border-color: #000;
}

/* Filters Panel */
.woovar-filters-panel {
	background: #f9f9f9;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 24px;
}

.woovar-filters-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 24px;
	margin-bottom: 20px;
}

.woovar-filter-group {
	background: #fff;
	padding: 16px;
	border-radius: 8px;
}

.woovar-filter-title {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.woovar-filter-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 200px;
	overflow-y: auto;
}

/* Checkbox Styles */
.woovar-checkbox {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	padding: 6px 0;
	transition: all 0.15s ease;
}

.woovar-checkbox:hover {
	color: #000;
}

.woovar-checkbox input[type="checkbox"] {
	display: none;
}

.woovar-checkbox-box {
	width: 18px;
	height: 18px;
	border: 2px solid #ddd;
	border-radius: 4px;
	position: relative;
	transition: all 0.15s ease;
	flex-shrink: 0;
}

.woovar-checkbox input:checked + .woovar-checkbox-box {
	background: #000;
	border-color: #000;
}

.woovar-checkbox input:checked + .woovar-checkbox-box::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.woovar-checkbox-color {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid #ddd;
	flex-shrink: 0;
	transition: all 0.15s ease;
}

.woovar-checkbox input:checked + .woovar-checkbox-color {
	border-color: #000;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}

.woovar-checkbox-label {
	font-size: 14px;
	color: #444;
}

.woovar-checkbox input:checked ~ .woovar-checkbox-label {
	font-weight: 600;
	color: #000;
}

/* Filter Actions */
.woovar-filters-actions {
	display: flex;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}

.woovar-apply-filters {
	padding: 12px 28px;
	background: #000;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.woovar-apply-filters:hover {
	background: #333;
}

.woovar-reset-filters {
	padding: 12px 20px;
	background: transparent;
	color: #666;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.woovar-reset-filters:hover {
	border-color: #999;
	color: #333;
}

/* Products Grid */
.woovar-products-grid {
	display: grid;
	grid-template-columns: repeat(var(--columns, 5), 1fr);
	gap: 24px;
}

.woovar-no-products {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: #666;
	font-size: 16px;
}

/* Product Card */
.woovar-product-card {
	position: relative;
}

.woovar-product-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.woovar-product-image {
	position: relative;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-radius: 12px;
	background: #f5f5f5;
}

.woovar-product-image .woovar-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.woovar-product-image .woovar-img.active {
	opacity: 1;
}

/* Image Dots */
.woovar-image-dots {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.woovar-product-card:hover .woovar-image-dots {
	opacity: 1;
}

.woovar-image-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255,255,255,0.5);
	cursor: pointer;
	transition: all 0.2s ease;
}

.woovar-image-dot.active,
.woovar-image-dot:hover {
	background: #fff;
	transform: scale(1.2);
}

/* Product Info */
.woovar-product-info {
	padding: 12px 4px;
}

/* Color Indicator - Minimal (Görsel üzerinde) */
.woovar-color-indicator {
	position: absolute;
	bottom: 10px;
	left: 10px;
	display: flex;
	align-items: center;
	gap: 3px;
	background: rgba(255,255,255,0.95);
	padding: 5px 8px;
	border-radius: 20px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.woovar-color-circle {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1px solid rgba(0,0,0,0.1);
	flex-shrink: 0;
}

.woovar-color-circle[style*="ffffff"],
.woovar-color-circle[style*="FFFFFF"] {
	border-color: rgba(0,0,0,0.2);
}

.woovar-color-count {
	font-size: 11px;
	color: #333;
	font-weight: 600;
	margin-left: 2px;
}

/* Title */
.woovar-product-title {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	text-decoration: none;
	line-height: 1.4;
	margin-bottom: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.woovar-product-title:hover {
	color: #000;
}

/* Price */
.woovar-product-price {
	font-size: 14px;
	font-weight: 600;
	color: #000;
}

.woovar-product-price del {
	opacity: 0.5;
	font-weight: 400;
	margin-right: 6px;
}

.woovar-product-price ins {
	text-decoration: none;
	color: #c00;
}

/* Pagination */
.woovar-pagination {
	margin-top: 40px;
	display: flex;
	justify-content: center;
}

.woovar-pagination-inner {
	display: flex;
	align-items: center;
	gap: 8px;
}

.woovar-page-link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	text-decoration: none;
	color: #333;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.woovar-page-link:hover {
	border-color: #000;
	background: #000;
	color: #fff;
}

.woovar-page-link.active {
	background: #000;
	border-color: #000;
	color: #fff;
}

.woovar-page-link.prev,
.woovar-page-link.next {
	font-size: 18px;
}

.woovar-page-dots {
	color: #999;
	padding: 0 4px;
}

/* ========================================
   5. RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
	.woovar-products-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 992px) {
	.woovar-products-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
	}
}

@media (max-width: 768px) {
	.woovar-toolbar {
		flex-wrap: wrap;
		gap: 12px;
	}

	.woovar-toolbar-left {
		order: 1;
	}

	.woovar-toolbar-right {
		order: 2;
	}

	.woovar-sort-select {
		min-width: 140px;
		padding: 8px 32px 8px 12px;
		font-size: 13px;
	}

	.woovar-filter-toggle {
		padding: 8px 12px;
		font-size: 13px;
	}

	.woovar-filters-panel {
		padding: 16px;
	}

	.woovar-filters-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.woovar-filter-group {
		padding: 12px;
	}

	.woovar-filters-actions {
		flex-direction: column;
	}

	.woovar-apply-filters,
	.woovar-reset-filters {
		width: 100%;
		text-align: center;
	}

	.woovar-products-grid {
		grid-template-columns: repeat(var(--columns-mobile, 2), 1fr);
		gap: 12px;
	}

	.woovar-product-image {
		border-radius: 8px;
	}

	.woovar-product-title {
		font-size: 13px;
	}

	.woovar-product-price {
		font-size: 13px;
	}

	.woovar-swatch-item {
		padding: 8px 14px;
		font-size: 13px;
	}

	.woovar-swatch-item.woovar-image-swatch {
		width: 46px;
		height: 60px;
	}

	.woovar-lightbox-prev,
	.woovar-lightbox-next {
		width: 40px;
		height: 40px;
		font-size: 20px;
	}

	.woovar-lightbox-prev { left: 10px; }
	.woovar-lightbox-next { right: 10px; }

	.woovar-lightbox-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		font-size: 28px;
	}
}

@media (max-width: 480px) {
	.woovar-products-grid {
		gap: 10px;
	}

	.woovar-product-info {
		padding: 8px 2px;
	}

	.woovar-color-indicator {
		bottom: 6px;
		left: 6px;
		padding: 4px 6px;
	}

	.woovar-color-circle {
		width: 12px;
		height: 12px;
	}

	.woovar-color-count {
		font-size: 10px;
	}

	.woovar-product-title {
		font-size: 12px;
		-webkit-line-clamp: 1;
	}

	.woovar-product-price {
		font-size: 12px;
	}

	.woovar-page-link {
		min-width: 36px;
		height: 36px;
		font-size: 13px;
	}

	.woovar-swatch-wrapper { gap: 6px; }
	.woovar-swatch-item { padding: 6px 12px; font-size: 12px; }
	.woovar-swatch-item.woovar-image-swatch { width: 40px; height: 52px; }
	.woovar-gallery-thumbs { grid-template-columns: repeat(4, 1fr); gap: 4px; }
}
