/*
Theme Name: Boma
Theme URI: https://boma.ee
Author: Meietarbed OÜ
Description: Boma kohandatud WordPress teema — autovaruosade B2C/B2B platvormile. Ehitatud koos meieosad_core pluginaga, WooCommerce'iga ühilduv.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: boma
*/

/* ==========================================
   1. DISAINITOKENID
   ========================================== */
:root {
	/* Boma brändivärvid */
	--bomale-ink: #0f172a;
	--bomale-paper: #f5f7f3;
	--bomale-surface: #ffffff;
	--bomale-steel: #5b6b6f;
	--bomale-steel-soft: #7c8b8e;
	--bomale-border: #e1e6e0;
	--bomale-accent: #0e9f6e;
	--bomale-accent-strong: #087f58;
	--bomale-accent-soft: #e4f5ee;
	--bomale-amber: #d97300;
	--bomale-amber-soft: #fdf1e2;
	--bomale-radius: 10px;
	--bomale-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);

	/* Blocksy-ühilduvuse muutujad: meieosad_core plugin kasutab neid kümnetes
	   kohtades (kalender.php, pakkumised.php, seaded.php, hooldusraamat.php,
	   b2b-*.php, otsing.php) nupu- ja aktsendivärvidena. Kuna teema pole enam
	   Blocksy, defineerime need ise samade nimedega, et plugina UI jääks
	   ühtlaseks ilma pluginat puutumata. */
	--theme-palette-color-1: var(--bomale-accent);
	--theme-palette-color-2: var(--bomale-amber);
}

@media (prefers-color-scheme: dark) {
	:root {
		--bomale-ink: #eef2ef;
		--bomale-paper: #0c131d;
		--bomale-surface: #141e2c;
		--bomale-steel: #93a3ac;
		--bomale-steel-soft: #718392;
		--bomale-border: #223040;
		--bomale-accent: #34d399;
		--bomale-accent-strong: #6ee7b7;
		--bomale-accent-soft: #12291f;
		--bomale-amber: #fbbf24;
		--bomale-amber-soft: #2a2010;
		--bomale-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px -12px rgba(0, 0, 0, 0.55);
	}
}

/* ==========================================
   2. RESET JA PÕHITÜPOGRAAFIA
   ========================================== */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bomale-paper);
	color: var(--bomale-ink);
	font-family: 'Poppins', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	line-height: 1.6;
	overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
	font-family: 'Poppins', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	font-weight: 600;
	text-wrap: balance;
	color: var(--bomale-ink);
	margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }
a { color: var(--bomale-accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--bomale-accent); outline-offset: 2px; }

.bomale-wrap {
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 24px;
}
/* Laiem konteiner tabelirohketele lehtedele (vt template-lai.php) —
   nt varuosade otsingutabel, et vältida tarbetut kerimist. */
.bomale-wrap.bomale-wrap-wide {
	max-width: 1600px;
}

/* ==========================================
   3. PÄIS
   ========================================== */
.bomale-header {
	background: var(--bomale-surface);
	border-bottom: 1px solid var(--bomale-border);
}
.bomale-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 18px 0;
}
.bomale-logo {
	font-weight: 700;
	font-size: 1.3rem;
	color: var(--bomale-ink);
	display: flex;
	align-items: baseline;
	gap: 6px;
}
.bomale-logo img { max-height: 40px; display: block; }
.bomale-logo .dot { color: var(--bomale-accent); }

.bomale-nav ul {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 26px;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}
.bomale-nav a {
	color: var(--bomale-ink);
	font-weight: 500;
	font-size: 0.95rem;
}
.bomale-nav a:hover { color: var(--bomale-accent-strong); text-decoration: none; }

.bomale-header-actions { display: flex; align-items: center; gap: 14px; }
.bomale-header-actions a {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--bomale-ink);
}
.bomale-btn-account {
	background: var(--bomale-ink);
	color: var(--bomale-paper) !important;
	padding: 9px 16px;
	border-radius: 8px;
	text-decoration: none !important;
}

.bomale-menu-toggle {
	display: none;
	background: none;
	border: 1px solid var(--bomale-border);
	border-radius: 8px;
	padding: 8px 10px;
	cursor: pointer;
}
.bomale-menu-toggle span,
.bomale-menu-toggle span::before,
.bomale-menu-toggle span::after {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--bomale-ink);
	position: relative;
	content: '';
}
.bomale-menu-toggle span::before { top: -6px; }
.bomale-menu-toggle span::after { top: 4px; }

