/*
 * Bainland Buttons - v1.1.1
 * Card grid with optional per-card carousel.
 *
 * Alignment uses Elementor's prefix_class output:
 *   .bbtn-align-left | .bbtn-align-center | .bbtn-align-right | .bbtn-align-stretch
 *   .bbtn-align-tablet-* and .bbtn-align-mobile-* for responsive overrides
 */

/* ===== Grid ===== */
.bbtn-grid {
	display: grid;
	gap: 24px;
	width: 100%;
	box-sizing: border-box;
	opacity: 1 !important;
	filter: none !important;
}
.bbtn-grid.bbtn-cols-1 { grid-template-columns: 1fr; }
.bbtn-grid.bbtn-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bbtn-grid.bbtn-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bbtn-grid.bbtn-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
	.bbtn-grid.bbtn-cols-3,
	.bbtn-grid.bbtn-cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 640px) {
	.bbtn-grid {
		grid-template-columns: 1fr !important;
		gap: 18px;
	}
}

/* ===== Card ===== */
.bbtn-card {
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* Square / pointed corners */
.bbtn-grid.bbtn-corner-square .bbtn-card,
.bbtn-grid.bbtn-corner-square .bbtn-card__media,
.bbtn-grid.bbtn-corner-square .bbtn-card__btn {
	border-radius: 0 !important;
}

/* ===== Media (image / carousel) ===== */
.bbtn-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: linear-gradient(135deg, #f0f0f0, #fafafa);
}

.bbtn-car__track {
	position: relative;
	width: 100%;
	height: 100%;
}

.bbtn-car__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}
.bbtn-car__slide.is-active {
	opacity: 1;
	pointer-events: auto;
}
.bbtn-card__media:not(.bbtn-card__media--carousel) .bbtn-car__slide {
	position: static;
	opacity: 1;
	pointer-events: auto;
}

.bbtn-car__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bbtn-car__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	border: 0;
	border-radius: 999px;
	width: 34px;
	height: 34px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
	z-index: 2;
	padding: 0;
	transition: background 0.15s ease;
}
.bbtn-car__btn:hover,
.bbtn-car__btn:focus {
	background: rgba(0, 0, 0, 0.65);
	outline: none;
}
.bbtn-car__prev { left: 10px; }
.bbtn-car__next { right: 10px; }

.bbtn-car__dots {
	position: absolute;
	bottom: 10px;
	left: 0;
	right: 0;
	display: flex;
	gap: 6px;
	justify-content: center;
	z-index: 2;
}
.bbtn-car__dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	border: 0;
	background: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease, transform 0.15s ease;
}
.bbtn-car__dot.is-active {
	background: #fff;
	transform: scale(1.15);
}

/* ===== Body ===== */
.bbtn-card__body {
	padding: 16px 16px 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}
.bbtn-card__title {
	margin: 0 0 8px;
	font-family: "Optima", "Optima Nova", "Linux Biolinum", "URW Classico", Candara, Calibri, "Segoe UI", "Trebuchet MS", sans-serif;
	font-size: 22px;
	line-height: 1.15;
	font-weight: 600;
	color: #1a1a1a;
}
.bbtn-card__desc {
	margin: 0 0 16px;
	font-family: "Optima", "Optima Nova", "Linux Biolinum", "URW Classico", Candara, Calibri, "Segoe UI", "Trebuchet MS", sans-serif;
	font-size: 14.5px;
	line-height: 1.5;
	color: rgba(0, 0, 0, 0.65);
}

/* ===== CTA wrapper ===== */
.bbtn-card__cta {
	margin-top: auto;
	display: block;        /* text-align governs alignment */
	padding-top: 4px;
	width: 100%;
}

/* ===== Button base ===== */
.bbtn-card .bbtn-card__btn,
.bbtn-card a.bbtn-card__btn,
.bbtn-card a.bbtn-card__btn:link,
.bbtn-card a.bbtn-card__btn:visited {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 10px;
	background-color: #696a4b;
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
	border: 0;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.05s ease, filter 0.15s ease;
	opacity: 1 !important;            /* defeat theme link opacity */
	filter: none !important;           /* defeat theme filter (grayscale/blur/etc) */
	mix-blend-mode: normal !important; /* defeat blend modes */
	background-image: none !important; /* defeat theme link gradients */
	box-shadow: none;
	box-sizing: border-box;
	-webkit-text-fill-color: #fff;     /* Safari gradient text fix */
	text-shadow: none;
}
.bbtn-card .bbtn-card__btn:hover,
.bbtn-card .bbtn-card__btn:focus,
.bbtn-card a.bbtn-card__btn:hover,
.bbtn-card a.bbtn-card__btn:focus {
	background-color: #55563e;
	color: #fff;
	text-decoration: none;
	opacity: 1 !important;
	filter: none !important;
	outline: none;
	background-image: none !important;
	-webkit-text-fill-color: #fff;
}
.bbtn-card__btn[data-btn-override]:hover,
.bbtn-card__btn[data-btn-override]:focus {
	filter: brightness(0.88) !important;
}
.bbtn-card__btn:active {
	transform: translateY(1px);
}
.bbtn-card__btn--disabled {
	opacity: 0.6 !important;
	cursor: default;
	pointer-events: none;
}

/* ===== Alignment (driven by prefix_class on widget wrapper) ===== */
.bbtn-align-left   .bbtn-card__cta { text-align: left; }
.bbtn-align-center .bbtn-card__cta { text-align: center; }
.bbtn-align-right  .bbtn-card__cta { text-align: right; }
.bbtn-align-stretch .bbtn-card__cta { text-align: center; }
.bbtn-align-stretch .bbtn-card__cta .bbtn-card__btn {
	display: block;
	width: 100%;
}

/* Tablet overrides */
@media (max-width: 1024px) {
	.bbtn-align-tablet-left   .bbtn-card__cta { text-align: left; }
	.bbtn-align-tablet-center .bbtn-card__cta { text-align: center; }
	.bbtn-align-tablet-right  .bbtn-card__cta { text-align: right; }
	.bbtn-align-tablet-stretch .bbtn-card__cta { text-align: center; }
	.bbtn-align-tablet-stretch .bbtn-card__cta .bbtn-card__btn { display: block; width: 100%; }
}

/* Mobile overrides */
@media (max-width: 640px) {
	.bbtn-align-mobile-left   .bbtn-card__cta { text-align: left; }
	.bbtn-align-mobile-center .bbtn-card__cta { text-align: center; }
	.bbtn-align-mobile-right  .bbtn-card__cta { text-align: right; }
	.bbtn-align-mobile-stretch .bbtn-card__cta { text-align: center; }
	.bbtn-align-mobile-stretch .bbtn-card__cta .bbtn-card__btn { display: block; width: 100%; }
}
