/*
 * Services Accordion Widget — services-accordion.css
 * Fully responsive. Zero horizontal overflow on any device.
 * ─────────────────────────────────────────────────────────────────────────── */

/* ── 1. Box-sizing reset scoped to widget ────────────────────────────────── */
/* Guarantees padding never bleeds outside element width on any device.       */
.saw-widget,
.saw-widget *,
.saw-widget *::before,
.saw-widget *::after {
	box-sizing: border-box;
}

/* ── 2. CSS design tokens ────────────────────────────────────────────────── */
.saw-widget {
	--saw-accent:  #f97316;
	--saw-navy:    #0f1f3d;
	--saw-border:  #e2e8f0;
	--saw-bg:      #f8fafc;
	--saw-text:    #1e293b;
	--saw-muted:   #64748b;
	--saw-white:   #ffffff;
	--saw-radius:  12px;
	--saw-shadow:  0 2px 16px 0 rgba(15,31,61,0.07);
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT — two-column grid on desktop, single column on mobile
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget.services-wrap {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
	align-items: start;
	/* Prevent the widget itself from ever pushing past its container */
	width: 100%;
	max-width: 100%;
	overflow: hidden; /* clip anything that slips through */
}

/* ════════════════════════════════════════════════════════════════════════════
   LEFT PANEL — services-image (desktop only)
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .services-image {
	width: 100%;
	min-width: 0; /* allow grid cell to shrink */
}

.saw-widget .services-image img,
.saw-widget .img-placeholder img {
	width: 100%;
	max-width: 100%;
	height: auto;
	display: block;
	object-fit: contain;
}

.saw-widget .img-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

/* ════════════════════════════════════════════════════════════════════════════
   ACCORDION LIST — right column
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .accordion-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	/* Critical: allow this grid cell to shrink to 0 if needed */
	min-width: 0;
	width: 100%;
}

/* ════════════════════════════════════════════════════════════════════════════
   ACCORDION ITEM — card wrapper
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .acc-item {
	background: var(--saw-white);
	border: 1px solid var(--saw-border);
	border-radius: var(--saw-radius);
	box-shadow: var(--saw-shadow);
	/* overflow:hidden clips inner content + animation; also prevents child overflow */
	overflow: hidden;
	transition: box-shadow .25s, border-color .25s;
	/* Ensure the card never escapes its column */
	width: 100%;
	min-width: 0;
}

.saw-widget .acc-item.is-open {
	border-color: var(--saw-navy);
	box-shadow: 0 4px 24px 0 rgba(15,31,61,0.13);
}

/* ════════════════════════════════════════════════════════════════════════════
   TRIGGER BUTTON — acc-trigger
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .acc-trigger {
	/* Reset browser button styles */
	-webkit-appearance: none;
	appearance: none;
	border: none;
	background: none;
	/* Full-width flex row */
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	/* min-width:0 lets it shrink inside the card */
	min-width: 0;
	padding: 20px 22px;
	text-align: left;
	cursor: pointer;
	color: var(--saw-text);
	font-family: inherit;
	/* Prevent the button from creating overflow */
	overflow: hidden;
	transition: background .2s, color .2s;
	outline: none;
}

.saw-widget .acc-trigger:hover,
.saw-widget .acc-trigger:focus {
	background: var(--saw-navy);
	color: var(--saw-white);
}

.saw-widget .acc-item.is-open .acc-trigger {
	background: var(--saw-navy);
	color: var(--saw-white);
}

.saw-widget .acc-trigger:focus-visible {
	outline: 2px solid var(--saw-accent);
	outline-offset: -2px;
}

/* ════════════════════════════════════════════════════════════════════════════
   ICON BOX — acc-icon
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .acc-icon {
	flex-shrink: 0; /* never shrink the icon */
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: rgba(249,115,22,.10);
	transition: background .2s;
}

.saw-widget .acc-trigger:hover .acc-icon,
.saw-widget .acc-trigger:focus .acc-icon {
	background: rgba(255,255,255,.12);
}

.saw-widget .acc-item.is-open .acc-icon {
	background: rgba(255,255,255,.12);
}

.saw-widget .acc-icon i {
	font-size: 20px;
	line-height: 1;
	color: var(--saw-accent);
	transition: color .2s;
}

.saw-widget .acc-icon svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--saw-accent);
	transition: stroke .2s;
}

/* Hover / active icon color */
.saw-widget .acc-trigger:hover .acc-icon i,
.saw-widget .acc-trigger:focus .acc-icon i,
.saw-widget .acc-item.is-open .acc-icon i {
	color: var(--saw-white);
}

.saw-widget .acc-trigger:hover .acc-icon svg,
.saw-widget .acc-trigger:focus .acc-icon svg,
.saw-widget .acc-item.is-open .acc-icon svg {
	stroke: var(--saw-white);
}

/* ════════════════════════════════════════════════════════════════════════════
   TITLE — acc-label
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .acc-label {
	flex: 1;           /* fill remaining trigger width */
	min-width: 0;      /* CRITICAL — allows text to shrink & wrap; without this
	                      the label pushes the button wider than the screen */
	font-size: clamp(15px, 3.5vw, 22px);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
	transition: color .2s;
	font-family: inherit;
	/* Prevent a long single word from blowing out the layout */
	word-break: break-word;
	overflow-wrap: break-word;
}

