/* ============================================================
   lakasg Product Grid Widget  v2.1.6
   Arrow & height are set via inline style on each select in PHP
   so they cannot be overridden by any theme CSS.
   Elementor color/border/radius controls still apply here.
   ============================================================ */

.lakasg-grid-wrap {
	box-sizing: border-box;
	font-family: inherit;
	width: 100%;
}

/* ── Dropdowns bar ─────────────────────────────────────────── */
.lakasg-grid-topbar {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 24px;
	width: 100%;
}

.lakasg-dropdown-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Default order: filter left, sort right */
.lakasg-filter-group { order: 1; }
.lakasg-sort-group   { order: 2; }

/* Swapped order */
.lakasg-grid-topbar--sort-first .lakasg-filter-group { order: 2; }
.lakasg-grid-topbar--sort-first .lakasg-sort-group   { order: 1; }

/* Labels */
.lakasg-filter-label,
.lakasg-sort-label {
	font-size: 0.875rem;
	color: #555;
	font-weight: 500;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Select base — height, arrow, and appearance are in inline style (PHP).
   Only colour/border/radius overrides live here so Elementor controls work. */
.lakasg-filter-select,
.lakasg-sort-select {
	display: block;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	/* Default look — overridable by Elementor controls */
	background-color: #ffffff;
	color: #333333;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	width: 200px;
}

.lakasg-filter-select:focus,
.lakasg-sort-select:focus {
	border-color: #999 !important;
	box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

/* Elementor colour overrides — use !important so they win over theme defaults */
/* (generated Elementor CSS for filter_bg / sort_bg / text / border already has
   !important from our selectors in PHP, so these are just safety fallbacks) */

/* ── Grid body ─────────────────────────────────────────────── */
.lakasg-grid-body { position: relative; width: 100%; }

/* ── Product grid ───────────────────────────────────────────── */
.lakasg-grid-products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 24px;
	row-gap: 28px;
}

/* ── Card ───────────────────────────────────────────────────── */
.lakasg-grid-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #ebebeb;
	border-radius: 10px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	padding-bottom: 16px;
}

.lakasg-grid-card:hover {
	box-shadow: 0 8px 28px rgba(0,0,0,.10);
	transform: translateY(-3px);
}

.lakasg-grid-card-img-wrap { position: relative; flex-shrink: 0; }

.lakasg-grid-card-img {
	width: 100%;
	height: 240px; /* default — overridden by image_height control */
	overflow: hidden;
}

/* Auto ratio: image defines its own height */
.lakasg-grid-card-img.ratio-auto {
	height: auto !important;
	aspect-ratio: unset !important;
}

/* Preset aspect ratios — height controlled by ratio, not slider */
.lakasg-grid-card-img.ratio-1\/1  { aspect-ratio: 1/1;  height: auto !important; }
.lakasg-grid-card-img.ratio-4\/3  { aspect-ratio: 4/3;  height: auto !important; }
.lakasg-grid-card-img.ratio-3\/2  { aspect-ratio: 3/2;  height: auto !important; }
.lakasg-grid-card-img.ratio-16\/9 { aspect-ratio: 16/9; height: auto !important; }
.lakasg-grid-card-img.ratio-3\/4  { aspect-ratio: 3/4;  height: auto !important; }

.lakasg-grid-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover; /* overridden by image_fit control */
	display: block;
	transition: transform .3s ease;
}

/* Auto ratio: image sits at natural size */
.lakasg-grid-card-img.ratio-auto img {
	height: auto;
	max-width: 100%;
}

.lakasg-grid-card:hover .lakasg-grid-card-img img { transform: scale(1.04); }

.lakasg-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; }

.lakasg-badge {
	display: inline-block; padding: 3px 9px;
	font-size: .72rem; font-weight: 700;
	letter-spacing: .4px; text-transform: uppercase;
	border-radius: 4px; line-height: 1.4;
}