@media (max-width: 860px) {
	.bomale-menu-toggle { display: block; }
	.bomale-nav { display: none; width: 100%; order: 3; }
	.bomale-nav.is-open { display: block; }
	.bomale-nav ul { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px 0; }
	.bomale-header-inner { flex-wrap: wrap; }
}

/* Otsinguriba (toko_globaalne_otsinguriba plugina kaudu, blocksy:header:after hook) */
.toko-global-search { font-family: 'Poppins', sans-serif; }

/* ==========================================
   4. JALUS
   ========================================== */
.bomale-footer {
	background: var(--bomale-ink);
	color: #cbd5e1;
	margin-top: 60px;
}
.bomale-footer-inner {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 32px;
	padding: 50px 0 30px;
}
.bomale-footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; }
.bomale-footer p { color: #94a3b8; font-size: 0.9rem; }
.bomale-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bomale-footer a { color: #cbd5e1; font-size: 0.9rem; }
.bomale-footer a:hover { color: #fff; }
.bomale-footer-bottom {
	border-top: 1px solid rgba(255,255,255,0.08);
	padding: 18px 0;
	font-size: 0.8rem;
	color: #64748b;
}
@media (max-width: 780px) {
	.bomale-footer-inner { grid-template-columns: 1fr; }
}

/* ==========================================
   5. NUPUD JA VORMID
   ========================================== */
.bomale-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 0.95rem;
	padding: 13px 24px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	text-decoration: none !important;
	transition: transform 0.12s ease, opacity 0.12s ease;
}
.bomale-btn-primary { background: var(--bomale-accent); color: #fff !important; }
.bomale-btn-dark { background: var(--bomale-ink); color: var(--bomale-paper) !important; }
.bomale-btn-ghost { background: transparent; color: var(--bomale-ink) !important; border: 1px solid var(--bomale-border); }
.bomale-btn:hover { opacity: 0.9; }
.bomale-btn:active { transform: scale(0.98); }

/* WooCommerce'i standardnupud brändi järgi */
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit {
	background: var(--bomale-accent) !important;
	color: #fff !important;
	border-radius: 8px !important;
	font-family: 'Poppins', sans-serif !important;
	font-weight: 600 !important;
	border: none !important;
}
.woocommerce a.button:hover, .woocommerce button.button:hover {
	background: var(--bomale-accent-strong) !important;
}

/* ==========================================
   6. WOOCOMMERCE — MINU KONTO
   ========================================== */
.woocommerce-account .bomale-wrap { padding-top: 40px; padding-bottom: 60px; }
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; }
.woocommerce-MyAccount-navigation li { border-bottom: 1px solid var(--bomale-border); }
.woocommerce-MyAccount-navigation li a { display: block; padding: 12px 4px; color: var(--bomale-ink); font-weight: 500; }
.woocommerce-MyAccount-navigation li.is-active a { color: var(--bomale-accent-strong); font-weight: 700; }
.woocommerce-MyAccount-content { font-family: 'Poppins', sans-serif; }

/* ==========================================
   7. AVALEHT — HERO JA CTA-d
   ========================================== */
.bomale-hero {
	padding: 64px 0 56px;
	border-bottom: 1px solid var(--bomale-border);
}
.bomale-hero-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--bomale-accent-strong);
	margin-bottom: 14px;
}
.bomale-hero h1 {
	font-size: clamp(2rem, 4vw, 2.9rem);
	max-width: 18ch;
	letter-spacing: -0.01em;
}
.bomale-hero-lede {
	max-width: 60ch;
	font-size: 1.08rem;
	color: var(--bomale-steel);
	margin-top: 16px;
}
.bomale-cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 30px;
}

/**
 * Avalehe otsinguriba stiil on nüüd inline front-page.php sees (täpne
 * koopia meieosad_core plugina omast), seega siin eraldi CSS-i vaja
 * pole — vt front-page.php.
 */

.bomale-audience-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 18px;
	padding: 48px 0;
}
.bomale-audience-card {
	background: var(--bomale-surface);
	border: 1px solid var(--bomale-border);
	border-radius: 14px;
	padding: 26px;
	box-shadow: var(--bomale-shadow);
}
.bomale-audience-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.bomale-audience-card p { color: var(--bomale-steel); font-size: 0.92rem; margin-bottom: 16px; }
.bomale-audience-card a { font-weight: 600; }

