/* =========================================================
   Hanout Page Builder — Classic Flat Front-end
   Scoped under .hanout-page, RTL-first
   ========================================================= */

.hanout-page {
	--hanout-border: #e6e9ec;
	--hanout-text: #2b2f33;
	--hanout-muted: #7a8288;
	direction: rtl !important;
	text-align: right;
	unicode-bidi: isolate;
	font-family: inherit;
	line-height: 1.6;
	color: var(--hanout-text);
	max-width: 1180px;
	margin: 0 auto;
	padding: 24px 20px 60px;
}

.hanout-page,
.hanout-page * { box-sizing: border-box; }

.hanout-page ul,
.hanout-page ol { list-style: none; margin: 0; padding: 0; }
.hanout-page a { text-decoration: none; transition: color 0.2s ease; }
.hanout-page button,
.hanout-page input,
.hanout-page select,
.hanout-page textarea { font: inherit; color: inherit; }
.hanout-page h1, .hanout-page h2, .hanout-page h3, .hanout-page p { margin: 0; }

.hanout-wrap { display: flex; flex-direction: row; gap: 34px; align-items: flex-start; }
.hanout-main { flex: 1 1 65%; min-width: 0; text-align: right; }
.hanout-sidebar { flex: 0 0 300px; position: sticky; top: 20px; text-align: right; }

.hanout-sidebar-right .hanout-main { order: 2 !important; }
.hanout-sidebar-right .hanout-sidebar { order: 1 !important; }
.hanout-sidebar-left .hanout-main { order: 1 !important; }
.hanout-sidebar-left .hanout-sidebar { order: 2 !important; }

.hanout-title { font-size: 28px; font-weight: 700 !important; margin: 0 0 8px !important; color: var(--hanout-text) !important; }
.hanout-subtitle { color: var(--hanout-muted) !important; font-size: 16px; margin: 0 0 20px !important; }

