/* ===========================================================================
   RevivMD "modern blue" skin — everything except the home page.
   ---------------------------------------------------------------------------
   Companion to inc/skin.php, which prints the token block. This file only
   contains component rules: anything that has to beat WoodMart's theme-settings
   CSS lives in the inline block instead, because that prints later in the head.

   Rules are grouped by the page they were written for, but nothing here is
   page-scoped — WoodMart reuses the same components across shop, cart and
   account, so scoping would only duplicate them.
   =========================================================================== */

/* ---------------------------------------------------------------- 1. BASE */
body,
button,
input,
select,
textarea {
	font-family: var(--sans);
}

a {
	color: var(--blue-lift);
}

a:hover,
a:focus {
	color: var(--cyan);
}

:focus-visible {
	outline: 2px solid var(--cyan);
	outline-offset: 3px;
}

::selection {
	background: var(--blue);
	color: var(--on-blue);
}

hr,
.wd-sticky-nav-title {
	border-color: var(--line);
}

/* Nothing in this design is rounded. WoodMart hardcodes radii in a handful of
   places that no variable reaches. */
.wd-buttons,
.product-labels .product-label,
.wd-nav-img,
.wd-dropdown,
.wd-popup,
.wd-side-hidden,
.summary-inner,
.wd-tabs .wd-nav-tabs li > a,
img,
.attachment-woocommerce_thumbnail {
	border-radius: 0 !important;
}

/* ------------------------------------------------------------- 2. BUTTONS */
/* WoodMart's "default" button is now the design's ghost button, which needs a
   border — the theme gives default buttons none, and has no variable for it. */
.btn,
.button,
button,
[type="submit"],
[type="button"],
.added_to_cart,
.wd-buy-now-btn {
	letter-spacing: 0.13em;
	border-radius: 0;
	min-height: 48px;
}

.btn-default,
.button:not(.btn-accented):not(.alt):not(.checkout-button),
[type="submit"]:not(.btn-accented),
.added_to_cart {
	border: 1px solid var(--line);
}

.btn-default:hover,
.button:not(.btn-accented):not(.alt):not(.checkout-button):hover,
[type="submit"]:not(.btn-accented):hover,
.added_to_cart:hover {
	border-color: var(--cyan);
}

/* Woo's own "alt" buttons (Place order, Proceed to checkout, Update cart) are
   the primary action on their page and should read as the accented blue. */
.button.alt,
.checkout-button,
#place_order,
.single_add_to_cart_button {
	background-color: var(--blue);
	color: var(--on-blue);
	border: 1px solid var(--blue);
}

.button.alt:hover,
.checkout-button:hover,
#place_order:hover,
.single_add_to_cart_button:hover {
	background-color: var(--blue-lift);
	border-color: var(--blue-lift);
	color: var(--on-blue);
}

.button.disabled,
.button:disabled,
button:disabled {
	opacity: 0.45;
}

/* --------------------------------------------------------------- 3. FORMS */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
select,
textarea,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.wd-search-form input,
.qty {
	background-color: var(--panel);
	border: 1px solid var(--line);
	border-radius: 0;
	color: var(--text);
}

/* The open dropdown is painted by the browser, not by the page, and it takes
   its surface from the OPTION rather than from the styled <select>. Skinning
   only the select leaves the list on the UA's white while the text still
   inherits --text (#E6EEFB), which is all but invisible in dark mode.
   `color-scheme: dark` alone does not cover it either: an author
   background-color on the select opts the control out of the UA's dark
   treatment. Both surfaces have to be named explicitly.

   The `.wd `-prefixed selectors are not duplication: base.css carries
   `.wd select option{background-color:var(--bgcolor-white)}`, which at (0,1,2)
   outranks a bare `select option` at (0,0,2). That is why this looked fixed —
   `select option:checked` happens to tie base.css on specificity and win on
   document order, so the one highlighted row went dark while every other row
   in the open list stayed white. Measured on the product page: the `supply`
   dropdown painted #E6EEFB text on #fff for both unselected rows. Match the
   theme's own selector instead of leaning on a tie. */
