/* WordPress / plugin styling for the Universal Devices child theme. Loaded after everything else.
   Uses the tokens from styles.css (the static site), so dark and light follow the site's toggle. */

/* ---- Themify's own header, footer and mobile menu are replaced by ours -------------------------- */
#headerwrap, #footerwrap, #menu-icon, #menu-icon-close, #mobile-menu { display: none !important; }

/* our header buttons keep the site colours (Themify sets a dark colour on every button) */
body.ud-theme .icon-btn { color: var(--text); }
body.ud-theme .site-header .icon-btn { padding: 0; background: var(--panel); border: 1px solid var(--line); }
body.ud-theme .site-header .icon-btn .ico { width: 20px; height: 20px; fill: none !important; stroke: currentColor !important; stroke-width: 1.7; }
body.ud-theme .site-header .icon-btn svg { max-width: none; }
body.ud-theme .brand, body.ud-theme .brand:hover, body.ud-theme .brand .brand-word, body.ud-theme .brand .brand-word b, body.ud-theme .brand span { color: var(--text) !important; -webkit-text-fill-color: var(--text) !important; }

/* ---- Page frame ----------------------------------------------------------------------------------- */
body.ud-theme { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; }
body.ud-theme #pagewrap, body.ud-theme #body, body.ud-theme #layout, body.ud-theme #content,
body.ud-theme .page-content { background: transparent; color: var(--text); font-family: var(--font); }
body.ud-theme #pagewrap { padding-top: 0 !important; }
body.ud-theme #body { padding: clamp(8px, 2vw, 24px) 0 0; margin-top: 0; }
/* Themify Builder pages start with an empty text row and generous row padding: that was the big gap under the header. */
body.ud-theme .themify_builder_row.tb_first:has(.tb_text_wrap > p:only-child:empty) { display: none !important; }
body.ud-theme .themify_builder_content > .module_row:first-child:not(.tb_first) { padding-top: 0 !important; }
body.ud-theme #body .module_row > .row_inner { padding-top: 0; }
body.ud-theme #content { padding: 0 !important; }   /* Themify adds 5% (about 65px) above and below the content */
body.ud-theme #body .module_row:not(.tb_first) { margin-top: 0; }
body.ud-theme #body .module_row.tb_first { padding-top: 0 !important; margin-top: 0 !important; }
body.ud-theme #layout { width: min(1160px, 100% - 48px); max-width: none; margin: 0 auto; padding: 0; }
body.ud-theme #body a:not(.button):not(.btn):not(.wpsc-btn):not(.um-button):not(.remove) { color: var(--ice); }
body.ud-theme #body a:not(.button):not(.btn):not(.wpsc-btn):not(.um-button):not(.remove):hover { color: var(--warm); }
body.ud-theme #body :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--font); color: var(--text); letter-spacing: -0.02em; text-transform: none; font-weight: 800; line-height: 1.15; }
body.ud-theme .page-title, body.ud-theme h1.page-title, body.ud-theme .entry-title { font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin: 0 0 24px; }
body.ud-theme #body :is(p, li, td, th, label) { color: inherit; font-family: var(--font); }
body.ud-theme hr { border: 0; border-top: 1px solid var(--line); }
body.ud-theme img { max-width: 100%; height: auto; }

/* ---- Themify Builder rows: drop their own backgrounds and colours ---------------------------------- */
body.ud-theme .themify_builder_row, body.ud-theme .module_row, body.ud-theme .module { background-color: transparent !important; color: var(--text); }
body.ud-theme .themify_builder_row .row_inner { padding-left: 0; padding-right: 0; }
body.ud-theme .module-buttons .ui, body.ud-theme .module-buttons a.ui { border-radius: 999px; }

/* ---- Buttons ----------------------------------------------------------------------------------------- */
body.ud-theme button:not(.icon-btn), body.ud-theme input[type=submit], body.ud-theme input[type=button], body.ud-theme .button,
body.ud-theme a.button, body.ud-theme .wp-element-button, body.ud-theme .wpsc-btn, body.ud-theme .um-button,
body.ud-theme .um a.um-button {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: 999px;
	font: inherit; font-weight: 700; font-size: 0.98rem; line-height: 1.2; text-transform: none; letter-spacing: 0;
	border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); cursor: pointer; box-shadow: none; text-decoration: none;
	transition: transform 0.25s var(--ease), border-color 0.3s, background 0.3s; }
