/*
Theme Name: NFP Hello Elementor Child Theme
Theme URI: https://needforparts.eu
Template: hello-elementor
Author: Gökay & Fatih
Description: A child theme for Hello Elementor Theme
Version: 1.0.0
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: nfp-hello-elementor-child
Requires at least: 6.7.1
Tested up to: 6.7.1
Requires PHP: 7.4
WooCommerce: 9.5.1
*/

/* Product Grid Layout */
.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

/* Swiper Products Layout Override */
.woocommerce .swiper ul.products.swiper-wrapper {
    display: flex;
    grid-template-columns: none;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    transform: translate3d(0, 0, 0);
    width: 100%;
}

/* Pre-initialization styles to prevent layout shifts */
.products-swiper-container:not(.swiper-initialized) .swiper-wrapper {
    display: flex;
    flex-wrap: nowrap;
    transform: translate3d(0, 0, 0);
    width: 100%;
}

.products-swiper-container:not(.swiper-initialized) .swiper-wrapper > * {
    width: calc(33.333% - 13.333px);
    flex-shrink: 0;
    max-width: 288px;
	margin-right: 20px;
}

@media (max-width: 1024px) {
    .products-swiper-container:not(.swiper-initialized) .swiper-wrapper > * {
        width: calc(33.333% - 13.333px);
        max-width: 288px;
    }
}

@media (max-width: 768px) {
    .products-swiper-container:not(.swiper-initialized) .swiper-wrapper > * {
        width: calc(50% - 6px);
        max-width: none;
        padding: 0;
        box-sizing: border-box;
        margin-right: 12px;
    }
}

.products-swiper-container {
    position: relative;
    overflow: hidden;
}

.products-swiper-container .swiper {
    overflow: visible;
    position: relative;
}

.products-swiper-container .swiper-button-prev,
.products-swiper-container .swiper-button-next {
    color: var(--e-global-color-primary, #0066cc);
    background-color: white;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
    top: 45%;
    margin-top: -20px;
}

.products-swiper-container .swiper-button-prev:after,
.products-swiper-container .swiper-button-next:after {
    font-size: 16px;
    font-weight: bold;
}

/* Fix for slide content sizing */
.products-swiper-container .swiper-slide .product-card {
    width: 100% !important;
    margin: 0 !important;
    max-width: none !important;
}

/* Ensure products are fully visible in slider */
.products-swiper-container .swiper-slide .product-card__wrapper {
    width: 100%;
    height: 100%;
}

/* Product Card - Making sure swiper elements get the same styling */
.woocommerce ul.products li.product-card,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card {
	position: relative;
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
	float: none !important;
}

.woocommerce ul.products li.product-card .product-card__wrapper,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__wrapper {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	overflow: hidden;
	transition: all 300ms ease;
	height: 100%;
}

.woocommerce ul.products li.product-card .product-card__wrapper:hover,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__wrapper:hover {
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	transform: translateY(-4px);
}

/* Ensure swiper slides also get the same hover effect */
.products-swiper-container .swiper-slide:hover .product-card__wrapper {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    position: relative;
    z-index: 5; /* Higher z-index to ensure hover effect is visible when cards overlap */
}

/* Badge (Bestseller, New, Limited Edition) */
.woocommerce ul.products li.product-card .product-card__badge,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 10;
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 20px;
	color: #ffffff;
}

.woocommerce ul.products li.product-card .product-card__badge--bestseller,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__badge--bestseller {
	background-color: #f59e0b;
}

.woocommerce ul.products li.product-card .product-card__badge--new,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__badge--new {
	background-color: #10C410;
}

.woocommerce ul.products li.product-card .product-card__badge--limited-edition,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__badge--limited-edition {
	background-color: #8b5cf6;
}

/* Discount Badge */
.woocommerce ul.products li.product-card .product-card__discount-badge,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__discount-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 8;
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 20px;
	background-color: #C50F0F;
	color: #ffffff;
}