select option,
select optgroup,
.wd select option,
.wd select optgroup {
	background-color: var(--panel);
	color: var(--text);
}

/* The browser paints its own highlight over the row under the cursor, so the
   selected option needs a surface that stays legible against it. */
select option:checked,
select option:hover,
.wd select option:checked,
.wd select option:hover {
	background-color: var(--panel-2);
	color: var(--text);
}

input::placeholder,
textarea::placeholder {
	color: var(--dim);
}

input:focus,
select:focus,
textarea:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: var(--cyan);
	outline: none;
}

label,
.form-row label,
legend {
	color: var(--text);
}

/* select2 renders its own dropdown at the end of <body>, outside any skinned
   container, so it needs the surfaces spelled out. */
.select2-container--default .select2-selection--single .select2-selection__rendered {
	color: var(--text);
}

.select2-dropdown {
	background-color: var(--panel);
	border-color: var(--line);
	border-radius: 0;
	color: var(--text);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
	background-color: var(--blue);
	color: var(--on-blue);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
	background-color: var(--bg-2);
	border-color: var(--line);
	color: var(--text);
}

/* -------------------------------------------------------------- 4. HEADER */
.whb-header,
.whb-main-header,
.whb-general-header,
.whb-header-bottom,
.whb-top-bar,
.whb-row,
.whb-sticked .whb-main-header {
	background-color: var(--header-solid);
	border-color: var(--line-soft);
}

.whb-header .wd-nav > li > a,
.whb-header .wd-tools-element > a,
.whb-header a {
	color: var(--text);
}

.whb-header .wd-nav > li > a:hover,
.whb-header .wd-tools-element > a:hover {
	color: var(--cyan);
}

.wd-tools-element .wd-tools-count,
.wd-header-cart .wd-cart-number {
	background-color: var(--blue);
	color: var(--on-blue);
}

/* Dropdowns, mega menus and the mobile drawer are all separate surfaces. */
.wd-dropdown,
.wd-dropdown-menu,
.wd-sub-menu,
.wd-dropdown-results,
.mobile-nav,
.wd-side-hidden,
.cart-widget-side,
.login-form-side,
.wd-popup {
	background-color: var(--panel);
	border-color: var(--line);
	color: var(--muted);
}

.wd-sub-menu li > a,
.mobile-nav li > a,
.wd-dropdown a {
	color: var(--text);
}

.wd-sub-menu li > a:hover,
.mobile-nav li > a:hover,
.wd-dropdown a:hover {
	color: var(--cyan);
}

.mobile-nav li,
.wd-sub-menu li {
	border-color: var(--line-soft);
}

.wd-close-side {
	background-color: var(--scrim-bg);
}

/* ------------------------------------------------- 5. PAGE TITLE / CRUMBS */
.wd-page-title,
.page-title,
.title-size-default {
	background-color: var(--bg-2);
	border-bottom: 1px solid var(--line-soft);
}

.woocommerce-breadcrumb,
.breadcrumbs,
.wd-breadcrumbs {
	color: var(--dim);
}

.woocommerce-breadcrumb a,
.breadcrumbs a {
	color: var(--muted);
}

/* --------------------------------------------------------------- 6. CARDS */
.product-grid-item,
.product-wrapper,
.wd-product {
	background-color: transparent;
}

.product-element-top,
.wd-product-grid .product-image-link {
	background-color: var(--panel);
}

.wd-entities-title a,
.product-title a {
	color: var(--text);
}

.wd-entities-title a:hover,
.product-title a:hover {
	color: var(--cyan);
}

.price,
.amount,
.woocommerce-Price-amount {
	color: var(--text);
}

.price del,
del .amount {
	color: var(--dim);
}

.price ins,
.price ins .amount {
	color: var(--cyan);
	text-decoration: none;
}

.product-labels .product-label.onsale,
.onsale {
	background-color: var(--amber);
	color: #1a1000;
}

.product-labels .product-label.new {
	background-color: var(--blue);
	color: var(--on-blue);
}