body.ud-theme button:not(.icon-btn):hover, body.ud-theme input[type=submit]:hover, body.ud-theme .button:hover, body.ud-theme a.button:hover,
body.ud-theme .um-button:hover { transform: translateY(-1px); border-color: var(--warm); color: var(--text); background: var(--panel-2); }
/* primary actions */
body.ud-theme .button.alt, body.ud-theme a.button.alt, body.ud-theme button:not(.icon-btn).alt, body.ud-theme input.alt,
body.ud-theme .single_add_to_cart_button, body.ud-theme .checkout-button, body.ud-theme #place_order,
body.ud-theme .um-button:not(.um-alt), body.ud-theme .wpsc-btn.wpsc-btn-primary {
	background: var(--grad-warm); color: var(--on-warm); border-color: transparent;
	box-shadow: 0 10px 30px -10px var(--glow-warm), inset 0 1px 0 rgba(255,255,255,.45); }
body.ud-theme .button.alt:hover, body.ud-theme .single_add_to_cart_button:hover, body.ud-theme .checkout-button:hover,
body.ud-theme #place_order:hover { color: var(--on-warm); background: var(--grad-warm); }
body.ud-theme .um-button.um-alt { background: var(--panel-2); color: var(--text); }
body.ud-theme button:not(.icon-btn)[disabled], body.ud-theme .button.disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---- Forms ---------------------------------------------------------------------------------------------- */
body.ud-theme input[type=text], body.ud-theme input[type=email], body.ud-theme input[type=password], body.ud-theme input[type=tel],
body.ud-theme input[type=number], body.ud-theme input[type=url], body.ud-theme input[type=search], body.ud-theme textarea,
body.ud-theme select, body.ud-theme .um-form input[type=text], body.ud-theme .um-form input[type=password],
body.ud-theme .select2-container--default .select2-selection--single, body.ud-theme .select2-container--default .select2-selection--multiple {
	background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
	padding: 11px 14px; font: inherit; box-shadow: none; max-width: 100%; }
body.ud-theme input:focus, body.ud-theme textarea:focus, body.ud-theme select:focus { outline: 2px solid color-mix(in srgb, var(--ice) 55%, transparent); outline-offset: 1px; border-color: var(--ice); }
body.ud-theme ::placeholder { color: var(--muted); opacity: 1; }
body.ud-theme label, body.ud-theme .form-row label, body.ud-theme .um-field-label label { color: var(--text-2); font-weight: 600; font-size: 0.95rem; }
body.ud-theme select option { background: var(--bg-soft); color: var(--text); }
body.ud-theme input[type=checkbox], body.ud-theme input[type=radio] { accent-color: var(--warm); }

/* WooCommerce's own selectors are more specific; match them */
body.ud-theme .woocommerce form .form-row input.input-text, body.ud-theme .woocommerce form .form-row textarea,
body.ud-theme .woocommerce-checkout input.input-text, body.ud-theme .woocommerce-checkout textarea,
body.ud-theme .woocommerce-cart input.input-text, body.ud-theme .woocommerce .quantity .qty {
	background: var(--panel) !important; color: var(--text) !important; border: 1px solid var(--line-strong) !important;
	border-radius: var(--radius-sm) !important; padding: 11px 14px !important; height: auto !important; box-shadow: none !important; }
body.ud-theme .select2-container .select2-selection--single { height: auto !important; background: var(--panel) !important; border: 1px solid var(--line-strong) !important; border-radius: var(--radius-sm) !important; }
body.ud-theme .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--text) !important; line-height: 1.5 !important; padding: 10px 14px !important; }
body.ud-theme .select2-container--default .select2-selection--single .select2-selection__arrow { height: 100% !important; }
body.ud-theme .select2-dropdown { background: var(--bg-soft) !important; color: var(--text); border: 1px solid var(--line-strong) !important; }
body.ud-theme .select2-container--default .select2-results__option--highlighted[aria-selected], body.ud-theme .select2-container--default .select2-results__option--highlighted { background: var(--panel-2) !important; color: var(--text) !important; }
body.ud-theme .woocommerce-checkout h3 { text-transform: none; letter-spacing: -0.01em; }