@media (max-width: 860px) {
	.bomale-audience-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   8. GENEERILINE LEHT (page.php)
   ========================================== */
.bomale-page-content {
	padding: 46px 0 60px;
}
.bomale-page-content .page-title {
	font-size: 2rem;
	margin-bottom: 24px;
}

/* ==========================================
   9. HINNAKIRI (template-hinnakiri.php)
   ========================================== */
.bomale-pricing-masthead { padding: 46px 0 34px; border-bottom: 1px solid var(--bomale-border); }
.bomale-pricing-masthead h1 { font-size: clamp(2rem, 4vw, 2.7rem); max-width: 16ch; }
.bomale-pricing-lede { max-width: 62ch; font-size: 1.02rem; color: var(--bomale-steel); margin-top: 14px; }

.bomale-billing-toggle {
	margin-top: 26px;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	background: var(--bomale-surface);
	border: 1px solid var(--bomale-border);
	border-radius: 999px;
	padding: 4px;
	box-shadow: var(--bomale-shadow);
}
.bomale-billing-toggle button {
	font-family: 'Poppins', sans-serif;
	font-size: 0.86rem;
	font-weight: 600;
	color: var(--bomale-steel);
	background: transparent;
	border: none;
	padding: 9px 18px;
	border-radius: 999px;
	cursor: pointer;
}
.bomale-billing-toggle button.is-active { background: var(--bomale-accent); color: #fff; }
.bomale-billing-toggle .save-tag { font-size: 0.72rem; font-weight: 700; margin-left: 2px; opacity: 0.85; }

.bomale-pricing-section { padding: 50px 0; border-bottom: 1px solid var(--bomale-border); }
.bomale-pricing-section:last-of-type { border-bottom: none; }
.bomale-section-head { margin-bottom: 26px; max-width: 60ch; }
.bomale-section-head h2 { font-size: 1.5rem; }
.bomale-section-head p { color: var(--bomale-steel); font-size: 0.92rem; margin-top: 6px; }

.bomale-fn-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 14px;
}
.bomale-fn-card {
	background: var(--bomale-surface);
	border: 1px solid var(--bomale-border);
	border-radius: var(--bomale-radius);
	padding: 18px 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-shadow: var(--bomale-shadow);
}
.bomale-fn-card .fn-top { display: flex; align-items: center; gap: 10px; color: var(--bomale-accent-strong); }
.bomale-fn-card.is-b2b .fn-top { color: var(--bomale-amber); }
.bomale-fn-card .fn-name { font-weight: 600; font-size: 0.98rem; color: var(--bomale-ink); }
.bomale-fn-card .fn-desc { font-size: 0.84rem; color: var(--bomale-steel); flex-grow: 1; margin: 0; }
.bomale-fn-card .fn-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--bomale-border); }
.bomale-fn-price { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.bomale-fn-price .unit { font-size: 0.68rem; font-weight: 600; color: var(--bomale-steel); margin-left: 2px; }
.bomale-fn-price.is-free { color: var(--bomale-accent-strong); }

.bomale-chip {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--bomale-accent-soft);
	color: var(--bomale-accent-strong);
	white-space: nowrap;
}
.bomale-chip.is-amber { background: var(--bomale-amber-soft); color: var(--bomale-amber); }
.bomale-chip.is-free { background: var(--bomale-border); color: var(--bomale-steel); }
.bomale-fn-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.bomale-pkg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 18px;
}
.bomale-pkg-card {
	background: var(--bomale-surface);
	border: 1px solid var(--bomale-border);
	border-radius: 14px;
	padding: 26px 24px 24px;
	display: flex;
	flex-direction: column;
	box-shadow: var(--bomale-shadow);
	position: relative;
}
.bomale-pkg-card.is-featured { border-color: var(--bomale-accent); box-shadow: 0 0 0 1px var(--bomale-accent), var(--bomale-shadow); }
.bomale-pkg-flag {
	position: absolute; top: -12px; left: 24px;
	background: var(--bomale-accent); color: #fff;
	font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
	padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
}
.bomale-pkg-audience { font-size: 0.75rem; color: var(--bomale-steel); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 6px; }
.bomale-pkg-name { font-size: 1.35rem; margin-bottom: 14px; }
.bomale-pkg-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.bomale-pkg-price { font-weight: 700; font-size: 2.4rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.bomale-pkg-price-unit { color: var(--bomale-steel); font-size: 0.92rem; font-weight: 600; }
.bomale-pkg-alt-billing { font-size: 0.78rem; color: var(--bomale-steel); margin-bottom: 8px; min-height: 1.2em; }
.bomale-pkg-save { font-size: 0.78rem; color: var(--bomale-accent-strong); font-weight: 700; margin-bottom: 18px; }
.bomale-pkg-list { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 9px; flex-grow: 1; }
.bomale-pkg-list li { display: flex; gap: 9px; font-size: 0.88rem; align-items: flex-start; }
.bomale-pkg-list li svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--bomale-accent-strong); }
.bomale-pkg-note { font-size: 0.76rem; color: var(--bomale-steel-soft); margin-bottom: 16px; }