/* Product Image */
.woocommerce ul.products li.product-card .product-card__image-wrapper,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__image-wrapper {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1/1;
	width: 100%;
}

.woocommerce ul.products li.product-card .product-card__image,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 500ms ease;
}

/* Change hover selector from image-wrapper to the entire card wrapper */
.woocommerce ul.products li.product-card .product-card__wrapper:hover .product-card__image,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__wrapper:hover .product-card__image {
	transform: scale(1.1);
}

/* Product Content */
.woocommerce ul.products li.product-card .product-card__content,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__content {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 16px;
}

/* Title */
.woocommerce ul.products li.product-card .product-card__title,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__title {
	margin: 0 0 12px 0;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}

.woocommerce ul.products li.product-card .product-card__title a,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__title a {
	color: #1f2937;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 200ms ease;
	font-weight: bold;
}

.woocommerce ul.products li.product-card .product-card__title a:hover,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__title a:hover {
	color: var(--e-global-color-primary, #0066cc);
}

/* Look Text Styling */
.woocommerce ul.products li.product-card .product-card__look,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__look {
	margin-bottom: 0.25rem;  /* equivalent to mb-1 */
	font-size: 0.875rem;     /* equivalent to text-sm */
	font-weight: 500;        /* equivalent to font-medium */
	color: #6b7280;          /* equivalent to text-gray-500 */
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Price */
.woocommerce ul.products li.product-card .product-card__price-wrapper,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__price-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.woocommerce ul.products li.product-card .product-card__price,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__price {
	font-size: 18px;
	font-weight: 700;
	color: #1f2937;
}

.woocommerce ul.products li.product-card .product-card__price--sale,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__price--sale {
	color: #C50F0F;
}

.woocommerce ul.products li.product-card .product-card__price--regular,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__price--regular {
	font-size: 14px;
	font-weight: 400;
	text-decoration: line-through;
	color: #6b7280;
}

/* Stock Indicator */
.woocommerce ul.products li.product-card .product-card__stock,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
}

.woocommerce ul.products li.product-card .product-card__stock-indicator,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-indicator {
	position: relative;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* In Stock Indicator */
.woocommerce ul.products li.product-card .product-card__stock-indicator--in-stock,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-indicator--in-stock {
	background-color: #10C410;
}

.woocommerce ul.products li.product-card .product-card__stock-indicator--in-stock::before,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-indicator--in-stock::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background-color: rgba(16, 196, 16, 0.3);
	transform: translate(-50%, -50%);
	animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
	0% {
		transform: translate(-50%, -50%) scale(0.7);
		opacity: 0.7;
	}
	50% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 0.3;
	}
	100% {
		transform: translate(-50%, -50%) scale(0.7);
		opacity: 0.7;
	}
}

/* Low Stock Indicator */
.woocommerce ul.products li.product-card .product-card__stock-indicator--low-stock,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-indicator--low-stock {
	background-color: #f59e0b;
}

/* Out of Stock Indicator */
.woocommerce ul.products li.product-card .product-card__stock-indicator--out-of-stock,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-indicator--out-of-stock {
	background-color: #C50F0F;
}

.woocommerce ul.products li.product-card .product-card__stock-text,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-text {
	font-size: 12px;
}

.woocommerce ul.products li.product-card .product-card__stock-text--in-stock,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-text--in-stock {
	color: #10C410;
}

.woocommerce ul.products li.product-card .product-card__stock-text--low-stock,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-text--low-stock {
	color: #f59e0b;
}

.woocommerce ul.products li.product-card .product-card__stock-text--out-of-stock,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__stock-text--out-of-stock {
	color: #C50F0F;
}

/* Add to Cart Button */
.woocommerce ul.products li.product-card .product-card__add-to-cart,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__add-to-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #ffffff;
	background-color: #1f1f1f;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 200ms ease;
	margin-top: auto;
}

