/**
 * LFA Product Enhancements Styles
 * 
 * @package LFA
 * @version 1.0.0
 */

/* ========================================
   UKRYCIE DUPLIKATU RATING
   ======================================== */

/* Ukryj całą sekcję ts-product-ratings-stock */
.woocommerce div.product .ts-product-ratings-stock {
	display: none !important;
	visibility: hidden !important;
}

/* Ukryj rating który NIE jest w sku-rating-wrapper */
.woocommerce div.product .summary > .woocommerce-product-rating:not(.inline-rating) {
	display: none !important;
}

/* Pokaż tylko rating w sku-rating-wrapper */
.sku-rating-wrapper .woocommerce-product-rating {
	display: flex !important;
}

/* ========================================
   SEKCJA SHIPPING INFO
   ======================================== */

.product__block-shipping {
	margin: 15px 0;
	padding: 12px 0;
	border-top: 1px solid #eeeeee;
	border-bottom: 1px solid #eeeeee;
	display: flex;
	flex-direction: row !important;
	flex-wrap: wrap;
	gap: 15px;
	align-items: center;
}

.product__block-shipping .product__shipping,
.product__block-shipping .product__delivery {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	line-height: 1.5;
}

/* Kolory dla różnych czasów wysyłki */
.product__block-shipping .block__availability-time.immediate {
	color: #28a745;
	font-weight: 600;
}

.product__block-shipping .block__availability-time.one-day {
	color: #ffc107;
	font-weight: 600;
}

.product__block-shipping .block__availability-time.three-days {
	color: #dc3545;
	font-weight: 600;
}

/* Kolory dla różnych kosztów dostawy */
.product__block-shipping .delivery-cost.free-delivery {
	color: #28a745 !important;
	font-weight: 600;
}

.product__block-shipping .delivery-cost.paid-delivery {
	color: #dc3545 !important;
	font-weight: 600;
}

/* Tooltip icon */
.product__block-shipping .tooltip.icon {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background-color: #007cba;
	color: white;
	font-size: 12px;
	line-height: 16px;
	text-align: center;
	cursor: help;
	position: relative;
}

.product__block-shipping .tooltip.icon:before {
	content: "?";
	font-weight: bold;
}

.product__block-shipping .tooltip.icon:hover:after,
.product__block-shipping .tooltip.icon:focus:after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 125%;
	left: 50%;
	transform: translateX(-50%);
	background-color: #333;
	color: white;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 12px;
	white-space: normal;
	width: 200px;
	text-align: left;
	z-index: 1000;
	line-height: 1.3;
}

/* ========================================
   SKU + RATING W JEDNEJ LINII
   ======================================== */

.woocommerce div.product .summary > .sku-rating-wrapper {
	clear: none !important;
	margin: 0 0 0px;
	line-height: 18px;
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 10px !important;
	padding: 10px 0;
	border-bottom: 1px solid #eeeeee;
	flex-direction: row !important;
}

/* WYMUSZENIE KOLEJNOŚCI: SKU pierwszy, Rating drugi */
.woocommerce div.product .summary .sku-rating-wrapper .sku-wrapper {
	order: 1 !important;
}

.woocommerce div.product .summary .sku-rating-wrapper .inline-rating {
	order: 2 !important;
}

.woocommerce div.product .summary .sku-rating-wrapper .sku-wrapper {
	display: flex !important;
	align-items: center !important;
	margin: 0 !important;
	clear: none !important;
}

.woocommerce div.product .summary .sku-rating-wrapper .inline-rating {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	margin: 0 !important;
	clear: none !important;
}

.woocommerce div.product .summary .sku-rating-wrapper * {
	clear: none !important;
}

.woocommerce div.product .summary > .sku-wrapper {
	margin-bottom: 28px;
}

.woocommerce div.product .summary > .single-counter-wrapper,
.woocommerce div.product .summary > *:last-child {
	margin-bottom: 0;
}

.woocommerce div.product .summary a:not(.button) {
	color: inherit;
}

.woocommerce div.product .summary > *:not(.button) {
	padding: 0;
}

.woocommerce div.product p.price, 
.woocommerce div.product span.price {
	font-size: 100%;
}

.woocommerce .single-product-buttons,
.woocommerce .woocommerce-product-rating {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: horizontal;
	-webkit-box-direction: normal;
	-ms-flex-flow: row wrap;
	flex-flow: row wrap;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
}

.woocommerce .woocommerce-product-rating .star-rating,
.woocommerce .woocommerce-product-rating > * {
	margin: 0 5px 0 0;
	float: none;
}

.woocommerce .woocommerce-tabs .woocommerce-product-rating .star-rating,
.woocommerce .woocommerce-tabs .woocommerce-product-rating > * {
	margin: 0 15px 0 0;
}

.woocommerce .woocommerce-product-rating > *:last-child {
	margin-right: 0;
}

.summary .woocommerce-product-rating .woocommerce-review-link {
	text-decoration: none !important;
}

.woocommerce-product-rating .review-count {
	position: relative;
	top: 1px;
}