/* ---- Tables -------------------------------------------------------------------------------------------------- */
body.ud-theme table { width: 100%; border-collapse: collapse; background: transparent; color: var(--text); border: 0; }
body.ud-theme th, body.ud-theme td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; vertical-align: middle; }
body.ud-theme thead th { font: 500 0.78rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
body.ud-theme tfoot th, body.ud-theme tfoot td { font-weight: 700; }

/* ---- WooCommerce ----------------------------------------------------------------------------------------------- */
body.ud-theme .woocommerce { color: var(--text); }
body.ud-theme .woocommerce-breadcrumb { color: var(--muted); font: 500 0.78rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 18px; }
body.ud-theme .woocommerce-breadcrumb a { color: var(--ice); }
body.ud-theme .woocommerce-message, body.ud-theme .woocommerce-info, body.ud-theme .woocommerce-error,
body.ud-theme .woocommerce-notice, body.ud-theme .cart-empty {
	background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-left: 4px solid var(--ice);
	border-radius: var(--radius-sm); padding: 14px 18px; list-style: none; margin: 0 0 20px; }
body.ud-theme .woocommerce-error { border-left-color: var(--coral); }
body.ud-theme .woocommerce-message { border-left-color: var(--good); }
body.ud-theme .woocommerce-message::before, body.ud-theme .woocommerce-info::before, body.ud-theme .woocommerce-error::before { display: none; }
body.ud-theme .woocommerce-message .button, body.ud-theme .woocommerce-info .button { float: right; }
body.ud-theme .price, body.ud-theme .amount { color: var(--text); font-weight: 800; }
body.ud-theme del .amount { color: var(--muted); font-weight: 500; }
body.ud-theme ins { text-decoration: none; }
/* product page */
body.ud-theme div.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
body.ud-theme div.product > .woocommerce-tabs, body.ud-theme div.product > .related, body.ud-theme div.product > .upsells { grid-column: 1 / -1; }
body.ud-theme div.product .images, body.ud-theme .woocommerce-product-gallery { float: none; width: 100%; position: relative; margin: 0; }
body.ud-theme .woocommerce-product-gallery__wrapper { margin: 0; padding: 0; }
body.ud-theme .woocommerce-product-gallery__image { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
body.ud-theme .woocommerce-product-gallery__trigger { display: none; }
body.ud-theme .flex-control-thumbs { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
body.ud-theme .flex-control-thumbs li { width: 84px; }
body.ud-theme .flex-control-thumbs img { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 4px; }
body.ud-theme div.product .summary { float: none; width: 100%; }
body.ud-theme div.product .product_title { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 10px; }
body.ud-theme div.product p.price { font-size: 1.6rem; margin: 6px 0 16px; }
body.ud-theme .quantity .qty { width: 78px; text-align: center; }
body.ud-theme form.cart { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 22px 0; }
body.ud-theme .product_meta { color: var(--muted); font-size: 0.92rem; }
body.ud-theme .woocommerce-tabs ul.tabs { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; border: 0; }
body.ud-theme .woocommerce-tabs ul.tabs::before, body.ud-theme .woocommerce-tabs ul.tabs li::before, body.ud-theme .woocommerce-tabs ul.tabs li::after { display: none; }
body.ud-theme .woocommerce-tabs ul.tabs li { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0; margin: 0; }
body.ud-theme .woocommerce-tabs ul.tabs li a { display: block; padding: 8px 16px; color: var(--text-2); font-weight: 700; }
body.ud-theme .woocommerce-tabs ul.tabs li.active { border-color: var(--warm); }
/* product loops */
body.ud-theme ul.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
body.ud-theme ul.products li.product { float: none; width: auto; margin: 0; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
body.ud-theme ul.products li.product .woocommerce-loop-product__title { font-size: 1.1rem; }
/* cart and checkout */
body.ud-theme table.shop_table { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; border-collapse: separate; border-spacing: 0; }
body.ud-theme table.shop_table th, body.ud-theme table.shop_table td { border-bottom: 1px solid var(--line); }
body.ud-theme table.shop_table tr:last-child > * { border-bottom: 0; }
body.ud-theme .product-thumbnail img { width: 72px; border-radius: 10px; background: var(--panel); }
body.ud-theme a.remove { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; color: var(--coral) !important; border: 1px solid var(--line-strong); text-decoration: none; }
body.ud-theme a.remove:hover { background: var(--coral); color: var(--on-warm) !important; }
body.ud-theme .cart_totals, body.ud-theme .woocommerce-checkout-review-order, body.ud-theme #order_review { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
body.ud-theme .cart-collaterals .cart_totals { float: none; width: 100%; max-width: 480px; margin-left: auto; }
body.ud-theme .coupon { display: flex; gap: 10px; flex-wrap: wrap; }
body.ud-theme .wc_payment_methods { list-style: none; padding: 0; margin: 0 0 16px; }
body.ud-theme #payment { background: transparent; border-radius: var(--radius-sm); }
body.ud-theme #payment div.payment_box { background: var(--panel-2); color: var(--text-2); border-radius: var(--radius-sm); }
body.ud-theme #payment div.payment_box::before { display: none; }
body.ud-theme .woocommerce form .form-row { margin: 0 0 16px; padding: 0; }
body.ud-theme .woocommerce form .form-row input.input-text, body.ud-theme .woocommerce form .form-row textarea { width: 100%; }
body.ud-theme .woocommerce-checkout h3, body.ud-theme .cart_totals h2 { font-size: 1.3rem; }
body.ud-theme .ppcp-button-container, body.ud-theme .ppc-button-wrapper { margin-top: 12px; }
@media (max-width: 760px) { body.ud-theme div.product { grid-template-columns: 1fr; } }

/* ---- Ultimate Member (login, register, account, profile) -------------------------------------------------------- */
body.ud-theme .um { color: var(--text); }
body.ud-theme .um-form, body.ud-theme .um-account { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); }
body.ud-theme .um .um-field-label, body.ud-theme .um .um-field-label label { color: var(--text-2); }
body.ud-theme .um .um-field-area input, body.ud-theme .um .um-field-area textarea { height: auto; }
body.ud-theme .um-account-side { background: var(--panel); border-radius: var(--radius-sm); }
body.ud-theme .um-account-side li a { color: var(--text-2); }
body.ud-theme .um-account-side li a.current, body.ud-theme .um-account-side li a:hover { color: var(--text); background: var(--panel-2); }
body.ud-theme .um-account-main, body.ud-theme .um-account-heading { color: var(--text); border-color: var(--line); }
body.ud-theme .um-profile-nav, body.ud-theme .um-profile-body, body.ud-theme .um-profile-note { background: transparent; color: var(--text); }
body.ud-theme .um-notice, body.ud-theme .um-field-error { border-radius: var(--radius-sm); }
body.ud-theme .um .um-tip, body.ud-theme .um-field-checkbox-option, body.ud-theme .um-field-radio-option { color: var(--text-2); }
body.ud-theme .um-center { text-align: center; }

/* ---- SupportCandy (tickets) ------------------------------------------------------------------------------------------ */
body.ud-theme .wpsc-container, body.ud-theme .wpsc-body, body.ud-theme .wpsc-shortcode-container { color: var(--text); font-family: var(--font); }
body.ud-theme .wpsc-container, body.ud-theme #wpsc-container { background: transparent; }
body.ud-theme .wpsc-login-wrapper, body.ud-theme .wpsc-ticket-list, body.ud-theme .wpsc-form,
body.ud-theme .wpsc-it-container, body.ud-theme .wpsc-card, body.ud-theme .wpsc-filter-container {
	background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
body.ud-theme .wpsc-login-wrapper, body.ud-theme .wpsc-shortcode-container { background-color: transparent; }
body.ud-theme .wpsc-login-wrapper .wpsc-login-box, body.ud-theme .wpsc-login-box { background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
body.ud-theme .wpsc-login-box a { color: var(--ice); }
body.ud-theme .wpsc-container table.wpsc-ticket-list-tbl, body.ud-theme table.dataTable { color: var(--text); }
body.ud-theme .dataTables_wrapper, body.ud-theme .dataTables_wrapper .dataTables_info, body.ud-theme .dataTables_wrapper .dataTables_paginate { color: var(--text-2); }
body.ud-theme .wpsc-ticket-body, body.ud-theme .wpsc-thread, body.ud-theme .wpsc-thread-body { background: var(--panel); color: var(--text); border-radius: var(--radius-sm); }
body.ud-theme .wpsc-tag, body.ud-theme .wpsc-badge { border-radius: 999px; }

body.ud-theme .wpsc-header { background: var(--panel-2) !important; border-bottom: 1px solid var(--line); }
body.ud-theme .wpsc-menu-list, body.ud-theme .wpsc-humbargar-title { color: var(--text-2) !important; opacity: 1 !important; }
body.ud-theme .wpsc-menu-list.active, body.ud-theme .wpsc-menu-list:hover { color: var(--text) !important; }
body.ud-theme .wpsc-menu-list.active { box-shadow: inset 0 -2px 0 var(--warm); }
body.ud-theme .wpsc-shortcode-container, body.ud-theme .wpsc-shortcode-container .wpsc-container { background: var(--panel) !important; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
body.ud-theme .wpsc-body, body.ud-theme .wpsc-page-snippets { background: transparent !important; color: var(--text); }
/* SupportCandy paints its own white panels; make everything inside transparent, then give the container one panel */
body.ud-theme .wpsc-shortcode-container *:not(.wpsc-btn):not(button):not(input):not(select):not(textarea):not(img):not(svg):not(.select2-dropdown) { background-color: transparent !important; }

/* ---- Small screens ------------------------------------------------------------------------------------------------------ */
@media (max-width: 720px) {
	body.ud-theme #layout { width: calc(100% - 32px); }
	body.ud-theme table.shop_table_responsive tr td::before { color: var(--muted); }
}
