/* ==========================================================================
   8xbet Theme – main stylesheet
   Colors come from Customizer → CSS variables (see inc/helpers.php)
   ========================================================================== */

:root {
	--xbt-primary: #491D77;
	--xbt-heading: #4B1C83;
	--xbt-accent: #8B5CF6;
	--xbt-text: #4A4A4A;
	--xbt-link: #7C3AED;
	--xbt-logo-w: 110px;
	--xbt-container: 1100px;
	--xbt-content: 820px;
	--xbt-radius: 8px;
	--xbt-font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: #fff;
	color: var(--xbt-text);
	font-family: var(--xbt-font);
	font-size: 15px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--xbt-link); text-decoration: none; transition: color .2s, background-color .2s, opacity .2s; }
a:hover { color: var(--xbt-heading); }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--xbt-font);
	color: var(--xbt-heading);
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 .6em;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
button { font-family: inherit; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important;
	width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; left: 8px; top: 8px; z-index: 100000;
	background: #fff; color: var(--xbt-heading); padding: 10px 16px; border-radius: 4px;
}

.xbt-container { width: 100%; max-width: var(--xbt-container); margin: 0 auto; padding: 0 16px; }
.xbt-content-col { width: 100%; max-width: var(--xbt-content); margin: 0 auto; padding: 0 16px; }