.star-rating span::before,
.star-rating::before {
	color: var(--amber);
}

/* The loop add-to-cart button fills itself from the accented-button tokens, but
   its cart glyph and its label are action elements, so WoodMart colours them
   from --wd-action-color — which this skin sets to the same --blue. Measured on
   the category page: #1E6AFF on #1E6AFF, contrast 1:1, so the glyph AND the
   "Select options" text are invisible, in the resting and the hover state alike
   (--wd-action-color-hover and --btn-accented-bgcolor-hover collide the same
   way). It survived review because the button only appears on card hover.

   Point the action tokens at the button's own foreground so they follow the
   fill rather than the page accent, in both themes, with no hardcoded hex. The
   selector is the one WoodMart uses to apply that fill: everywhere else the add
   button is transparent on the card, where the blue accent is correct. */
.wd-product.wd-hover-buttons-on-hover .wd-add-btn {
	--wd-action-icon-color: var(--btn-accented-color);
	--wd-action-icon-color-hover: var(--btn-accented-color-hover);
	--wd-action-text-color: var(--btn-accented-color);
	--wd-action-text-color-hover: var(--btn-accented-color-hover);
}

/* Grid separators and the catalog toolbar */
.wd-products-element,
.wd-shop-tools,
.wd-products-shop-tools,
.wd-sticky-loader {
	border-color: var(--line-soft);
}

.wd-products.elements-grid > .product-grid-item::before,
.wd-products.elements-grid > .product-grid-item::after {
	border-color: var(--line-soft);
}

/* ------------------------------------------------------- 7. SIDEBAR / WIDGETS */
.wd-sidebar,
.sidebar-container,
.widget {
	background-color: transparent;
	color: var(--muted);
}

.widget-title,
.widgettitle {
	color: var(--text);
}

.widget ul li,
.widget_product_categories li,
.wd-widget li {
	border-color: var(--line-soft);
}

.widget a {
	color: var(--muted);
}

.widget a:hover {
	color: var(--cyan);
}

.price_slider_wrapper .ui-slider {
	background-color: var(--panel-2);
}

.price_slider_wrapper .ui-slider .ui-slider-range,
.price_slider_wrapper .ui-slider .ui-slider-handle {
	background-color: var(--blue);
}

/* ------------------------------------------------------- 8. SINGLE PRODUCT */
.wd-single-gallery,
.woocommerce-product-gallery,
.woocommerce-product-gallery__image,
.wd-gallery-thumb {
	background-color: var(--panel);
}

.summary .product_meta,
.product_meta span {
	color: var(--dim);
	border-color: var(--line-soft);
}

.wd-tabs .wd-nav-tabs,
.woocommerce-tabs .wc-tabs {
	border-color: var(--line);
}

.wd-tabs .wd-nav-tabs li > a,
.woocommerce-tabs .wc-tabs li a {
	color: var(--muted);
	background-color: transparent;
	border-color: var(--line-soft);
}

.wd-tabs .wd-nav-tabs li.wd-active > a,
.woocommerce-tabs .wc-tabs li.active a {
	color: var(--text);
	border-bottom-color: var(--cyan);
}

.wd-accordion-title,
.wd-accordion-content {
	border-color: var(--line-soft);
	color: var(--muted);
}

.quantity input[type="number"],
.quantity .qty {
	background-color: var(--panel);
	color: var(--text);
}

.wd-variation-item,
.variations select {
	border-color: var(--line);
}

.reset_variations {
	color: var(--cyan);
}

/* -------------------------------------------- 9. TABLES: cart / checkout / account */
table,
.shop_table,
.woocommerce-checkout-review-order-table,
.cart_totals table,
.woocommerce-orders-table,
.woocommerce-table {
	border-color: var(--line);
	color: var(--muted);
}

table th,
.shop_table th {
	color: var(--text);
	border-color: var(--line);
	background-color: var(--bg-2);
}

table td,
.shop_table td {
	border-color: var(--line-soft);
	background-color: transparent;
}