/* ========================================
   SWATCHES - KAFELKI W JEDNEJ LINII
   ======================================== */

/* KRYTYCZNE: Wymuszenie FLEX dla kafelków swatches */
/* Zwiększona specyficzność selektorów aby nadpisać domyślne CSS */
.variations_form .variations .jaroti-size-swatches.swatch-attribute-options,
.variations_form .variations .jaroti-color-swatches.swatch-attribute-options,
form.cart .variations .jaroti-size-swatches.swatch-attribute-options,
form.cart .variations .jaroti-color-swatches.swatch-attribute-options,
.swatch-attribute-options {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	gap: 10px !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
}

/* Główny kontener dla swatches - FLEX ROW */
.variations_form .variations .value {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	gap: 8px !important;
	align-items: flex-start !important;
}

/* Pojedynczy swatch */
.variations_form .variations .value .variable-item {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 30px !important;
	width: auto !important;
	min-height: 30px !important;
	height: auto !important;
	padding: 5px 8px !important;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
	background: white;
	flex: 0 0 auto;
	margin: 0 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	white-space: nowrap !important;
	line-height: 1.2 !important;
}

.variations_form .variations .value .variable-item:hover {
	border-color: #333;
	transform: translateY(-2px);
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.variations_form .variations .value .variable-item.selected {
	border-color: #000;
	background: #f8f8f8;
	font-weight: 600;
}

/* Swatches dla kolorów */
.variations_form .variations .value .variable-item.variable-item-color {
	width: 45px;
	height: 45px;
	border-radius: 50%;
	padding: 0;
}

/* ========================================
   OUT OF STOCK SWATCHES - PRZEKREŚLENIE
   ======================================== */

/* Warianty bez stanu - przekreślenie i opacity */
.variations_form .variations .value .variable-item.out-of-stock {
	opacity: 0.4;
	cursor: not-allowed !important;
	pointer-events: none;
	position: relative;
}

.variations_form .variations .value .variable-item.out-of-stock:before {
	content: "";
	position: absolute;
	top: 50%;
	left: 5%;
	right: 5%;
	height: 2px;
	background: #dc3545;
	transform: translateY(-50%) rotate(-15deg);
	z-index: 10;
}

.variations_form .variations .value .variable-item.out-of-stock:hover {
	transform: none;
	box-shadow: none;
	border-color: #ddd;
}

/* Tekst wariantu out of stock */
.variations_form .variations .value .variable-item.out-of-stock .variable-item-span {
	text-decoration: line-through;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
	.product__block-shipping {
		font-size: 13px;
	}
	
	.sku-rating-wrapper {
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 8px !important;
	}
	
	.variations_form .variations .value .variable-item {
		min-width: 40px;
		height: 40px;
		padding: 6px 10px;
	}
}

/* ========================================
   FIX DLA KOMPATYBILNOŚCI
   ======================================== */

/* Resetowanie konfliktów z innymi pluginami */
.variations_form .variations .value {
	list-style: none !important;
	padding-left: 0 !important;
}

.variations_form .variations .value .variable-item {
	list-style: none !important;
}

/* Upewnienie się że select jest ukryty gdy swatches są aktywne */
.variations_form .variations select.hidden-by-swatches {
	display: none !important;
}

/* ========================================
   OMNIBUS - FIX DUPLIKACJI
   ======================================== */

/**
 * Problem: Wtyczka Omnibus dodaje komunikat do KAŻDEJ ceny HTML,
 * w tym do ukrytej ceny zakresu (p.price.hidden) dla produktów zmiennych.
 * 
 * Rozwiązanie: Ukryj Omnibus poza cenąwariantu (.ts-variation-price)
 */

/* Ukryj Omnibus z ukrytej ceny głównej (zakres cen) */
.woocommerce div.product .summary > p.price.hidden .iworks-omnibus,
.woocommerce div.product .summary > p.price.hidden + p.iworks-omnibus,
.woocommerce div.product .summary > p.iworks-omnibus[data-iwo-product_id]:not([data-iwo-variation_id]) {
	display: none !important;
	visibility: hidden !important;
}

/* Pokaż TYLKO Omnibus w cenie wariantu */
.woocommerce div.product .ts-variation-price .iworks-omnibus,
.woocommerce div.product .ts-variation-price p.iworks-omnibus {
	display: block !important;
	visibility: visible !important;
	margin-top: 8px;
}

/* Upewnij się że ukryta cena jest rzeczywiście ukryta */
.woocommerce div.product .summary > p.price.hidden {
	display: none !important;
	visibility: hidden !important;
}

/* Stylowanie Omnibus w cenie wariantu */
.ts-variation-price .iworks-omnibus {
	font-size: 0.9em;
	color: #666;
	margin-top: 8px;
	font-weight: 400;
	display: inline !important;
}

/* v1.1.5: Omnibus screen-reader-text and amount should be inline */
.iworks-omnibus .screen-reader-text,
.iworks-omnibus .amount,
.iworks-omnibus .woocommerce-Price-amount {
	display: inline !important;
	margin-right: 5px;
}

