/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* Brand directory filtering */
.elko-brand-directory .elko-brand-card[hidden] {
	display: none !important;
}

.elko-brand-directory .elko-brand-empty[hidden] {
	display: none !important;
}

/* ELKO Brand Directory */
.elko-brand-directory {
			--elko-accent: #4d32e6;
			--elko-border: #e8e8ed;
			--elko-surface: #f7f7f9;
			margin: 30px auto 60px;
		}

		.elko-brand-directory__header {
			margin-bottom: 25px;
			text-align: center;
		}

		.elko-brand-directory__header h1 {
			margin-bottom: 8px;
		}

		.elko-brand-directory__header p {
			margin: 0;
			color: #777;
		}

		.elko-brand-directory__search {
			max-width: 560px;
			margin: 0 auto 22px;
		}

		.elko-brand-search {
			width: 100%;
			height: 52px;
			padding: 0 20px;
			border: 1px solid var(--elko-border);
			border-radius: 14px;
			background: #fff;
			font-size: 16px;
		}

		.elko-brand-alphabet {
			display: flex;
			flex-wrap: wrap;
			justify-content: center;
			gap: 7px;
			margin-bottom: 18px;
		}

		.elko-brand-alphabet button {
			min-width: 38px;
			height: 38px;
			padding: 0 10px;
			border: 1px solid var(--elko-border);
			border-radius: 9px;
			background: #fff;
			color: #333;
			cursor: pointer;
			font-weight: 600;
		}

		.elko-brand-alphabet button:hover,
		.elko-brand-alphabet button.is-active {
			border-color: var(--elko-accent);
			background: var(--elko-accent);
			color: #fff;
		}

		.elko-brand-results {
			margin-bottom: 18px;
			text-align: right;
			color: #777;
		}

		.elko-brand-grid {
			display: grid;
			grid-template-columns: repeat(6, minmax(0, 1fr));
			gap: 14px;
		}

		.elko-brand-card {
			display: flex;
			min-width: 0;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			padding: 18px 12px 14px;
			border: 1px solid var(--elko-border);
			border-radius: 15px;
			background: var(--elko-surface);
			color: #222;
			text-align: center;
			transition: transform .2s, box-shadow .2s, border-color .2s;
		}

		.elko-brand-card:hover {
			border-color: #d6d2f5;
			box-shadow: 0 8px 24px rgba(0, 0, 0, .07);
			color: var(--elko-accent);
			transform: translateY(-3px);
		}

		.elko-brand-card__logo {
			display: flex;
			width: 100%;
			height: 85px;
			align-items: center;
			justify-content: center;
		}

		.elko-brand-card__logo img {
			width: auto;
			max-width: 100%;
			height: auto;
			max-height: 80px;
			object-fit: contain;
		}

		.elko-brand-card__fallback {
			font-size: 25px;
			font-weight: 700;
		}

		.elko-brand-card__name {
			margin-top: 8px;
			font-size: 14px;
			font-weight: 600;
		}

		.elko-brand-empty {
			padding: 35px;
			text-align: center;
		}

		@media (max-width: 1024px) {
			.elko-brand-grid {
				grid-template-columns: repeat(4, minmax(0, 1fr));
			}
		}

		@media (max-width: 767px) {
			.elko-brand-grid {
				grid-template-columns: repeat(2, minmax(0, 1fr));
				gap: 10px;
			}

			.elko-brand-card {
				padding: 13px 8px;
			}

			.elko-brand-alphabet {
				justify-content: flex-start;
			}

			.elko-brand-results {
				text-align: left;
			}
		}

/* Larger brand logos */
.elko-brand-directory .elko-brand-card__logo {
	height: 105px;
}

.elko-brand-directory .elko-brand-card__logo img {
	width: 100
/* ==========================================================
   GASP PRODUCT IMAGE NORMALIZATION
   Same frame / no stretch / full product visible
   ========================================================== */

.wd-products .wd-product .product-element-top {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fff;
}

.wd-products .wd-product .product-image-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wd-products .wd-product .product-image-link img,
.wd-products .wd-product .hover-img img,
.wd-products .wd-product img.attachment-woocommerce_thumbnail {
    width: calc(100% - 16px) !important;
    height: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    max-height: calc(100% - 16px) !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* Keep hover image inside exactly the same frame */
.wd-products .wd-product .hover-img {
    width: 100%;
    height: 100%;
}


/* ==========================================================
   GASP PRODUCT IMAGE LOADING STABILITY
   Prevent jump / flash while thumbnails load
   ========================================================== */

.wd-products .wd-product .product-element-top {
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 1px;
    background: #fff;
}

.wd-products .wd-product .product-image-link {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.wd-products .wd-product .product-image-link img,
.wd-products .wd-product .hover-img img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    opacity: 1;
    transition: opacity .2s ease;
}

/* Prevent lazy-load placeholder from changing dimensions */
.wd-products .wd-product img[loading="lazy"] {
    aspect-ratio: 1 / 1;
}