.lakasg-badge--sale { background: #e74c3c; color: #fff; }
.lakasg-badge--new  { background: #27ae60; color: #fff; }

.lakasg-grid-card-body { flex: 1; display: flex; flex-direction: column; padding: 14px 16px 0; gap: 6px; }

.lakasg-grid-card-title-link { text-decoration: none; }
.lakasg-grid-card-title-link:hover .lakasg-grid-card-title { color: #555; }

.lakasg-grid-card-title { font-size: .95rem; font-weight: 600; color: #111; margin: 0; line-height: 1.35; transition: color .15s; }

.lakasg-grid-card-price { font-size: .95rem; font-weight: 600; color: #111; line-height: 1.2; }
.lakasg-grid-card-price ins { text-decoration: none; }
.lakasg-grid-card-price del { opacity: .5; font-size: .85em; margin-right: 4px; }

.lakasg-grid-rating { font-size: 14px; line-height: 1; }
.lakasg-grid-rating .star-rating { float: none; }

.lakasg-grid-card-desc { font-size: .82rem; color: #666; line-height: 1.5; margin: 0; }

.lakasg-grid-card-btns { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 12px; }

.lakasg-btn-atc,
.lakasg-btn-custom {
	display: block; width: 100%; text-align: center;
	padding: 9px 12px; font-size: .85rem; font-weight: 600;
	border-radius: 6px; text-decoration: none; border: none;
	cursor: pointer; line-height: 1.3;
	transition: background-color .18s, color .18s;
	box-sizing: border-box;
}

.lakasg-btn-atc           { background: #111; color: #fff; }
.lakasg-btn-atc:hover     { background: #333; color: #fff; text-decoration: none; }
.lakasg-btn-custom        { background: #f5f5f5; color: #111; }
.lakasg-btn-custom:hover  { background: #111; color: #fff; text-decoration: none; }

.lakasg-btn-atc.lakasg-adding { opacity: .7; cursor: wait; pointer-events: none; }
.lakasg-btn-atc.lakasg-added  { background-color: #16a34a !important; color: #fff !important; }

/* ── Loading overlay ────────────────────────────────────────── */
.lakasg-grid-loading-overlay {
	position: absolute; inset: 0;
	background: rgba(255,255,255,.7);
	display: flex; align-items: center; justify-content: center;
	z-index: 10; border-radius: 8px;
}

.lakasg-spinner {
	width: 36px; height: 36px;
	border: 3px solid #e0e0e0; border-top-color: #111;
	border-radius: 50%;
	animation: lakasg-spin .7s linear infinite;
}

@keyframes lakasg-spin { to { transform: rotate(360deg); } }

/* ── Pagination ─────────────────────────────────────────────── */
.lakasg-grid-pagination { margin-top: 36px; display: flex; justify-content: center; }

.lakasg-load-more-btn,
.lakasg-grid-custom-pagination-btn {
	padding: 12px 36px; background: #111; color: #fff;
	border: none; border-radius: 6px; font-size: .95rem; font-weight: 600;
	cursor: pointer; transition: background .18s, opacity .18s;
	display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}

.lakasg-load-more-btn:hover:not(:disabled),
.lakasg-grid-custom-pagination-btn:hover { background: #333; color: #fff; text-decoration: none; }
.lakasg-load-more-btn:disabled             { opacity: .55; cursor: not-allowed; }

.lakasg-classic-pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.lakasg-page-btn {
	width: 38px; height: 38px; border: 1px solid #ddd;
	background: #fff; color: #333; font-size: .875rem; font-weight: 600;
	border-radius: 6px; cursor: pointer;
	transition: background .15s, color .15s;
	display: flex; align-items: center; justify-content: center;
}

.lakasg-page-btn:hover    { background: #333; color: #fff; border-color: #333; }
.lakasg-page-btn.is-active { background: #111; color: #fff; border-color: #111; }

.lakasg-infinite-sentinel  { height: 1px; }
.lakasg-infinite-loading   { text-align: center; padding: 16px; color: #888; font-size: .875rem; }

.lakasg-grid-no-products { grid-column: 1/-1; text-align: center; padding: 48px 16px; color: #aaa; font-size: 1rem; }

/* ── Tablet ─────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1024px) {
	.lakasg-grid-products { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
	.lakasg-grid-products { grid-template-columns: repeat(1, 1fr); }

	.lakasg-grid-topbar {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
	}

	.lakasg-filter-group,
	.lakasg-sort-group,
	.lakasg-grid-topbar--sort-first .lakasg-filter-group,
	.lakasg-grid-topbar--sort-first .lakasg-sort-group { order: unset; }

	.lakasg-dropdown-group { width: 100%; }

	.lakasg-filter-select,
	.lakasg-sort-select { width: 100% !important; }
}

/* ── Read More button ───────────────────────────────────────── */
.lakasg-btn-read-more {
	display: block;
	width: 100%;
	text-align: center;
	padding: 9px 12px;
	font-size: .85rem;
	font-weight: 600;
	border-radius: 6px;
	text-decoration: none;
	border: none;
	cursor: pointer;
	line-height: 1.3;
	transition: background-color .18s, color .18s;
	box-sizing: border-box;
	background: #f0f0f0;
	color: #111;
}

.lakasg-btn-read-more:hover {
	background: #555;
	color: #fff;
	text-decoration: none;
}

/* ────────────────────────────────────────────────────────────────────────────
   Wishlist heart in the card corner (v2.9.0)
   The button itself uses .lakasg-wl-btn--icon styling from lakasg-wishlist.css
   for shape and state colors. This rule only handles positioning.
   ──────────────────────────────────────────────────────────────────────────── */
.lakasg-grid-card-img-wrap { position: relative; }
.lakasg-grid-card-wl {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
}
.lakasg-grid-card-wl .lakasg-wl-btn {
	width: 36px;
	height: 36px;
	background: rgba(255,255,255,0.92);
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.lakasg-grid-card-wl .lakasg-wl-btn:hover {
	background: #fff;
}
.lakasg-grid-card-wl .lakasg-wl-btn.is-saved {
	background: #fff;
}