.hanout-featured-image { border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.hanout-featured-image img { width: 100%; height: auto; display: block; max-width: 100%; }

.hanout-content { line-height: 1.9; font-size: 15.5px; }
.hanout-content h2, .hanout-content h3 { margin-top: 28px !important; font-weight: 700; }
.hanout-content p { margin-bottom: 14px !important; }
.hanout-content a { color: var(--hanout-primary, #158379) !important; text-decoration: underline; }
.hanout-content mark { background: color-mix(in srgb, var(--hanout-primary, #158379) 25%, transparent); padding: 0 4px; border-radius: 3px; }
.hanout-content ul, .hanout-content ol { list-style: disc; padding-right: 22px !important; margin-bottom: 14px !important; }
.hanout-content ul { list-style-type: disc; }

.hanout-section-title { font-size: 21px; font-weight: 700 !important; margin: 46px 0 20px !important; position: relative; padding-right: 14px; color: var(--hanout-text) !important; }
.hanout-section-title::before { content: ""; position: absolute; right: 0; top: 4px; bottom: 4px; width: 4px; background: var(--hanout-primary, #158379) !important; border-radius: 3px; }

.hanout-features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.hanout-feature-card { border: 1px solid var(--hanout-border); border-radius: 8px; padding: 18px; background: #fafbfc; }
.hanout-feature-card h3 { font-size: 16px; margin: 0 0 8px !important; }
.hanout-feature-card p { font-size: 14px; color: var(--hanout-muted); margin: 0 !important; line-height: 1.8; }

/* ---------- Custom Dynamic Buy Box ---------- */
.hanout-buybox {
	border: none;
	border-radius: 8px;
	padding: 24px;
	/* Uses admin color, falls back to #f4f8f9 */
	background: var(--hanout-buybox-bg, #f4f8f9);
	box-shadow: none;
	position: relative;
}

.hanout-offers-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.hanout-offer-row { display: flex; align-items: center; gap: 12px; border: none !important; border-radius: 0; padding: 10px 0; cursor: pointer; position: relative; background: transparent !important; box-shadow: none !important; transform: none !important; }
.hanout-offer-row:hover { transform: none; }

.hanout-offer-radio { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; }
.hanout-offer-radio input[type="radio"] { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border: 2px solid var(--hanout-primary, #158379); border-radius: 50%; margin: 0; cursor: pointer; position: relative; background: transparent; transition: background-color 0.2s; }
.hanout-offer-row.is-checked .hanout-offer-radio input[type="radio"] { background-color: var(--hanout-primary, #158379); }
.hanout-offer-row.is-checked .hanout-offer-radio input[type="radio"]::after { content: '✔'; position: absolute; color: white; font-size: 13px; top: 50%; left: 50%; transform: translate(-50%, -50%); }

.hanout-offer-name { flex: 1; font-size: 15px; font-weight: 500; color: #555; }

/* Uses admin price color, falls back to primary */
.hanout-offer-price { 
	font-weight: 800; 
	font-size: 19px; 
	color: var(--hanout-price-color, var(--hanout-primary, #158379)) !important; 
	white-space: nowrap; 
}
.hanout-offer-badge { display: none; }

/* ---------- Buttons ---------- */
.hanout-btn { display: block; width: 100%; text-align: center; padding: 14px 20px; border-radius: 4px; font-weight: 600 !important; font-size: 15px; text-decoration: none !important; border: none; cursor: pointer; transition: all 0.2s ease; box-shadow: none !important; transform: none !important; }
.hanout-btn-primary { background: var(--hanout-primary, #158379) !important; color: #fff !important; }
.hanout-btn-primary:hover, .hanout-btn-primary:focus { filter: brightness(0.92); color: #fff !important; }
.hanout-btn-outline { background: #fff !important; color: var(--hanout-primary, #158379) !important; border: 1px solid var(--hanout-primary, #158379) !important; margin-top: 10px; }
.hanout-btn-outline:hover { background: #fafafa !important; }

/* ---------- Perks ---------- */
.hanout-perks { margin: 24px auto 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 12px; width: fit-content; }
.hanout-perks li { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; color: #555; }
.hanout-check { color: var(--hanout-primary, #158379) !important; font-size: 15px; background: transparent; width: auto; height: auto; display: inline-block; }

/* ---------- Info List (Values next to Titles) ---------- */
.hanout-info-list {
	margin: 20px 0 0 !important;
	padding: 20px !important;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	background: #ffffff;
	font-size: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.hanout-info-list li { 
	display: flex !important; 
	justify-content: flex-start !important; /* Pushes value directly next to the title */
	align-items: baseline; 
	gap: 6px !important; /* Small space between title and value */
	flex-wrap: wrap; 
}
.hanout-info-label { color: var(--hanout-primary, #158379); font-weight: 600; flex: 0 0 auto; }
.hanout-info-value, .hanout-info-list a { font-weight: 500; color: #555 !important; flex: 0 1 auto; }
.hanout-info-list a { text-decoration: underline !important; text-underline-offset: 3px; }

/* ---------- Reviews & FAQ ---------- */
.hanout-reviews-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hanout-review-card { border: 1px solid var(--hanout-border); border-radius: 8px; padding: 16px; background: #fafbfc; }
.hanout-stars { color: #f5a623 !important; margin-bottom: 8px; letter-spacing: 2px; }
.hanout-review-text { font-size: 13.5px; line-height: 1.8; margin: 0 0 10px !important; color: var(--hanout-text); }
.hanout-review-author { font-size: 13px; font-weight: 700; color: var(--hanout-muted); }
.hanout-faq-list { display: flex; flex-direction: column; gap: 10px; }
.hanout-faq-item { border: 1px solid var(--hanout-border); border-radius: 8px; padding: 14px 16px; background: #fff; }
.hanout-faq-item summary { cursor: pointer; font-weight: 700 !important; font-size: 15px; list-style: none; color: var(--hanout-text); display: flex; align-items: center; gap: 8px; }
.hanout-faq-item summary::-webkit-details-marker { display: none; }
.hanout-faq-item summary::before { content: "+"; color: var(--hanout-primary, #158379) !important; font-weight: 900; }
.hanout-faq-item[open] summary::before { content: "\2013"; }
.hanout-faq-item div { margin-top: 10px !important; font-size: 14px; line-height: 1.8; color: var(--hanout-muted); }
.hanout-faq-item div p { margin-bottom: 10px !important; }

/* ---------- Mobile Sticky Buy Bar (Hidden by default, triggered by JS) ---------- */
.hanout-mobile-sticky-bar {
	display: none; /* Blocked strictly for desktop */
}

@media (max-width: 700px) {
	.hanout-wrap { flex-direction: column; }
	.hanout-sidebar { position: static; width: 100%; }
	.hanout-features-grid { grid-template-columns: 1fr; }
	.hanout-reviews-grid { grid-template-columns: 1fr; }
	
	/* Mobile settings */
	.hanout-mobile-sticky-bar {
		display: flex;
		flex-direction: column;
		gap: 8px;
		position: fixed;
		bottom: 0; right: 0; left: 0;
		z-index: 99999;
		background: #fff;
		border-top: 1px solid var(--hanout-border);
		box-shadow: 0 -4px 16px rgba(0,0,0,.1);
		padding: 10px 14px;
		direction: rtl;
		
		/* Animation out by default */
		transform: translateY(120%);
		visibility: hidden;
		transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s ease;
	}
	
	/* Toggled via IntersectionObserver in frontend.js */
	.hanout-mobile-sticky-bar.is-visible {
		transform: translateY(0);
		visibility: visible;
	}
	
	.hanout-mobile-sticky-row { display: flex; align-items: center; gap: 10px; }
	.hanout-mobile-sticky-price { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
	.hanout-mobile-sticky-value { font-size: 17px; font-weight: 800; color: var(--hanout-price-color, var(--hanout-primary, #158379)) !important; white-space: nowrap; }
	.hanout-mobile-sticky-btn { flex: 1; margin: 0 !important; padding: 12px 10px !important; }
	.hanout-mobile-sticky-extra-row .hanout-btn { flex: 1; margin: 0 !important; padding: 11px 10px !important; font-size: 14px; }
	.hanout-btn-whatsapp { background: #25D366 !important; color: #fff !important; }
	.hanout-btn-whatsapp:hover { color: #fff !important; filter: brightness(0.95); }
	.hanout-mobile-sticky-extra-row .hanout-btn-outline { margin-top: 0 !important; }
	
	.hanout-page { padding-bottom: 100px; }
}

@media (min-width: 701px) and (max-width: 900px) {
	.hanout-features-grid { grid-template-columns: repeat(2, 1fr); }
	.hanout-reviews-grid { grid-template-columns: repeat(2, 1fr); }
}