/**
 * RTM Font Preview — Single Product Builder widgets.
 * Styling for the Glyphs Set, Font Details and Add to Cart widgets.
 */

/* ── Glyphs Set ─────────────────────────────────────────────────────────── */
.rtm-gx { width: 100%; }
.rtm-gx-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 8px;
	margin-bottom: 30px;
}
.rtm-gx-filter {
	font-size: 12px;
	line-height: 1;
	padding: 8px 13px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	color: #555;
	cursor: pointer;
	transition: all .15s ease;
}
.rtm-gx-filter:hover { border-color: #999; color: #111; }
.rtm-gx-filter.is-active { background: #111; border-color: #111; color: #fff; }

.rtm-gx-sec { margin-bottom: 28px; }
.rtm-gx-sec[hidden] { display: none; }
.rtm-gx-sec__label {
	margin: 0 0 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #999;
}
.rtm-gx-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 8px;
	width: 100%;
}
.rtm-gx-cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	min-height: 68px;
	padding: 10px 6px;
	border: 1px solid #eee;
	border-radius: 8px;
	background: #fff;
	transition: background-color .15s ease, border-color .15s ease;
}
.rtm-gx-cell:hover { background: #f6f6f6; border-color: #ddd; }
.rtm-gx-char {
	font-family: var(--rtm-gx-family), system-ui, sans-serif;
	font-size: 28px;
	line-height: 1;
	color: #111;
}
.rtm-gx-cell__code {
	font-size: 10px;
	letter-spacing: .03em;
	color: #999;
	font-variant-numeric: tabular-nums;
}

/* ── Font Details ───────────────────────────────────────────────────────── */
.rtm-fd { width: 100%; }
.rtm-fd-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid #ececec;
}
.rtm-fd--stacked .rtm-fd-row { flex-direction: column; gap: 4px; }
.rtm-fd-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #999;
	white-space: nowrap;
}
.rtm-fd-value { font-size: 15px; color: #111; text-align: right; }
.rtm-fd--stacked .rtm-fd-value { text-align: left; }
.rtm-fd-desc {
	margin-top: 18px;
	font-size: 15px;
	line-height: 1.6;
	color: #555;
}
.rtm-fd-desc :is(h3,h4) { margin: 1em 0 .4em; color: #111; }
.rtm-fd-desc p { margin: 0 0 .8em; }

/* ── Add to Cart ────────────────────────────────────────────────────────── */
.rtm-atc { display: flex; flex-direction: column; }
.rtm-buy-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 22px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: #fff;
	background: #111;
	border: 1px solid transparent;
	border-radius: 10px;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.rtm-buy-btn:hover { background: #333; }

/* Offcanvas */
.rtm-atc-oc {
	position: fixed;
	inset: 0;
	z-index: 99999;
	visibility: hidden;
	pointer-events: none;
}
.rtm-atc-oc.is-open { visibility: visible; pointer-events: auto; }
/* v1.7.0: backdrop sits BELOW the panel. Previously both were absolute with no
   z-index and the backdrop (rendered after the panel) painted on top, eating
   every click inside the panel. The panel now always wins the stacking order. */
.rtm-atc-oc__bd {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(0,0,0,.45);
	opacity: 0;
	transition: opacity .3s ease;
	cursor: pointer;
}
.rtm-atc-oc.is-open .rtm-atc-oc__bd { opacity: 1; }
.rtm-atc-oc__inner {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	height: 100%;
	width: min(460px, 92vw);
	display: flex;
	flex-direction: column;
	background: #fff;
	box-shadow: -8px 0 40px rgba(0,0,0,.18);
	transform: translateX(100%);
	transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.rtm-atc-oc.is-open .rtm-atc-oc__inner { transform: translateX(0); }
.rtm-atc-oc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid #eee;
	background: #f7f7f7;
}
.rtm-atc-oc__title { font-size: 15px; font-weight: 700; color: #111; }
.rtm-atc-close {
	display: inline-flex;
	padding: 6px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	color: #666;
	cursor: pointer;
	transition: all .15s ease;
}
.rtm-atc-close:hover { color: #111; border-color: #111; }
.rtm-atc-oc__body { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px; }

.rtm-atc-rows { display: flex; flex-direction: column; gap: 10px; }
.rtm-atc-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 14px;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}
.rtm-atc-row:hover { border-color: #bbb; }
.rtm-atc-row.is-active { border-color: #111; background: #fafafa; }
.rtm-atc-row input { accent-color: #111; }
.rtm-atc-row__name { flex: 1 1 auto; font-size: 14px; font-weight: 600; color: #111; }
.rtm-atc-row__price { font-size: 14px; color: #111; }

.rtm-atc-total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 18px;
	padding: 14px 16px;
	border-radius: 10px;
	background: #f5f5f5;
	font-weight: 700;
}
.rtm-atc-total__price { font-size: 18px; }
.rtm-atc-simple { font-size: 20px; font-weight: 700; color: #111; }

.rtm-atc-notice { margin: 14px 0 0; font-size: 13px; }
.rtm-atc-notice.is-error { color: #b91c1c; }
.rtm-atc-notice.is-ok { color: #166534; }
.rtm-atc-btn,
.rtm-atc-gotocart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: 14px;
	padding: 14px 20px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: #111;
	border: 1px solid transparent;
	border-radius: 10px;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s ease;
}
.rtm-atc-btn:hover,
.rtm-atc-gotocart:hover { background: #333; }
.rtm-atc-btn[disabled] { opacity: .6; cursor: default; }


.rtm-gx-filter__count, .rtm-gx-sec__count { font-variant-numeric: tabular-nums; opacity: .6; margin-left: 6px; font-weight: 600; }

/* ── v1.7.0: Font Details — optional container + leading icons ───────────── */
.rtm-fd-icon { display: inline-flex; align-items: center; margin-right: var(--rtm-fd-icon-gap, 8px); color: var(--rtm-fd-icon-color, currentColor); line-height: 0; }
.rtm-fd-icon svg { width: var(--rtm-fd-icon-size, 16px); height: var(--rtm-fd-icon-size, 16px); fill: currentColor; }

/* ── v1.7.0: consistent 8px radius (overridable by Elementor) ───────────── */
.rtm-buy-btn, .rtm-gx-filter, .rtm-gx-cell { border-radius: 8px; }

/* v1.7.0: lock body scroll while the purchase offcanvas is open. */
html.rtm-atc-lock { overflow: hidden; }


/* ── v1.7.1: Add to Cart — row restructure, tooltip, contact, close ─────── */
.rtm-atc-row { display: block; padding: 0; }
.rtm-atc-row__main {
	display: flex; align-items: center; gap: 12px;
	padding: 13px 14px; cursor: pointer; margin: 0;
}
.rtm-atc-row__name { flex: 0 1 auto; }
.rtm-atc-row__main .rtm-atc-row__price { margin-left: auto; }
.rtm-atc-tip-btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 0; border: none; background: transparent; cursor: pointer;
	color: #a1a1aa; line-height: 0;
}
.rtm-atc-tip-btn svg { width: 14px; height: 14px; }
.rtm-atc-tip {
	position: relative;
	margin: 0 14px 12px;
	padding: 11px 16px;
	background: #111;
	color: #fff;
	font-size: 12px;
	line-height: 1.5;
	border-radius: 8px;
}
.rtm-atc-tip[hidden] { display: none; }
.rtm-atc-tip p { margin: 0 0 .5em; }
.rtm-atc-tip p:last-child { margin: 0; }

.rtm-atc-contact { margin: 16px 0 0; font-size: 12px; color: #71717a; text-align: center; }
.rtm-atc-contact a { color: #111; text-decoration: underline; }

.rtm-atc-close {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 6px; border: 1px solid #e5e5e5; border-radius: 8px;
	background: #fff; color: #666; cursor: pointer; transition: all .15s ease;
}
.rtm-atc-close:hover { color: #111; border-color: #111; }


/* ── v1.8.0: Offcanvas slide direction ──────────────────────────────────── */
.rtm-atc-oc--right .rtm-atc-oc__inner { left: auto; right: 0; top: 0; height: 100%; transform: translateX(100%); }
.rtm-atc-oc--right.is-open .rtm-atc-oc__inner { transform: translateX(0); }
.rtm-atc-oc--left .rtm-atc-oc__inner { right: auto; left: 0; top: 0; height: 100%; transform: translateX(-100%); box-shadow: 8px 0 40px rgba(0,0,0,.18); }
.rtm-atc-oc--left.is-open .rtm-atc-oc__inner { transform: translateX(0); }
.rtm-atc-oc--top .rtm-atc-oc__inner,
.rtm-atc-oc--bottom .rtm-atc-oc__inner {
	left: 0; right: 0; width: 100% !important; max-width: 100%;
	height: auto; max-height: 90vh;
}
.rtm-atc-oc--top .rtm-atc-oc__inner { top: 0; bottom: auto; transform: translateY(-100%); box-shadow: 0 8px 40px rgba(0,0,0,.18); }
.rtm-atc-oc--top.is-open .rtm-atc-oc__inner { transform: translateY(0); }
.rtm-atc-oc--bottom .rtm-atc-oc__inner { bottom: 0; top: auto; transform: translateY(100%); box-shadow: 0 -8px 40px rgba(0,0,0,.18); }
.rtm-atc-oc--bottom.is-open .rtm-atc-oc__inner { transform: translateY(0); }


/* Natural height everywhere — no internal scroll containers. */
.rtm-gx, .rtm-gx-body, .rtm-gx-grid { max-height: none !important; overflow: visible !important; }

/* Tooltip info icon follows widget settings (not the theme button hover). */
.rtm-atc-tip-btn,
.rtm-atc-tip-btn:hover,
.rtm-atc-tip-btn:focus { color: #a1a1aa; background: transparent; border: none; box-shadow: none; }


/* ── v1.8.3: Sticky glyph category filters ──────────────────────────────── */
.rtm-gx--sticky .rtm-gx-filters {
	position: sticky;
	top: 0;
	z-index: 5;
	background: #fff;
	padding-bottom: 8px;
}
