/* =========================================================================
   Sabeny — Product Loop Item styles
   Card, badge pills, qty stepper, Add button, magnifier, quick-look modal.
   Uses CSS custom properties so the brand teal can be retuned site-wide.
   ========================================================================= */

:root {
	--sbn-teal:        #0E6B6B;
	--sbn-teal-dark:   #0A5454;
	--sbn-green:       #10B981;
	--sbn-orange:      #F59E0B;
	--sbn-red:         #EF4444;
	--sbn-ink:         #0F172A;
	--sbn-mute:        #6B7280;
	--sbn-line:        #E5E7EB;
	--sbn-soft:        #F3F4F6;
	--sbn-radius:      16px;
	--sbn-radius-sm:   10px;
}

/* ----- Card -------------------------------------------------------------
   Equal-height cards: every Loop Grid item stretches to the row's height,
   the card itself becomes a column flex container, and the body grows to
   fill remaining space so the action row sticks to the bottom edge.
   ----------------------------------------------------------------------- */
.elementor-loop-container .e-loop-item,
.elementor-loop-container > .elementor-element { height: 100%; }

.sbncard {
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden; /* clip image/background to the card's rounded corners */
	transition: box-shadow .2s ease, transform .2s ease;
}
.sbncard:hover { box-shadow: 0 10px 30px rgba(15,23,42,.08); }

/* Media box: fixed pixel height — robust across Loop Grid widths.
   aspect-ratio gets overridden by Elementor's container flex sizing, so
   we lock height in pixels and forbid grow/shrink. Tweak --sbn-media-h
   to change the image area for the whole site in one place. */
:root { --sbn-media-h: 260px; }

/* High-specificity selector + !important on every sizing rule
   so Elementor's inline container styles can't override it. */
.sbncard > .sbncard__media,
.elementor .sbncard__media {
	position: relative !important;
	width: 100% !important;
	height: var(--sbn-media-h) !important;
	min-height: var(--sbn-media-h) !important;
	max-height: var(--sbn-media-h) !important;
	flex: 0 0 var(--sbn-media-h) !important;
	padding: 12px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	overflow: hidden !important;
	background: #fff !important;
}
.sbncard__media .elementor-widget-image,
.sbncard__media .elementor-widget-image > .elementor-widget-container,
.sbncard__media .elementor-widget-image a {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.sbncard__media img,
.sbncard__media .woocommerce-product-gallery__image img,
.sbncard__media a img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

/* Tablet / mobile — slightly shorter to keep cards balanced */
@media (max-width: 1024px) { :root { --sbn-media-h: 220px; } }
@media (max-width: 600px)  { :root { --sbn-media-h: 200px; } }

/* Body grows to fill, so action row sits at the bottom even when
   titles wrap onto two lines — guarantees aligned cards across the row. */
.sbncard__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}
.sbncard__body > .sbn-actions,
.sbncard__actions { margin-top: auto !important; }

/* Brand line — now an <a> linking to the category archive. */
.sbn-brand,
.sbncard__brand,
.sbncard__brand a {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	color: var(--sbn-teal);
	text-decoration: none;
}
.sbn-brand:hover { color: var(--sbn-teal-dark); text-decoration: underline; }

/* Title — keep wrapping to two lines, then clamp so cards don't drift. */
.sbncard__title a,
.sbncard__title {
	color: var(--sbn-ink);
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.6em; /* reserves two lines worth of space on every card */
	line-height: 1.3;
}
.sbncard__title a:hover { color: var(--sbn-teal); }

.sbncard__rating .star-rating,
.sbn-rating .star-rating { font-size: 14px; color: #F59E0B; }
.sbncard__rating .woocommerce-review-link,
.sbn-rating__count { color: var(--sbn-mute); font-size: 13px; margin-left: 4px; }
.sbn-rating { display: flex; align-items: center; gap: 4px; }
.sbn-rating--empty { min-height: 18px; }

.sbncard__price,
.sbn-price {
	color: var(--sbn-ink);
	font-size: 20px;
	font-weight: 700;
}
.sbn-price del { color: var(--sbn-mute); font-weight: 500; margin-right: 6px; font-size: 16px; }
.sbn-price ins { text-decoration: none; }

/* ----- Badge pill ------------------------------------------------------- */
.sbncard__badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
}
.sbn-pill {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	line-height: 1;
}
.sbn-pill--bestseller { background: var(--sbn-teal); }
.sbn-pill--fresh      { background: var(--sbn-green); }
.sbn-pill--popular    { background: var(--sbn-orange); }
.sbn-pill--new        { background: var(--sbn-red); }
.sbn-pill--sale       { background: var(--sbn-ink); }

/* ----- Action row: qty + Add + magnifier --------------------------------
   Tighter qty stepper + bigger Add by giving Add the 1fr column.
   Magnifier bumped to 44px square so the icon reads at a glance.
   ----------------------------------------------------------------------- */