.woocommerce ul.products li.product-card .product-card__add-to-cart:hover,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__add-to-cart:hover {
	background-color: #010101;
}

.woocommerce ul.products li.product-card .product-card__add-to-cart--disabled,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__add-to-cart--disabled {
	background-color: #d1d5db;
	cursor: not-allowed;
}

.woocommerce ul.products li.product-card .product-card__cart-icon,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__cart-icon {
	width: 16px;
	height: 16px;
}

.woocommerce ul.products li.product-card .product-card__add-to-cart.loading,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__add-to-cart.loading {
	opacity: 0.7;
}

.woocommerce ul.products li.product-card .product-card__add-to-cart.added,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__add-to-cart.added {
	background-color: #10C410;
}

.woocommerce ul.products li.product-card .product-card__loading-icon,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__loading-icon {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.woocommerce ul.products li.product-card .product-card__success-icon,
.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__success-icon {
	animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	80% {
		transform: scale(1.2);
		opacity: 1;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Accessibility */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	}
	
	.woocommerce ul.products li.product-card .product-card__title,
	.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__title {
		font-size: 14px;
	}
	
	.woocommerce ul.products li.product-card .product-card__price,
	.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__price {
		font-size: 16px;
	}

	.woocommerce ul.products li.product-card .product-card__content {
		padding: 12px !important;
	}

	.woocommerce ul.products li.product-card .product-card__add-to-cart,
	.woocommerce .swiper ul.products.swiper-wrapper li.product-card .product-card__add-to-cart {
		gap: 6px;
	}
}

@media (max-width: 480px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}
	
	.products-swiper-container .swiper-button-prev,
	.products-swiper-container .swiper-button-next {
		width: 30px;
		height: 30px;
	}
	
	.products-swiper-container .swiper-button-prev:after,
	.products-swiper-container .swiper-button-next:after {
		font-size: 12px;
	}
}

.products-swiper-container .swiper-pagination {
    display: none;
}

.nfp-woocommerce-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nfp-woocommerce-subcategories .subcategory-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.9rem!important;
    font-weight: 600!important;
    color: #ffffff!important;
    background-color: #1f1f1f;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none!important;
    width: auto;
    box-sizing: border-box;
}
.nfp-woocommerce-subcategories .subcategory-item a:hover,
.nfp-woocommerce-subcategories .subcategory-item a:focus {
    background-color: #000;
    color: #fff;
}
.nfp-woocommerce-subcategories .subcategory-item {
    margin: 0;
    padding: 0;
}
.woocommerce .woocommerce-ordering {
    margin: 0 !important;
}

/* --- Utility class for hiding elements by default (moved from inline style in PHP) --- */
.hidden-by-default {
    display: none;
}
/* --- End utility class --- */

/* --- Debug box for current language (moved from inline style in PHP) --- */
.nfp-lang-debug-box {
    position: fixed;
    bottom: 0;
    right: 0;
    background: #fff;
    padding: 5px;
    z-index: 9999;
}
/* --- End debug box --- */

/* --- Shop header row layout (moved from inline style in PHP) --- */
.nfp-shop-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2em;
    gap: 20px;
    flex-wrap: wrap;
}
/* --- End shop header row --- */

/* Hide WooCommerce 'View cart' link after AJAX add to cart */
a.added_to_cart.wc-forward {
    display: none !important;
}

.nfp-breadcrumbs {
    margin-top: 16px;
}

/* --- NFP Chassis Level Disclaimer Styles --- */
.nfp-chassis-disclaimer {
    background-color: transparent;
    border: 2px solid #C50F0F;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 8px 16px;
    display: inline-block;
    width: fit-content;
}

.nfp-disclaimer-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #C50F0F;
    font-weight: 600;
    font-size: 1rem;
}

.nfp-disclaimer-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    color: #C50F0F;
}

.nfp-disclaimer-text {
    flex: 1;
}
/* --- End NFP Chassis Level Disclaimer Styles --- */