.cart_totals,
.wd-checkout-order-review,
.woocommerce-checkout-review-order,
.wc-block-components-sidebar,
#order_review,
.woocommerce-order-details,
.woocommerce-customer-details,
.woocommerce-MyAccount-content {
	background-color: var(--panel);
	border: 1px solid var(--line);
}

.checkout .col-1,
.checkout .col-2,
#customer_details {
	color: var(--muted);
}

.woocommerce-form-login,
.woocommerce-form-coupon,
.checkout_coupon,
.woocommerce-form-register,
.wd-login-form {
	background-color: var(--panel);
	border: 1px solid var(--line);
}

/* Account navigation reads as a vertical tab rail. */
.woocommerce-MyAccount-navigation ul li {
	border-color: var(--line-soft);
}

.woocommerce-MyAccount-navigation ul li a {
	color: var(--muted);
}

.woocommerce-MyAccount-navigation ul li.is-active > a,
.woocommerce-MyAccount-navigation ul li a:hover {
	color: var(--cyan);
}

/* Stripe mounts its card field in an iframe, so only the wrapper is ours. */
.wc_payment_methods,
.woocommerce-checkout-payment,
#payment,
.wc-stripe-elements-field,
.wc-stripe-upe-element {
	background-color: var(--panel) !important;
	border-color: var(--line);
	color: var(--muted);
}

.wc_payment_method label {
	color: var(--text);
}

.payment_box,
.wc_payment_method .payment_box {
	background-color: var(--bg-2) !important;
	color: var(--muted);
}

.payment_box::before {
	border-bottom-color: var(--bg-2) !important;
}

/* ------------------------------------------------------------- 10. NOTICES */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wd-notice,
.wc-block-components-notice-banner {
	border-radius: 0;
	border: 1px solid var(--line);
}

.woocommerce-info,
.wc-block-components-notice-banner.is-info {
	background-color: var(--panel-2);
	color: var(--text);
}

.woocommerce-error,
.wc-block-components-notice-banner.is-error {
	background-color: #4A0F18;
	color: #FFD9DF;
	border-color: #7A1D2B;
}

[data-theme="light"] .woocommerce-error,
[data-theme="light"] .wc-block-components-notice-banner.is-error {
	background-color: #FDE7EA;
	color: #7A1020;
	border-color: #E4A4AE;
}

/* ------------------------------------------------------------- 11. FOOTER */
.footer-container,
.wd-footer,
.copyrights-wrapper {
	background-color: var(--bg-2);
	border-top: 1px solid var(--line-soft);
	color: var(--muted);
}

.footer-container a,
.copyrights-wrapper a {
	color: var(--muted);
}

.footer-container a:hover,
.copyrights-wrapper a:hover {
	color: var(--cyan);
}

/* ---------------------------------------------------------- 12. UTILITIES */
/* The scroll-to-top button is coloured by the theme settings, which print after
   this file, so it is re-tinted in the inline block in skin.php instead. */

/* Light/dark control. Stacked directly above the scroll-to-top button so the
   two read as one column of page utilities rather than two stray circles. */
.rv-theme-toggle {
	position: fixed;
	right: 20px;
	bottom: 80px;
	z-index: 350;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Matches WoodMart's scroll-to-top box so the two line up exactly. */
	width: 50px;
	height: 50px;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 0;
	background: var(--panel);
	color: var(--text);
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.rv-theme-toggle:hover,
.rv-theme-toggle:focus-visible {
	border-color: var(--cyan);
	background: var(--panel-2);
	color: var(--cyan);
}

/* Sun in dark mode, crescent in light. The crescent is the same circle with the
   fill moved into an offset inset shadow, so there is no icon font or SVG to
   load for a control this small. */
.rv-theme-toggle__icon {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: currentColor;
}

[data-theme="light"] .rv-theme-toggle__icon {
	background: transparent;
	box-shadow: inset -5px -3px 0 0 currentColor;
}

.wd-loader::after,
.blockUI.blockOverlay::after {
	border-top-color: var(--blue);
}

.blockUI.blockOverlay {
	background-color: var(--bg) !important;
}
