/* =========================================================
   Sailors Factory - Feature Cards
   ========================================================= */

.sf-cards-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	align-items: stretch; /* makes every card in a row equal height */
	gap: 24px;
	width: 100%;
}

.sf-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start; /* overridden by Content Alignment control */
	background: #ffffff;
	border-radius: 16px;
	padding: 24px 20px;
	box-sizing: border-box;
	overflow: hidden;
	height: 100%; /* stretches to match tallest card in the row */
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sf-card.sf-hover-lift:hover {
	transform: translateY(-6px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* -------- Badges (multiple, grouped by corner) -------- */
.sf-badge-stack {
	position: absolute;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sf-badge-stack.sf-badge-top-left {
	top: 14px;
	left: 14px;
	align-items: flex-start;
}

.sf-badge-stack.sf-badge-top-right {
	top: 14px;
	right: 14px;
	align-items: flex-end;
}

.sf-badge-stack.sf-badge-bottom-left {
	bottom: 14px;
	left: 14px;
	align-items: flex-start;
}

.sf-badge-stack.sf-badge-bottom-right {
	bottom: 14px;
	right: 14px;
	align-items: flex-end;
}

.sf-card-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	padding: 6px 12px;
	border-radius: 20px;
	white-space: nowrap;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.sf-badge-icon {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
}

/* -------- Image -------- */
.sf-card-image {
	width: 100%;
	margin: -24px -20px 16px -20px;
	overflow: hidden;
}

.sf-card-image img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
}

/* -------- Icon + shape behind it -------- */
.sf-card-icon-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-bottom: 16px;
	padding: 16px;
	box-sizing: border-box;
	line-height: 0;
}

.sf-card-icon-wrap.sf-shape-circle {
	border-radius: 50%;
}

.sf-card-icon-wrap.sf-shape-rounded {
	border-radius: 18px;
}

.sf-card-icon-wrap.sf-shape-square {
	border-radius: 4px;
}

.sf-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.sf-card-icon i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	font-size: 40px;
}

.sf-card-icon svg {
	display: block;
	width: 40px;
	height: 40px;
}

/* -------- Title / Description -------- */
.sf-card-title {
	margin: 0 0 8px 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
	width: 100%;
}

.sf-card-desc {
	flex-grow: 1; /* pushes actions to the bottom, grows with content length */
	width: 100%;
	margin-bottom: 16px;
	font-size: 14px;
	line-height: 1.6;
}

.sf-card-desc p {
	margin: 0 0 8px 0;
}

.sf-card-desc p:last-child {
	margin-bottom: 0;
}

/* -------- Actions row (main button + info button) -------- */
.sf-card-actions {
	width: 100%;
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin-top: auto;
}

.sf-card-btn {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* -------- Info (i) button + tooltip -------- */
.sf-info-wrap {
	position: relative;
	flex: 1 1 0; /* equal width to the main button by default; overridden by "Info Button Width" control */
	width: 100%;
	display: inline-flex;
}

.sf-info-btn {
	width: 100%;
	height: 100%;
	min-height: 48px;
	border-radius: 8px;
	border: none;
	background: #eaf2f8;
	color: #0b3d5c;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: transform 0.15s ease;
}

.sf-info-btn:hover {
	transform: scale(1.08);
}

.sf-info-tooltip {
	position: absolute;
	bottom: calc(100% + 10px);
	right: 0;
	width: 220px;
	max-width: 60vw;
	background: #0b1f33;
	color: #fff;
	font-size: 12.5px;
	line-height: 1.5;
	padding: 10px 12px;
	border-radius: 10px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	z-index: 30;
	text-align: left;
}

.sf-info-wrap:hover .sf-info-tooltip,
.sf-info-wrap.sf-info-active .sf-info-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* -------- "More Info" popover: a true center-screen modal (same on every device) -------- */
.sf-popover-trigger {
	margin-top: 10px;
	width: 100%;
	background: transparent;
	border: none;
	color: #0b3d5c;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 6px 0;
}

.sf-popover-caret {
	font-size: 10px;
	transition: transform 0.2s ease;
}

.sf-card {
	overflow: visible !important; /* guards against theme/global CSS forcing overflow:hidden on cards */
}

/* Backdrop is a single shared element injected into <body> by script.js */
.sf-popover-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(11, 31, 51, 0.55);
	z-index: 99998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sf-popover-backdrop.sf-popover-backdrop-active {
	opacity: 1;
	visibility: visible;
}

body.sf-popover-open {
	overflow: hidden;
}

.sf-popover-box {
	position: fixed;
	top: 50%;
	left: 50%;
	width: min(420px, 90vw);
	max-height: 80vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 16px;
	padding: 24px 22px;
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(0.95);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 99999;
	text-align: left;
}

.sf-popover-box.sf-popover-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(-50%, -50%) scale(1);
}

.sf-popover-box h4 {
	margin: 0 24px 10px 0;
	font-size: 18px;
	font-weight: 600;
}

.sf-popover-box p {
	margin: 0 0 18px 0;
	font-size: 14px;
	line-height: 1.65;
}

.sf-popover-cta {
	display: inline-block;
	text-decoration: none;
	font-weight: 600;
	font-size: 13.5px;
	padding: 10px 20px;
	border-radius: 8px;
}

.sf-popover-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: none;
	background: #f2f5f8;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #5b6b7a;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* -------- Responsive fallback (in case builder-level responsive controls
   aren't applied, e.g. shortcode usage outside Elementor) -------- */
@media (max-width: 1024px) {
	.sf-cards-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.sf-cards-grid {
		grid-template-columns: repeat(1, 1fr);
	}
	.sf-card {
		grid-column: span 1 !important; /* column-span cards always collapse to 1 col on mobile */
	}
	.sf-card-image img {
		height: 160px;
	}
	.sf-popover-box {
		width: 92vw;
	}
}