.bomale-foot-notes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-top: 30px;
}
.bomale-foot-note { font-size: 0.82rem; color: var(--bomale-steel); border-left: 2px solid var(--bomale-border); padding-left: 14px; }
.bomale-foot-note strong { color: var(--bomale-ink); display: block; margin-bottom: 3px; font-size: 0.85rem; }

@media (max-width: 780px) {
	.bomale-pkg-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   10. KÜPSISTE RIBA JA EELISTUSTE MODAAL
   ========================================== */
.boma-cookie-banner {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 99999;
	background: var(--bomale-surface);
	border-top: 1px solid var(--bomale-border);
	box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, 0.18);
	padding: 18px 0;
}
.boma-cookie-inner {
	max-width: 1120px; margin: 0 auto; padding: 0 24px;
	display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.boma-cookie-text { margin: 0; font-size: 0.88rem; color: var(--bomale-steel); max-width: 62ch; }
.boma-cookie-text a { color: var(--bomale-accent-strong); font-weight: 600; }
.boma-cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.boma-cookie-actions .bomale-btn, .boma-cookie-modal-actions .bomale-btn { padding: 10px 16px; font-size: 0.86rem; }

.boma-cookie-backdrop {
	position: fixed; inset: 0; z-index: 99997;
	background: rgba(15, 23, 42, 0.5);
}
html.boma-cookie-lock,
html.boma-cookie-lock body {
	overflow: hidden !important;
	height: 100%;
}

.boma-cookie-modal {
	position: fixed; inset: 0; z-index: 100000;
	background: rgba(15, 23, 42, 0.55);
	display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* [hidden] peab võitma eelneva display:flex reegli — muidu jääb aken
   nähtavaks ka pärast seda, kui JS on hidden atribuudi lisanud. */
.boma-cookie-modal[hidden] {
	display: none;
}
.boma-cookie-modal-inner {
	position: relative;
	background: var(--bomale-surface); border-radius: 14px; padding: 30px;
	max-width: 480px; width: 100%; box-shadow: var(--bomale-shadow);
}
.boma-cookie-modal-inner h3 { margin-bottom: 18px; }
.boma-cookie-close {
	position: absolute; top: 14px; right: 14px;
	width: 30px; height: 30px; border-radius: 8px;
	background: transparent; border: none; cursor: pointer;
	font-size: 1.4rem; line-height: 1; color: var(--bomale-steel);
}
.boma-cookie-close:hover { background: var(--bomale-border); color: var(--bomale-ink); }
.boma-cookie-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--bomale-border); }
.boma-cookie-row:first-of-type { border-top: none; }
.boma-cookie-row strong { display: block; font-size: 0.92rem; margin-bottom: 3px; }
.boma-cookie-row p { margin: 0; font-size: 0.82rem; color: var(--bomale-steel); }

.boma-cookie-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.boma-cookie-switch input { opacity: 0; width: 0; height: 0; }
.boma-cookie-switch span { position: absolute; inset: 0; background: var(--bomale-border); border-radius: 999px; transition: background 0.15s ease; }
.boma-cookie-switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.15s ease; }
.boma-cookie-switch input:checked + span { background: var(--bomale-accent); }
.boma-cookie-switch input:checked + span::before { transform: translateX(18px); }
.boma-cookie-switch input:disabled + span { opacity: 0.6; }

.boma-cookie-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 640px) {
	.boma-cookie-inner { flex-direction: column; align-items: stretch; }
	.boma-cookie-actions { justify-content: stretch; }
	.boma-cookie-actions .bomale-btn { flex: 1; }
}