/* ════════════════════════════════════════════════════════════════════════════
   CHEVRON — acc-chevron
   Rotation is CSS-only; JS only toggles .is-open on .acc-item
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .acc-chevron {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	min-width: 20px; /* don't let it collapse on narrow screens */
	stroke: var(--saw-muted);
	fill: none;
	transition: transform .3s cubic-bezier(.4,0,.2,1), stroke .2s;
}

.saw-widget .acc-trigger:hover .acc-chevron,
.saw-widget .acc-trigger:focus .acc-chevron {
	stroke: rgba(255,255,255,.7);
}

.saw-widget .acc-item.is-open .acc-chevron {
	transform: rotate(180deg);
	stroke: rgba(255,255,255,.7);
}

/* ════════════════════════════════════════════════════════════════════════════
   ACCORDION BODY — grid-template-rows animation
   CRITICAL: do NOT change to height animation — original requirement.
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .acc-body {
	display: grid;
	grid-template-rows: 0fr;
	/* Duration overridden by Elementor animation_speed selector */
	transition: grid-template-rows .32s cubic-bezier(.4,0,.2,1);
}

.saw-widget .acc-item.is-open .acc-body {
	grid-template-rows: 1fr;
}

.saw-widget .acc-body-inner {
	overflow: hidden;
	/* Also prevents child content from escaping during animation */
	min-width: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   CONTENT AREA — acc-content
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .acc-content {
	padding: 20px 22px 24px;
	border-top: 1px solid var(--saw-border);
	/* Prevent any child (image, table, pre, etc.) from leaking outside */
	overflow: hidden;
	width: 100%;
	min-width: 0;
}

/* All direct children fill the content width */
.saw-widget .acc-inner-content {
	width: 100%;
	min-width: 0;
}

/* Defensive: any image anywhere inside the accordion never exceeds the card */
.saw-widget .acc-content img,
.saw-widget .acc-inner-content img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE IMAGE — .mobile-img
   Always hidden on desktop. Full-width on mobile.
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .mobile-img {
	display: none; /* hidden on desktop unconditionally */
}

/* ════════════════════════════════════════════════════════════════════════════
   SUB-GRID — original sub-items design (inside WYSIWYG content)
   ════════════════════════════════════════════════════════════════════════════ */
.saw-widget .sub-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 24px;
	width: 100%;
}

.saw-widget .sub-item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 400;
	color: #363636;
	padding: 4px 0;
	min-width: 0;
	word-break: break-word;
}

.saw-widget .sub-item::before {
	content: '';
	display: block;
	flex-shrink: 0;
	width: 22px;
	height: 2px;
	background: var(--saw-accent);
	border-radius: 2px;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Tablet: tighten trigger padding slightly ── */
@media (max-width: 1024px) {
	.saw-widget .acc-trigger {
		padding: 18px 18px;
		gap: 12px;
	}
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {

	/* Stack to single column */
	.saw-widget.services-wrap {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	/* Hide desktop left-image panel */
	.saw-widget .services-image {
		display: none;
	}

	/* Show mobile image inside content, full-width */
	.saw-widget .mobile-img {
		display: block;
		width: 100%;
		margin-bottom: 16px;
	}

	.saw-widget .mobile-img img {
		width: 100%;
		max-width: 100%;
		height: auto;
		display: block;
		border-radius: 8px;
	}

	/* Tighter trigger padding on phones */
	.saw-widget .acc-trigger {
		padding: 16px 16px;
		gap: 10px;
	}

	/* Slightly smaller title on phones */
	.saw-widget .acc-label {
		font-size: clamp(14px, 4vw, 18px);
	}

	/* Tighter content padding */
	.saw-widget .acc-content {
		padding: 16px 16px 20px;
	}

	/* Sub-grid single column on phones */
	.saw-widget .sub-grid {
		grid-template-columns: 1fr;
	}

	/* Slightly smaller icon box on phones */
	.saw-widget .acc-icon {
		width: 32px;
		height: 32px;
	}

	.saw-widget .acc-icon i  { font-size: 17px; }
	.saw-widget .acc-icon svg { width: 17px; height: 17px; }
}

/* ── Very small phones (≤ 380px) ── */
@media (max-width: 380px) {

	.saw-widget .acc-trigger {
		padding: 14px 12px;
		gap: 8px;
	}

	.saw-widget .acc-label {
		font-size: 14px;
	}

	.saw-widget .acc-content {
		padding: 14px 12px 18px;
	}

	.saw-widget .acc-icon {
		width: 28px;
		height: 28px;
	}

	.saw-widget .acc-icon i   { font-size: 15px; }
	.saw-widget .acc-icon svg { width: 15px; height: 15px; }

	.saw-widget .acc-chevron {
		width: 16px;
		height: 16px;
		min-width: 16px;
	}
}

/* ════════════════════════════════════════════════════════════════════════════
   ELEMENTOR EDITOR HELPERS
   ════════════════════════════════════════════════════════════════════════════ */

/* Keep left panel visible in editor even at mobile canvas widths */
.elementor-editor-active .saw-widget .services-image {
	display: block !important;
	opacity: .7;
}
