/*
Theme Name:   Dentmed
Theme URI:    https://dentmed.co.za/
Author:       Conference IT
Description:  Lightweight theme for Dentmed – dental instruments, materials and equipment. Works with the "Dentmed Catalogue & Quotes" plugin.
Version:      1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License:      GPL-2.0-or-later
Text Domain:  dentmed
*/

:root {
	--dm-blue: #1471b8;
	--dm-blue-dark: #0e5a94;
	--dm-red: #e6212a;
	--dm-ink: #14283c;
	--dm-muted: #5a6b7c;
	--dm-line: #dbe3ea;
	--dm-soft: #f3f7fb;
	--dm-navy: #0f2a44;
	--wrap: 1200px;
	--gutter: clamp(16px, 4vw, 32px);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--dm-ink);
	background: #fff; -webkit-font-smoothing: antialiased;
}
img, svg, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--dm-blue); }
a:hover { color: var(--dm-blue-dark); }
h1, h2, h3, h4 { line-height: 1.2; color: var(--dm-ink); }
:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link:focus {
	position: fixed; z-index: 100000; left: 8px; top: 8px; width: auto; height: auto; clip: auto; clip-path: none;
	margin: 0; padding: .8em 1.2em; background: #fff; color: var(--dm-ink); border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------------- top bar */
.topbar { background: var(--dm-navy); color: #d6e2ee; font-size: .875rem; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }
.topbar__inner { display: flex; justify-content: space-between; gap: 16px; padding-block: 8px; flex-wrap: wrap; }
.topbar__links { display: flex; gap: 20px; flex-wrap: wrap; }
@media (max-width: 760px) { .topbar__hours, .topbar__email { display: none; } .topbar__inner { justify-content: center; } }

/* ----------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--dm-line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.header-inner { display: flex; align-items: center; gap: 20px; padding-block: 8px; }
.brand { flex: none; line-height: 0; }
.custom-logo { height: 64px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.site-nav .menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav .menu > li { position: relative; }
.site-nav .menu a { display: block; padding: .6em .8em; color: var(--dm-ink); text-decoration: none; font-weight: 600; border-radius: 6px; }
.site-nav .menu a:hover, .site-nav .menu .current-menu-item > a, .site-nav .menu .current-menu-ancestor > a { color: var(--dm-blue); background: var(--dm-soft); }
.site-nav .menu .menu-item-has-children > a::after { content: ""; display: inline-block; margin-left: .45em; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.site-nav .sub-menu {
	position: absolute; left: 0; top: 100%; min-width: 220px; list-style: none; margin: 0; padding: 8px; background: #fff;
	border: 1px solid var(--dm-line); border-radius: 10px; box-shadow: 0 12px 30px rgba(20, 40, 60, .14);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.site-nav .menu li:hover > .sub-menu, .site-nav .menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub-menu a { font-weight: 500; }

.site-search { position: relative; display: flex; }
.site-search input[type="search"] {
	width: 190px; padding: .55em 2.4em .55em .8em; border: 1px solid #b9c6d2; border-radius: 8px; font: inherit; font-size: .95rem; background: #fff; color: var(--dm-ink);
}
.site-search button { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 2.2em; border: 0; background: transparent; color: var(--dm-muted); cursor: pointer; display: grid; place-items: center; }
.site-search button:hover { color: var(--dm-blue); }
.quote-cta { white-space: nowrap; }

.nav-toggle { display: none; margin-left: auto; width: 46px; height: 46px; border: 1px solid var(--dm-line); border-radius: 8px; background: #fff; cursor: pointer; place-items: center; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 22px; height: 2px; background: var(--dm-ink); content: ""; transition: transform .2s; }
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before { position: absolute; top: -7px; }
.nav-toggle__bars::after { position: absolute; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1000px) {
	.nav-toggle { display: grid; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 14px;
		margin: 0; padding: 14px var(--gutter) 20px; background: #fff; border-bottom: 1px solid var(--dm-line); box-shadow: 0 14px 24px rgba(20, 40, 60, .12);
		max-height: calc(100vh - 120px); overflow-y: auto;
	}
	.site-nav.is-open { display: flex; }
	.site-nav .menu { flex-direction: column; align-items: stretch; }
	.site-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; }
	.site-nav .menu .menu-item-has-children > a::after { display: none; }
	.site-search input[type="search"] { width: 100%; }
	.site-search { width: 100%; }
	.quote-cta { text-align: center; justify-content: center; }
}

/* ------------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #f6faff 0%, #e6f0fa 100%); }
.hero::before, .hero::after { content: ""; position: absolute; border: 14px solid; opacity: .12; pointer-events: none; }
.hero::before { width: 260px; height: 260px; left: -90px; bottom: -110px; border-color: var(--dm-blue); }
.hero::after { width: 220px; height: 220px; right: -70px; top: -90px; border-color: var(--dm-red); }
.hero__inner { position: relative; display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: clamp(20px, 4vw, 56px); padding-block: clamp(32px, 6vw, 72px); }
.eyebrow { margin: 0 0 .6rem; color: var(--dm-red); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.hero h1 { margin: 0 0 1rem; font-size: clamp(1.9rem, 4.2vw, 3rem); letter-spacing: -.02em; }
.hero__text { margin: 0 0 1.5rem; font-size: 1.1rem; color: #33495e; max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.hero__media img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
@media (max-width: 860px) { .hero__inner { grid-template-columns: 1fr; } .hero__media { order: -1; max-width: 520px; } }

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(36px, 6vw, 72px); }
.section--soft { background: var(--dm-soft); }
.section--navy { background: var(--dm-navy); color: #fff; padding-block: clamp(28px, 4vw, 44px); }
.section--navy h2 { color: #fff; margin: 0 0 .3rem; }
.section__title { margin: 0 0 1.4rem; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: .4rem; }
.section__head .section__title { margin-bottom: 0; }
.more-link { font-weight: 600; text-decoration: none; }
.more-link:hover { text-decoration: underline; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--dm-line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--dm-ink); transition: box-shadow .2s, transform .2s, border-color .2s; }
.tile:hover { box-shadow: 0 10px 26px rgba(20, 40, 60, .13); transform: translateY(-3px); border-color: var(--dm-blue); color: var(--dm-ink); }
.tile__media { display: grid; place-items: center; height: 190px; padding: 14px; background: #fff; overflow: hidden; }
.tile__media img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.tile__name { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--dm-line); font-weight: 700; text-align: center; background: var(--dm-soft); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.callout { padding: clamp(22px, 3vw, 34px); border-radius: 14px; color: #fff; }
.callout h2 { color: #fff; margin: 0 0 .5rem; }
.callout p { margin: 0 0 1.2rem; opacity: .95; }
.callout--blue { background: linear-gradient(135deg, var(--dm-blue), #0b4a7a); }
.callout--red { background: linear-gradient(135deg, #e6212a, #b4141c); }
.dm-btn--light { background: #fff; color: var(--dm-ink); }
.dm-btn--light:hover { background: #eaf3fb; color: var(--dm-ink); }
.dm-btn--outline-light { background: transparent; color: #fff; border-color: #fff; }
.dm-btn--outline-light:hover { background: #fff; color: var(--dm-ink); }
.contact-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.contact-strip p { margin: 0; }
.contact-strip__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- page body */
.page-wrap { padding-block: clamp(24px, 4vw, 48px); }
.page-title { margin: 0 0 1rem; font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -.01em; }
.lead { font-size: 1.15rem; color: var(--dm-muted); max-width: 46em; }
.entry-content { max-width: 52em; }
.entry-content h2 { margin-top: 1.8em; font-size: 1.4rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .35em; }
.entry-content .dm-two-col, .entry-content .dm-grid, .entry-content .dm-map, .entry-content .dm-form { max-width: none; }
.page-template-default .entry-content, .page .entry-content { max-width: 60em; }
.entry__title { margin: 0 0 .4rem; }
.entry { margin-bottom: 2rem; }

.crumbs { margin-bottom: 14px; font-size: .9rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin: 0 .55em; color: var(--dm-muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--dm-muted); }

/* --------------------------------------------------------------- catalogue */
.catalogue { display: grid; grid-template-columns: 250px 1fr; gap: 32px; align-items: start; margin-top: 8px; }
@media (max-width: 900px) { .catalogue { grid-template-columns: 1fr; gap: 14px; } }
.side-box { border: 1px solid var(--dm-line); border-radius: 12px; background: var(--dm-soft); padding: 4px 16px 14px; }
.side-box summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.cat-list, .cat-list ul { list-style: none; margin: 0; padding: 0; }
.cat-list ul { padding-left: 14px; border-left: 2px solid var(--dm-line); margin: 2px 0 6px 6px; }
.cat-list li { margin: 2px 0; }
.cat-list a { display: inline-block; padding: .2em 0; color: var(--dm-ink); text-decoration: none; }
.cat-list a:hover, .cat-list .current-cat > a, .cat-list .current-cat-parent > a { color: var(--dm-blue); font-weight: 600; }
.side-links { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--dm-line); }
.catalogue .dm-grid { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 14px; padding: 0; }
.pills a { display: inline-block; padding: .4em .9em; border: 1px solid var(--dm-line); border-radius: 999px; text-decoration: none; background: #fff; color: var(--dm-ink); font-size: .95rem; }
.pills a:hover { border-color: var(--dm-blue); color: var(--dm-blue); }
.pills span { color: var(--dm-muted); }

.navigation.pagination { margin: 28px 0 0; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-numbers { display: inline-block; min-width: 2.4em; padding: .45em .8em; border: 1px solid var(--dm-line); border-radius: 8px; text-align: center; text-decoration: none; color: var(--dm-ink); background: #fff; }
a.page-numbers:hover { border-color: var(--dm-blue); color: var(--dm-blue); }
.page-numbers.current { background: var(--dm-blue); border-color: var(--dm-blue); color: #fff; font-weight: 700; }

/* ---------------------------------------------------------- single product */
.product__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
@media (max-width: 800px) { .product__grid { grid-template-columns: 1fr; } }
.product__media { display: grid; place-items: center; min-height: 280px; padding: 20px; border: 1px solid var(--dm-line); border-radius: 14px; background: #fff; }
.product__media img { width: 100%; max-height: 520px; object-fit: contain; }
.product__title { margin: 0 0 .5rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.product__price { margin: 0 0 1rem; font-size: 1.6rem; }
.product__price small { display: block; font-size: .85rem; font-weight: 400; color: var(--dm-muted); }
.product__excerpt { color: #33495e; }
.product__buy { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 1.2rem 0; }
.product__help { color: var(--dm-muted); font-size: .95rem; }
.product__details { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--dm-line); }
.related { margin-top: 3rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 .6rem; }
.badge { display: inline-block; padding: .2em .7em; border-radius: 999px; font-size: .8rem; font-weight: 700; text-decoration: none; background: var(--dm-soft); color: var(--dm-blue); border: 1px solid var(--dm-line); }
.badge--specials { background: #fdecec; color: #b4141c; border-color: #f4b6b9; }
.badge--new { background: #eaf7ee; color: #166534; border-color: #a7dbb5; }

/* ------------------------------------------------------------------ footer */
.site-footer { margin-top: 0; background: #0b2036; color: #c4d3e2; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-block: 44px 28px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-title { margin: 0 0 .7rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: #fff; }
.footer-col p { margin: 0 0 .6em; }
.footer-logo { display: inline-block; padding: 8px 10px; background: #fff; border-radius: 10px; margin-bottom: 12px; line-height: 0; }
.footer-logo .custom-logo { height: 54px; }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu li { margin-bottom: .45em; }
.footer-menu a { text-decoration: none; }
.footer-menu a:hover, .site-footer a:hover { text-decoration: underline; }
.footer-social { display: flex; gap: 14px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); font-size: .875rem; }
.footer-bottom p { margin: 0; padding-block: 16px; }

@media print {
	.topbar, .site-header, .site-footer, .dm-toast, .dm-add-quote { display: none !important; }
}