/* ---------- Buttons ---------- */
.xbt-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 38px; padding: 8px 20px;
	border-radius: 4px; font-size: 14px; font-weight: 500; line-height: 1.2;
	color: #fff; white-space: nowrap;
}
.xbt-btn:hover { color: #fff; opacity: .9; }
.xbt-btn-1 { background: var(--xbt-heading); }
.xbt-btn-2 { background: var(--xbt-accent); }

/* ---------- Header ---------- */
.xbt-header { position: relative; z-index: 999; background: #fff; }
.xbt-sticky-header .xbt-header { position: sticky; top: 0; }
.admin-bar.xbt-sticky-header .xbt-header { top: 32px; }
.xbt-header.is-scrolled { box-shadow: 0 4px 18px rgba(30, 10, 60, .12); }

.xbt-header-top { background: #fff; }
.xbt-header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.xbt-brand { display: flex; align-items: center; }
.xbt-brand .custom-logo-link { display: inline-flex; }
.xbt-brand img, .xbt-brand .custom-logo { width: var(--xbt-logo-w); height: auto; max-height: 60px; object-fit: contain; }
.xbt-header-actions { display: flex; align-items: center; gap: 10px; }

.xbt-nav { background: var(--xbt-primary); }
.xbt-nav .xbt-container { display: flex; justify-content: center; }
.xbt-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.xbt-menu li { position: relative; }
.xbt-menu > li > a {
	display: block; padding: 14px 18px;
	color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; line-height: 1.3;
}
.xbt-menu > li > a:hover,
.xbt-menu > li.current-menu-item > a,
.xbt-menu > li.current_page_item > a,
.xbt-menu > li.current-menu-ancestor > a { background: rgba(255, 255, 255, .12); color: #fff; }

.xbt-menu .sub-menu {
	list-style: none; margin: 0; padding: 6px 0; position: absolute; left: 0; top: 100%; min-width: 220px;
	background: #fff; border-radius: 0 0 6px 6px; box-shadow: 0 10px 30px rgba(30, 10, 60, .18);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .2s; z-index: 10;
}
.xbt-menu li:hover > .sub-menu,
.xbt-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.xbt-menu .sub-menu a { display: block; padding: 9px 18px; color: var(--xbt-text); font-size: 14px; }
.xbt-menu .sub-menu a:hover { color: var(--xbt-heading); background: #f6f2fd; }
.xbt-submenu-toggle { display: none; }

.xbt-nav-buttons { display: none; }

.xbt-burger {
	display: none; width: 42px; height: 38px; padding: 9px 9px; border: 0; border-radius: 4px;
	background: var(--xbt-primary); cursor: pointer; flex-direction: column; justify-content: space-between;
}
.xbt-burger span:not(.screen-reader-text) { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; transition: transform .25s, opacity .25s; }
.xbt-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(8px) rotate(45deg); }
.xbt-burger[aria-expanded="true"] span:nth-child(3) { opacity: 0; }
.xbt-burger[aria-expanded="true"] span:nth-child(4) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Content ---------- */
.site-main { display: block; }
.xbt-article { padding: 24px 0 50px; }
.xbt-hero { margin-bottom: 22px; }
.xbt-hero img { width: 100%; border-radius: var(--xbt-radius); box-shadow: 0 4px 16px rgba(17, 24, 64, .18); }

.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { margin-top: 1.5em; }
.entry-content h3 { margin-top: 1.2em; }
.entry-content figure { margin: 0 0 1.2em; }
.entry-content figure img, .entry-content > p > img { border-radius: var(--xbt-radius); box-shadow: 0 4px 16px rgba(17, 24, 64, .18); width: 100%; }

.entry-content ul, .entry-content ol,
.elementor-widget-text-editor ul, .elementor-widget-text-editor ol { margin: 0 0 1em; padding-left: 22px; }
.entry-content li, .elementor-widget-text-editor li { margin-bottom: .45em; }
.elementor-widget-text-editor p:last-child,
.elementor-widget-text-editor ul:last-child,
.elementor-widget-text-editor ol:last-child,
.elementor-widget-text-editor table:last-child { margin-bottom: 0; }
.elementor-widget-text-editor a { color: var(--xbt-link); }
.elementor-widget-text-editor a:hover { text-decoration: underline; }

/* Tables (used in the demo content: "Cashback theo từng sảnh") */
.xbt-table, .entry-content table, .elementor-widget-text-editor table {
	width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 14px; line-height: 1.5;
	border-radius: 6px; overflow: hidden;
}
.xbt-table th, .entry-content table th, .elementor-widget-text-editor table th {
	background: var(--xbt-primary); color: #fff; font-weight: 700; text-align: left; padding: 12px 16px;
}
.xbt-table td, .entry-content table td, .elementor-widget-text-editor table td {
	padding: 11px 16px; border-bottom: 1px solid #ececf2; color: var(--xbt-text);
}
.xbt-table th + th, .xbt-table td + td,
.elementor-widget-text-editor table td + td, .elementor-widget-text-editor table th + th { border-left: 1px solid rgba(0, 0, 0, .06); }
.xbt-table tbody tr:nth-child(even) td,
.entry-content table tbody tr:nth-child(even) td,
.elementor-widget-text-editor table tbody tr:nth-child(even) td { background: #f5f5f9; }

.xbt-meta { font-size: 13px; color: #888; margin-bottom: 1.2em; }

/* Blog cards */
.xbt-archive { padding: 30px 16px 50px; }
.xbt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.xbt-card { background: #fff; border: 1px solid #eee; border-radius: var(--xbt-radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.xbt-card:hover { box-shadow: 0 10px 30px rgba(30, 10, 60, .12); transform: translateY(-2px); }
.xbt-card-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.xbt-card-body { padding: 16px 18px 20px; }
.xbt-card-title { font-size: 17px; margin: 0 0 .3em; }
.xbt-card-title a { color: var(--xbt-heading); }
.xbt-card-excerpt { font-size: 14px; }
.nav-links { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.page-numbers { display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 4px; background: #f3effa; color: var(--xbt-heading); padding: 0 10px; }
.page-numbers.current { background: var(--xbt-primary); color: #fff; }
.post-navigation .nav-links { justify-content: space-between; }

.xbt-404 { padding: 60px 16px; text-align: center; }
.xbt-404 h1 { font-size: 72px; }

.search-form { display: flex; gap: 8px; max-width: 420px; margin: 20px auto 0; }
.search-form label { flex: 1; }
.search-field, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px; font: inherit;
}
.search-submit, .comment-form .submit { background: var(--xbt-primary); color: #fff; border: 0; border-radius: 4px; padding: 10px 18px; cursor: pointer; font: inherit; }

/* ---------- Footer ---------- */
.xbt-footer { background: var(--xbt-primary); color: rgba(255, 255, 255, .86); font-size: 13px; line-height: 1.7; }
.xbt-footer a { color: rgba(255, 255, 255, .86); }
.xbt-footer a:hover { color: #fff; }
.xbt-footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding-top: 42px; padding-bottom: 34px; }
.xbt-footer-title { color: #fff; font-size: 14px; font-weight: 700; margin: 0 0 14px; }
.xbt-footer-logo { display: inline-block; margin-bottom: 12px; }
.xbt-footer-logo img { width: var(--xbt-logo-w); height: auto; }
.xbt-footer-text p { margin: 0 0 .6em; }
.xbt-footer-text a { color: #b99aff; }
.xbt-footer-links { list-style: none; margin: 0; padding: 0; }
.xbt-footer-links li { margin: 0 0 8px; }
.xbt-footer-links a { position: relative; padding-left: 14px; display: inline-block; }
.xbt-footer-links a::before { content: "›"; position: absolute; left: 0; top: -1px; font-size: 15px; line-height: inherit; }
.xbt-footer-widgets { padding-bottom: 24px; }
.xbt-hint a { color: #ffd54f; text-decoration: underline; }

.xbt-footer-bar { border-top: 1px solid rgba(255, 255, 255, .12); }
.xbt-footer-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding-top: 10px; padding-bottom: 10px; }
.xbt-copyright { font-size: 12.5px; }
.xbt-social { display: flex; gap: 8px; }
.xbt-social a {
	width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	background: rgba(255, 255, 255, .12);
}
.xbt-social a:hover { background: var(--xbt-accent); }
.xbt-social svg { width: 15px; height: 15px; fill: #fff; }

/* Back to top */
.xbt-totop {
	position: fixed; right: 20px; bottom: 22px; z-index: 998; width: 42px; height: 42px; border-radius: 50%;
	border: 0; background: var(--xbt-accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
	box-shadow: 0 6px 18px rgba(139, 92, 246, .45); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s;
}
.xbt-totop.is-visible { opacity: 1; visibility: visible; transform: none; }
.xbt-totop svg { width: 22px; height: 22px; fill: #fff; }
body.xbt-float-on .xbt-totop { bottom: 110px; }

/* Floating bottom banner */
.xbt-float-banner {
	position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 997;
	width: calc(100% - 20px); max-width: 700px; line-height: 0;
}
.xbt-float-banner a { display: block; }
.xbt-float-banner img { width: 100%; border-radius: 6px 6px 0 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, .2); }
.xbt-float-close {
	position: absolute; top: -10px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
	background: #222; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.xbt-float-banner.is-hidden { display: none; }
body.xbt-float-on { padding-bottom: 92px; }

/* ---------- Elementor helpers ---------- */
.xbt-elementor-main { overflow: hidden; }
.elementor-widget-image img { width: 100%; }
.elementor-page .elementor-widget-heading .elementor-heading-title a { color: inherit; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.xbt-footer-grid { grid-template-columns: 1fr 1fr; }
	.xbt-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
	.xbt-burger { display: flex; }
	.xbt-header-inner { min-height: 62px; }
	.xbt-nav { display: none; }
	.xbt-nav.is-open { display: block; max-height: calc(100vh - 62px); overflow-y: auto; }
	.xbt-nav .xbt-container { display: block; padding: 0; }
	.xbt-menu { flex-direction: column; }
	.xbt-menu > li > a { padding: 13px 20px; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: 13.5px; }
	.xbt-menu .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border-radius: 0;
		background: rgba(0, 0, 0, .15); display: none; padding: 0;
	}
	.xbt-menu li.is-open > .sub-menu { display: block; }
	.xbt-menu .sub-menu a { color: #fff; padding: 11px 32px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
	.xbt-menu .sub-menu a:hover { background: transparent; color: #fff; }
	.xbt-submenu-toggle {
		display: block; position: absolute; right: 0; top: 0; width: 48px; height: 46px; border: 0; background: transparent; color: #fff;
		font-size: 18px; cursor: pointer;
	}
	.xbt-menu li.is-open > .xbt-submenu-toggle { transform: rotate(180deg); }
	.xbt-sticky-header .xbt-header { position: sticky; }
}

@media (max-width: 782px) {
	.admin-bar.xbt-sticky-header .xbt-header { top: 46px; }
}

@media (max-width: 600px) {
	h1 { font-size: 23px; }
	h2 { font-size: 19px; }
	h3 { font-size: 16px; }
	:root { --xbt-logo-w: 90px; }
	.xbt-header-actions { gap: 6px; }
	.xbt-btn { min-height: 34px; padding: 7px 12px; font-size: 13px; }
	.xbt-footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 20px; padding-top: 32px; }
	.xbt-footer-about { grid-column: 1 / -1; }
	.xbt-footer-bar-inner { flex-direction: column; justify-content: center; text-align: center; }
	.xbt-grid { grid-template-columns: 1fr; }
	.xbt-table th, .xbt-table td,
	.elementor-widget-text-editor table th, .elementor-widget-text-editor table td { padding: 10px 10px; }
	body.xbt-float-on { padding-bottom: 60px; }
	body.xbt-float-on .xbt-totop { bottom: 72px; right: 12px; }
}

@media (max-width: 359px) {
	.xbt-header-actions .xbt-btn { display: none; }
	.xbt-nav.is-open .xbt-nav-buttons { display: flex; gap: 10px; padding: 14px 20px; }
	.xbt-nav-buttons .xbt-btn { flex: 1; }
	.xbt-nav-buttons .xbt-btn-1 { border: 1px solid rgba(255, 255, 255, .35); }
}
