/**
 * Dravin Pill Grid — Frontend Styles
 * @package Dravin_Products
 * @since   1.3.0
 */

/* ── Widget wrapper ─────────────────────────── */
.dpg-widget {
	position: relative;
	width: 100%;
}

/* ── Pill bar wrapper ───────────────────────── */
.dpg-pill-wrapper {
	position: relative;
	width: 100%;
	background: #fff;
	/* No hardcoded padding — controlled via Elementor wrapper_padding_y */
	z-index: 9998;
	transition: box-shadow 0.2s;
}

.dpg-pill-wrapper.dpg-is-sticky {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 9998; /* header at 9999 stays above */
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Placeholder div injected by JS to prevent layout jump when sticky kicks in */
.dpg-sticky-placeholder {
	display: none;
}
.dpg-sticky-placeholder.dpg-is-active {
	display: block;
}

/* ── Pill bar inner ─────────────────────────── */
.dpg-pill-inner {
	position: relative;
	display: flex;
	align-items: center;
}

/* ── Pill viewport + track ──────────────────── */
.dpg-pill-viewport {
	overflow: hidden;
	flex: 1;
	min-width: 0;
	cursor: grab;
	-webkit-overflow-scrolling: touch;
}
.dpg-pill-viewport.dpg-is-dragging {
	cursor: grabbing;
	user-select: none;
}

.dpg-pill-track {
	display: flex;
	gap: 8px;
	padding: 4px 2px 6px;
	transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
	width: max-content;
}

/* ── Individual pill ────────────────────────── */
.dpg-pill {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	flex-shrink: 0;
	padding: 8px 20px;
	border: 1px solid #e0e0e0;
	background: #ffffff;
	color: #222222;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
	-webkit-tap-highlight-color: transparent;
	outline: none;
	user-select: none;
}

.dpg-pill.active {
	background: #222222;
	color: #ffffff;
	border-color: #222222;
}

/* ── Arrows ─────────────────────────────────── */
.dpg-arrow {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid #e0e0e0;
	background: #ffffff;
	color: #333333;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.2s, background 0.15s;
	-webkit-tap-highlight-color: transparent;
	outline: none;
	z-index: 2;
}

.dpg-arrow:hover {
	background: #f5f5f5;
}

.dpg-arrow.dpg-hidden,
.dooda-arrow.dpg-hidden {
	opacity: 0;
	pointer-events: none;
}

.dpg-arrow.dooda-prev {
	margin-right: 6px;
}
.dpg-arrow.dooda-next {
	margin-left: 6px;
}

/* ── Grid ───────────────────────────────────── */
.dpg-grid-wrap {
	position: relative;
	min-height: 200px;
}

.dpg-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

/* ── Skeleton ───────────────────────────────── */
.dpg-skeleton-card {
	--dpg-skel-base:  #ebebeb;
	--dpg-skel-shine: #f5f5f5;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.dpg-skeleton-img {
	aspect-ratio: 3/4;
	background: linear-gradient(
		90deg,
		var(--dpg-skel-base)  25%,
		var(--dpg-skel-shine) 50%,
		var(--dpg-skel-base)  75%
	);
	background-size: 200% 100%;
	animation: dpg-shimmer 1.4s infinite;
}

.dpg-skeleton-line {
	height: 11px;
	border-radius: 4px;
	margin: 10px 10px 6px;
	background: linear-gradient(
		90deg,
		var(--dpg-skel-base)  25%,
		var(--dpg-skel-shine) 50%,
		var(--dpg-skel-base)  75%
	);
	background-size: 200% 100%;
	animation: dpg-shimmer 1.4s infinite;
}

.dpg-skeleton-line.dpg-short {
	width: 55%;
	margin-top: 0;
}

@keyframes dpg-shimmer {
	0%   { background-position:  200% 0; }
	100% { background-position: -200% 0; }
}

/* ── Card animation on load ─────────────────── */
.dpg-grid .dravin-product-card {
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── Scope product-grid card styles into dpg-grid ── */
.dpg-grid .dravin-product-card,
.dpg-grid .dravin-product-card.product-card,
.dpg-grid .dravin-product-card.productlist {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: visible !important;
	background: #ffffff;
	border: var(--dravin-card-border-width, 1px) solid var(--dravin-card-border-color, #e7e7e7) !important;
	border-radius: 8px;
	box-shadow: var(--dravin-card-shadow, none) !important;
}

.dpg-grid .dravin-product-image-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.dpg-grid .dravin-product-image,
.dpg-grid .dravin-product-image.imgBlockNew {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #ffebe7;
	aspect-ratio: 3/4;
}

.dpg-grid .dravin-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.dpg-grid .dravin-product-card:hover .dravin-product-image img {
	transform: scale(1.04);
}

.dpg-grid .dravin-product-content {
	padding: 8px 10px 10px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

/* Title + wishlist on same row */
.dpg-grid .dravin-product-heading,
.dpg-grid .dravin-product-heading.image-block-details {
	display: flex !important;
	align-items: flex-start !important;
	justify-content: space-between !important;
	gap: 6px !important;
	width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
}

.dpg-grid .dravin-product-title,
.dpg-grid .dravin-product-title.product-name-text {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: #111;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dpg-grid .dravin-product-title a {
	display: block;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Wishlist button — same row as title, right side */
.dpg-grid .dravin-wishlist-button,
.dpg-grid .dravin-wishlist-button.wishlistIconNew {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px;
	color: #bbb;
	transition: color 0.2s, transform 0.15s;
	-webkit-tap-highlight-color: transparent;
	outline: none;
}

.dpg-grid .dravin-wishlist-button svg,
.dpg-grid .dravin-wishlist-button i {
	width: 18px;
	height: 18px;
	font-size: 18px;
}

/* Active (wishlisted) = red */
.dpg-grid .dravin-wishlist-button.is-active {
	color: #e44c4c !important;
}

.dpg-grid .dravin-wishlist-icon-active {
	display: none;
}

.dpg-grid .dravin-wishlist-button.is-active .dravin-wishlist-icon-inactive {
	display: none;
}

.dpg-grid .dravin-wishlist-button.is-active .dravin-wishlist-icon-active {
	display: inline-flex;
	color: #e44c4c;
}

/* Category */
.dpg-grid .dravin-product-category {
	font-size: 12px;
	color: #777;
	margin: 0;
}

/* Price */
.dpg-grid .dravin-product-price {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.dpg-grid .dravin-sale-price {
	font-size: 13px;
	font-weight: 700;
	color: #111;
}

.dpg-grid .dravin-regular-price.is-crossed {
	font-size: 11px;
	font-weight: 400;
	color: #999;
	text-decoration: line-through;
}

.dpg-grid .dravin-regular-price:not(.is-crossed) {
	font-size: 13px;
	font-weight: 700;
	color: #111;
}