.sbn-actions {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 6px;
	align-items: center;
	margin-top: 12px;
}

.sbn-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--sbn-line);
	border-radius: var(--sbn-radius-sm);
	overflow: hidden;
	background: #fff;
}
.sbn-qty__btn {
	width: 26px;
	height: 44px;
	border: 0;
	background: transparent;
	font-size: 16px;
	color: var(--sbn-ink);
	cursor: pointer;
	line-height: 1;
}
.sbn-qty__btn:hover { background: var(--sbn-soft); }
.sbn-qty__input {
	width: 28px;
	height: 44px;
	border: 0;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	background: transparent;
	-moz-appearance: textfield;
}
.sbn-qty__input::-webkit-outer-spin-button,
.sbn-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.sbn-add {
	height: 44px;
	border: 0;
	border-radius: var(--sbn-radius-sm);
	background: var(--sbn-teal);
	color: #fff;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	transition: background .15s ease;
	position: relative;
}
.sbn-add:hover { background: var(--sbn-teal-dark); }
.sbn-add[aria-busy="true"] .sbn-add__label { opacity: 0; }
.sbn-add__spinner {
	display: none;
	position: absolute;
	inset: 0;
	margin: auto;
	width: 16px; height: 16px;
	border: 2px solid rgba(255,255,255,.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sbnspin .8s linear infinite;
}
.sbn-add[aria-busy="true"] .sbn-add__spinner { display: block; }
@keyframes sbnspin { to { transform: rotate(360deg); } }

.sbn-add--added { background: var(--sbn-green); }

.sbn-quick {
	width: 44px;
	height: 44px;
	border: 1px solid var(--sbn-line);
	border-radius: var(--sbn-radius-sm);
	background: #fff;
	color: var(--sbn-teal);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.sbn-quick svg {
	width: 26px !important;
	height: 26px !important;
	stroke-width: 2.4;
	display: block;
}
.sbn-quick:hover { border-color: var(--sbn-teal); background: var(--sbn-teal); color: #fff; }

/* ----- Modal shell ------------------------------------------------------ */
.sbn-modal {
	position: fixed; inset: 0; z-index: 9999;
	display: flex; align-items: center; justify-content: center;
}
.sbn-modal[hidden] { display: none; }
.sbn-modal__backdrop {
	position: absolute; inset: 0;
	background: rgba(15,23,42,.55);
	animation: sbnfade .2s ease;
}
.sbn-modal__panel {
	position: relative;
	background: #fff;
	border-radius: var(--sbn-radius);
	width: min(880px, calc(100% - 32px));
	max-height: calc(100vh - 64px);
	overflow: auto;
	box-shadow: 0 25px 60px rgba(0,0,0,.25);
	animation: sbnpop .2s ease;
}
.sbn-modal__close {
	position: absolute; top: 12px; right: 12px;
	width: 36px; height: 36px;
	border: 0; background: transparent;
	font-size: 24px; cursor: pointer; color: var(--sbn-ink);
}
.sbn-modal__body { padding: 32px; }
@keyframes sbnfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sbnpop  { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ----- Quick-look layout ------------------------------------------------ */
.sbn-quicklook { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { .sbn-quicklook { grid-template-columns: 1fr; } }
.sbn-quicklook__media img { width: 100%; height: auto; border-radius: var(--sbn-radius-sm); }
.sbn-quicklook__title { margin: 8px 0 12px; font-size: 24px; color: var(--sbn-ink); }
.sbn-quicklook__price { font-size: 22px; font-weight: 700; color: var(--sbn-ink); margin-bottom: 16px; }
.sbn-quicklook__desc  { color: var(--sbn-mute); margin-bottom: 24px; }
.sbn-quicklook__more  {
	display: inline-block;
	color: var(--sbn-teal);
	font-weight: 600;
	text-decoration: none;
}
.sbn-quicklook__more:hover { color: var(--sbn-teal-dark); }

/* ============================================================
   Sabeny — Loop card mobile/tablet refinements
   ============================================================ */

/* Tablet & below (≤ 1024px): hide the magnifier — quick-look is
   a desktop-nice-to-have. Touch users tap the image/title instead. */
@media (max-width: 767px) {
	.sbn-quick { display: none !important; }

	/* Reclaim the column the magnifier was using */
	.sbn-actions {
		grid-template-columns: auto 1fr;
	}
}

/* Phones (≤ 600px): stack qty on top, Add full-width below.
   Add gets bigger and easier to thumb. */
@media (max-width: 600px) {
	.sbn-actions {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.sbn-qty {
		width: 100%;
		justify-content: space-between;
	}
	.sbn-qty__input {
		flex: 1 1 auto;
	}
	.sbn-add {
		width: 100%;
	}

	/* Tighter card padding so two-up cards don't crowd edges */
	.sbncard__body { padding: 14px !important; }
}