/* ==========================================================================
   Digiskyward Product Grid -- base layout & mechanics.

   Colours, typography, spacing and borders are almost all driven by the
   widget's own Elementor Style controls (generated per-instance as inline
   CSS scoped to that widget). This file only holds the structural layout
   and the handful of interaction/rendering tricks that aren't things an
   Elementor control can express on its own -- the star-rating fill, the
   line-clamp on titles, disabled/loading button states, and motion.
   ========================================================================== */

.dsw-product-grid {
	box-sizing: border-box;
}

.dsw-product-grid *,
.dsw-product-grid *::before,
.dsw-product-grid *::after {
	box-sizing: inherit;
}

.dsw-empty {
	opacity: 0.7;
	text-align: center;
	padding: 40px 20px;
}

.dsw-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

/* ---- Card ---------------------------------------------------------------- */

.dsw-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dsw-card__media-wrap {
	position: relative;
	overflow: hidden;
}

.dsw-card__media {
	display: block;
	aspect-ratio: 1 / 1;
	background: #f3f3f5;
}

.dsw-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.dsw-card:hover .dsw-card__media img {
	transform: scale(1.045);
}

.dsw-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	flex: 1 1 auto;
}

/* ---- Badge ----------------------------------------------------------------*/

.dsw-badge {
	position: absolute;
	z-index: 2;
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	border-radius: 5px;
	background: #12121a;
	color: #fff;
	pointer-events: none;
}

.dsw-badge--top-left     { top: 10px; left: 10px; }
.dsw-badge--top-right    { top: 10px; right: 10px; }
.dsw-badge--bottom-left  { bottom: 10px; left: 10px; }
.dsw-badge--bottom-right { bottom: 10px; right: 10px; }

/* ---- Title (line-clamp) --------------------------------------------------*/

.dsw-card__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-decoration: none;
	line-clamp: var(--dsw-title-lines, 2);
	-webkit-line-clamp: var(--dsw-title-lines, 2);
}

.dsw-clamp-1 { --dsw-title-lines: 1; }
.dsw-clamp-2 { --dsw-title-lines: 2; }
.dsw-clamp-3 { --dsw-title-lines: 3; }
.dsw-clamp-4 { --dsw-title-lines: 4; }

/* ---- Rating (CSS-only star fill) ------------------------------------------*/

.dsw-card__rating {
	display: flex;
	align-items: center;
	gap: 6px;
}

.dsw-stars {
	position: relative;
	display: inline-block;
	line-height: 1;
	letter-spacing: 2px;
}

.dsw-stars__track,
.dsw-stars__fill {
	display: block;
	white-space: nowrap;
}

.dsw-stars__fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
}

/* ---- Description ---------------------------------------------------------*/

.dsw-card__desc {
	margin: 0;
	line-height: 1.5;
}

/* ---- Urgency ---------------------------------------------------------------*/

.dsw-card__urgency {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
}

/* ---- Variation pickers ----------------------------------------------------*/

.dsw-variations {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.dsw-variations__field {
	flex: 1 1 120px;
	min-width: 0;
}

.dsw-variations select {
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	padding: 9px 30px 9px 12px;
	font-size: 13px;
	border: 1px solid #dcdce2;
	border-radius: 6px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2370707B'%3E%3Cpath d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%2370707B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 16px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

/* ---- Price ------------------------------------------------------------------*/

.dsw-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
}

.dsw-price__regular {
	text-decoration: line-through;
	font-size: 0.85em;
}

.dsw-price__current {
	font-weight: 700;
}

.dsw-price__discount {
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.6;
}

.dsw-price__unavailable {
	font-size: 13px;
	opacity: 0.7;
}

/* ---- Button ------------------------------------------------------------------*/

.dsw-btn {
	display: block;
	width: 100%;
	margin-top: auto;
	border: none;
	text-align: center;
	text-decoration: none;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.dsw-btn:hover {
	transform: translateY(-1px);
}

.dsw-btn:disabled,
.dsw-btn--disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.dsw-btn--loading {
	opacity: 0.75;
	cursor: progress;
}

/* ---- Inline notice (ajax errors) ---------------------------------------------*/

.dsw-card__notice {
	margin: 0;
	font-size: 12.5px;
	font-weight: 600;
	color: #B3261E;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height 0.25s ease, opacity 0.25s ease, margin-top 0.25s ease;
}

.dsw-card__notice.is-visible {
	max-height: 60px;
	opacity: 1;
	margin-top: 2px;
}

/* ---- Reduced motion ---------------------------------------------------------*/

@media (prefers-reduced-motion: reduce) {
	.dsw-product-grid * {
		transition-duration: 0.01ms !important;
	}
}
