/* Storefront account, cart and service pages. Screen-only appearance overrides;
 * payment logos, product photographs, QR codes and embedded providers retain
 * their original colours. Selectors follow the live aphro-theme components. */
@media screen {
  html.aphro-dark body.aphro-theme-enabled.woocommerce-account .page-shell,
  html.aphro-dark body.aphro-theme-enabled .account-page {
    background-color: var(--aphro-theme-bg);
  }

  html.aphro-dark body.aphro-theme-enabled :is(
    .account-auth-card, .account-sidebar, .account-card,
    .account-security-top, .account-security-card, .account-security-cert,
    .account-notification-list article, .account-recommend-product,
    .account-wishlist-product, .account-address-action, .account-address-item,
    .account-address-edit-form, .order-item, .cart-panel, .cart-summary,
    .cart-row, .cart-drawer, .cart-drawer__item, .checkout-order-card,
    .thankyou-card, .thankyou-overview, .thankyou-details,
    .contact-page__form, .j17track-track-form
  ),
  html.aphro-dark body.aphro-theme-enabled.woocommerce-checkout #customer_details {
    background-color: var(--aphro-theme-surface);
    border-color: var(--aphro-theme-border);
    color: var(--aphro-theme-text);
  }

  html.aphro-dark body.aphro-theme-enabled :is(
    .account-user, .account-card--overview h2, .account-card--overview > p,
    .account-card--order-overview h2, .account-card--order-overview > p,
    .account-card--blue h3, .account-card--blue > p,
    .account-card--yellow h3, .account-card--yellow > p,
    .account-card--orders-list h3, .account-card--orders-list > p:not(.pager),
    .account-security-top h2, .account-security-top > p,
    .account-security-card__head, .account-notification-card__head,
    .account-wishlist-card__head, .account-address-head,
    .account-recommend-arrows, .account-address-action__plus,
    .order-item__meta, .thankyou-overview li
  ) {
    background-color: var(--aphro-theme-raised);
    border-color: var(--aphro-theme-border);
    color: var(--aphro-theme-text);
  }

  html.aphro-dark body.aphro-theme-enabled :is(
    .account-auth-title, .account-auth-title span, .account-auth-row a,
    .account-auth-register a, .order-item__total strong,
    .account-recommend-item em, .account-recommend-item em ins,
    .account-wishlist-product__body strong, .cart-page__header a,
    .cart-summary div > strong, .cart-drawer__total-row > strong:last-child,
    .contact-info__content a, .contact-info__icon,
    .thankyou-card small, .thankyou-overview .total strong
  ),
  html.aphro-dark body.aphro-theme-enabled.woocommerce-checkout :is(
    .product-total, .cart-subtotal td, .order-total td
  ) {
    color: var(--aphro-theme-accent);
  }

  html.aphro-dark body.aphro-theme-enabled :is(
    .account-auth-field, .account-auth-register, .account-info-row,
    .account-security-form label, .account-address-edit-fields label,
    .account-notification-list strong, .account-recommend-item,
    .account-wishlist-product__body a, .account-address-item strong,
    .order-item__info strong, .pager, .account-wishlist-pager,
    .cart-row__title, .cart-row__price, .cart-row__price ins,
    .cart-drawer__item-title, .cart-drawer__price, .cart-drawer__price ins,
    .cart-drawer__total-row > strong:first-child, .checkout-product__name,
    .thankyou-page, .thankyou-overview strong, .j17track-track-form::before
  ) {
    color: var(--aphro-theme-text);
  }

  html.aphro-dark body.aphro-theme-enabled :is(
    .account-auth-row, .account-user span, .account-toggle-message,
    .account-save-message, .account-card--overview > p,
    .account-card--order-overview > p, .account-card--blue > p,
    .account-card--yellow > p, .account-card--orders-list > p:not(.pager),
    .account-security-top p, .account-security-card > p,
    .account-security-card__head p, .account-security-chip span,
    .account-notification-card__head p, .account-notification-list p,
    .account-recommend-item small, .account-recommend-item em del,
    .account-wishlist-card__head p, .account-wishlist-product__body p,
    .account-wishlist-product__body del, .account-wishlist-empty,
    .account-address-head p, .account-address-item span, .account-address-item p,
    .order-item__meta, .order-item__info span, .order-item__total span,
    .orders-empty, .cart-page__shipping, .cart-row__category,
    .cart-row__info small, .cart-page__empty p, .cart-summary p,
    .cart-drawer__shipping, .cart-drawer__item-cat, .cart-drawer__discount,
    .cart-drawer__total-note p, .cart-drawer__empty, .thankyou-card p,
    .thankyou-overview span, .contact-page__info > p, .contact-info__content p,
    .aphro-password-meter, .aphro-password-match, .aphro-password-rules
  ) {
    color: var(--aphro-theme-muted);
  }

  /* Keep the existing active navigation and profile controls distinguishable. */
  html.aphro-dark body.aphro-theme-enabled .woocommerce-MyAccount-navigation ul {
    background-color: var(--aphro-theme-surface);
  }
  html.aphro-dark body.aphro-theme-enabled .woocommerce-MyAccount-navigation a {
    color: var(--aphro-theme-text);
    border-color: var(--aphro-theme-border);
  }
  html.aphro-dark body.aphro-theme-enabled .woocommerce-MyAccount-navigation :is(.is-active a, a:hover) {
    background-color: var(--aphro-theme-raised);
    color: var(--aphro-theme-accent);
  }
  html.aphro-dark body.aphro-theme-enabled :is(
    .account-menu-icon, .account-edit-button img, .account-sidecards a img,
    .account-address-action__plus img, .account-recommend-arrows img
  ) {
    /* These are monochrome interface assets, never customer or product images. */
    filter: brightness(0) invert(1);
  }
  html.aphro-dark body.aphro-theme-enabled :is(.account-info-row, .account-security-form .form-row, .account-phone-code) {
    border-color: var(--aphro-theme-border);
  }
  html.aphro-dark body.aphro-theme-enabled :is(.account-info-row::before, .account-address-item strong::before) {
    background-color: var(--aphro-theme-muted);
  }
  html.aphro-dark body.aphro-theme-enabled :is(.account-phone-code__toggle, .account-phone-code__option) {
    background-color: transparent;
    color: var(--aphro-theme-text);
  }
  html.aphro-dark body.aphro-theme-enabled .account-phone-code__toggle::after {
    border-top-color: var(--aphro-theme-muted);
  }
  html.aphro-dark body.aphro-theme-enabled .account-info-row .account-phone-code__panel {
    background-color: var(--aphro-theme-surface);
    border-color: var(--aphro-theme-border);
  }
  html.aphro-dark body.aphro-theme-enabled .account-phone-code__option:is(:hover, :focus-visible, .is-active) {
    background-color: var(--aphro-theme-raised);
    color: var(--aphro-theme-accent);
  }
  html.aphro-dark body.aphro-theme-enabled .account-toggle {
    background-color: var(--aphro-theme-raised);
    border-color: var(--aphro-theme-border);
  }
  html.aphro-dark body.aphro-theme-enabled :is(.account-toggle.is-on span, .account-toggle.is-off strong) {
    background-color: var(--aphro-theme-accent);
    color: var(--aphro-theme-on-accent);
  }
  html.aphro-dark body.aphro-theme-enabled :is(.account-toggle.is-on strong, .account-toggle.is-off span) {
    background-color: transparent;
    color: var(--aphro-theme-muted);
  }

  html.aphro-dark body.aphro-theme-enabled :is(
    .account-card--overview .stats-row strong,
    .account-card--order-overview .stats-row strong,
    .account-notification-stats strong
  ) {
    background-color: var(--aphro-theme-raised);
    border-color: var(--aphro-theme-border);
    color: var(--aphro-theme-text);
  }
  html.aphro-dark body.aphro-theme-enabled :is(
    .account-card--overview .stats-row span,
    .account-card--order-overview .stats-row span,
    .account-notification-stats span
  ) {
    color: var(--aphro-theme-muted);
  }

  html.aphro-dark body.aphro-theme-enabled :is(
    .account-sidecards a, .order-item__actions a, .pager .page-numbers,
    .account-wishlist-cart, .account-address-delete,
    .account-security-delete-button, .cart-drawer__close
  ) {
    background-color: var(--aphro-theme-raised);
    border-color: var(--aphro-theme-border);
    color: var(--aphro-theme-text);
    box-shadow: none;
  }
  html.aphro-dark body.aphro-theme-enabled :is(
    .account-sidecards a, .order-item__actions a, .account-address-delete,
    .account-security-delete-button, .cart-drawer__close
  ):is(:hover, :focus-visible) {
    background-color: var(--aphro-theme-bg);
    border-color: var(--aphro-theme-accent);
    color: var(--aphro-theme-accent);
  }
  html.aphro-dark body.aphro-theme-enabled :is(
    .account-save-button, .account-security-submit, .account-address-item > a,
    .account-address-edit-submit .button, .order-item__actions .order-item__primary,
    .pager .page-numbers.current, .account-wishlist-product__body > span,
    .cart-page__update, .cart-page__empty .button, .cart-summary .checkout-button,
    .cart-drawer .checkout-button, .thankyou-next .checkout-button,
    .thankyou-actions .button
  ) {
    background-color: var(--aphro-theme-accent);
    border-color: var(--aphro-theme-accent);
    color: var(--aphro-theme-on-accent);
    box-shadow: none;
  }
  html.aphro-dark body.aphro-theme-enabled .account-auth-submit {
    /* The live authentication template marks these two declarations important. */
    background-color: var(--aphro-theme-accent) !important;
    color: var(--aphro-theme-on-accent) !important;
  }
  html.aphro-dark body.aphro-theme-enabled :is(
    .account-wishlist-remove, .account-wishlist-cart__icon,
    .account-wishlist-pager button, .account-recommend-arrows button,
    .cart-row__remove:not(.loading), .cart-drawer__remove:not(.loading)
  ) {
    color: var(--aphro-theme-accent);
  }

  /* Status meaning remains visible through the existing words and icons. */
  html.aphro-dark body.aphro-theme-enabled .order-status--packing,
  html.aphro-dark body.aphro-theme-enabled .thankyou-card--failed .thankyou-status-icon {
    background-color: #3e321d;
    color: #f0d58d;
  }
  html.aphro-dark body.aphro-theme-enabled .order-status--shipped {
    background-color: #19343e;
    color: #a6dced;
  }
  html.aphro-dark body.aphro-theme-enabled .order-status--review {
    background-color: #43232c;
    color: #ffb4c2;
  }
  html.aphro-dark body.aphro-theme-enabled :is(
    .aphro-password-meter.is-weak, .aphro-password-match.is-error,
    .account-address-edit-fields .required
  ) { color: #ffb4c2; }
  html.aphro-dark body.aphro-theme-enabled .aphro-password-meter.is-medium { color: #f0d58d; }
  html.aphro-dark body.aphro-theme-enabled :is(
    .aphro-password-meter.is-strong, .aphro-password-match.is-success,
    .account-security-cert:not(.is-unverified) span
  ) { color: #a9dfbd; }
  html.aphro-dark body.aphro-theme-enabled .account-security-cert.is-unverified span { color: var(--aphro-theme-muted); }
  html.aphro-dark body.aphro-theme-enabled .account-save-button.is-saved {
    background-color: #a9dfbd;
    color: #173221;
  }
  html.aphro-dark body.aphro-theme-enabled :is(.account-address-item.is-default, .account-payment-item.is-default) {
    border-color: var(--aphro-theme-accent);
  }
  html.aphro-dark body.aphro-theme-enabled :is(
    .cart-page__header span, .cart-drawer__title > span, .thankyou-status-icon
  ) {
    background-color: var(--aphro-theme-raised);
    color: var(--aphro-theme-accent);
  }
  html.aphro-dark body.aphro-theme-enabled .cart-drawer__title > span::first-letter { color: inherit; }
  html.aphro-dark body.aphro-theme-enabled .coupon-row {
    border-color: var(--aphro-theme-border);
  }
  html.aphro-dark body.aphro-theme-enabled .coupon-row strong {
    background-color: #3e321d;
    color: #f0d58d;
  }
  html.aphro-dark body.aphro-theme-enabled .coupon-row span { color: var(--aphro-theme-text); }
  html.aphro-dark body.aphro-theme-enabled .coupon-row button {
    background-color: #f0d58d;
    color: #302610;
  }
  html.aphro-dark body.aphro-theme-enabled .coupon-row button.is-copied {
    background-color: #a9dfbd;
    color: #173221;
  }

  html.aphro-dark body.aphro-theme-enabled :is(
    .cart-page__shipping, .cart-drawer__shipping, .cart-row__qty, .cart-drawer__qty
  ) { border-color: var(--aphro-theme-border); }
  html.aphro-dark body.aphro-theme-enabled :is(
    .cart-row__qty button, .cart-row__qty input,
    .cart-drawer__qty button, .cart-drawer__qty input
  ) {
    background-color: var(--aphro-theme-raised);
    color: var(--aphro-theme-text);
    border-color: #89717f;
  }
  html.aphro-dark body.aphro-theme-enabled :is(.orders-list-scroll, .cart-drawer__items) {
    scrollbar-color: var(--aphro-theme-border) var(--aphro-theme-bg);
  }
  html.aphro-dark body.aphro-theme-enabled :is(.orders-list-scroll, .cart-drawer__items)::-webkit-scrollbar-track {
    background-color: var(--aphro-theme-bg);
  }
  html.aphro-dark body.aphro-theme-enabled :is(.orders-list-scroll, .cart-drawer__items)::-webkit-scrollbar-thumb {
    background-color: var(--aphro-theme-border);
  }

  /* This chooser is site-owned markup verified in the live checkout. Its
   * template emits a late style block, so scoped selectors intentionally win
   * over those light defaults without changing selection or payment behavior. */
  html.aphro-dark body.aphro-theme-enabled .aphro-nowpayments-chooser {
    background-color: var(--aphro-theme-surface);
    border-color: var(--aphro-theme-border);
  }
  html.aphro-dark body.aphro-theme-enabled :is(
    .aphro-nowpayments-chooser__title, .aphro-nowpayments-currency-card__name
  ) { color: var(--aphro-theme-text); }
  html.aphro-dark body.aphro-theme-enabled :is(
    .aphro-nowpayments-chooser__hint, .aphro-nowpayments-chooser__footnote,
    .aphro-nowpayments-currency-card__network, .aphro-nowpayments-currency-card__code,
    .aphro-nowpayments-disclaimer
  ) { color: var(--aphro-theme-muted); }
  html.aphro-dark body.aphro-theme-enabled .aphro-nowpayments-currency-card__body {
    background-color: var(--aphro-theme-raised);
    border-color: #89717f;
  }
  html.aphro-dark body.aphro-theme-enabled .aphro-nowpayments-currency-card__icon {
    background-color: var(--aphro-theme-bg);
    color: var(--aphro-theme-text);
  }
  html.aphro-dark body.aphro-theme-enabled .aphro-nowpayments-currency-card > input:checked + .aphro-nowpayments-currency-card__body {
    background-color: #49303e;
    border-color: var(--aphro-theme-accent);
    box-shadow: 0 0 0 2px rgba(240, 161, 178, .28);
  }
  html.aphro-dark body.aphro-theme-enabled .aphro-nowpayments-currency-card > input:checked + .aphro-nowpayments-currency-card__body .aphro-nowpayments-currency-card__icon {
    background-color: var(--aphro-theme-accent);
    color: var(--aphro-theme-on-accent);
  }
  html.aphro-dark body.aphro-theme-enabled .aphro-nowpayments-currency-card > input:focus-visible + .aphro-nowpayments-currency-card__body {
    outline-color: var(--aphro-theme-accent);
  }

  /* Contact form has its own generated ID rules and country-picker palette. */
  html.aphro-dark body.aphro-theme-enabled .wcemp-lead-form {
    --wcemp-surface: var(--aphro-theme-surface);
    --wcemp-text: var(--aphro-theme-text);
    --wcemp-muted: var(--aphro-theme-muted);
    --wcemp-soft: var(--aphro-theme-raised);
    --wcemp-border: var(--aphro-theme-border);
    --wcemp-border-strong: var(--aphro-theme-muted);
    --wcemp-primary: var(--aphro-theme-accent);
    --wcemp-focus: rgba(240, 161, 178, .2);
  }
  html.aphro-dark body.aphro-theme-enabled :is(.contact-info__item, .contact-info__icon) {
    border-color: var(--aphro-theme-border);
  }
  html.aphro-dark body.aphro-theme-enabled .contact-info__icon {
    background-color: var(--aphro-theme-raised);
  }
  html.aphro-dark body.aphro-theme-enabled .wcemp-lead-form-title {
    color: var(--aphro-theme-text);
  }
  html.aphro-dark body.aphro-theme-enabled #wcemp-lead-form-1 :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
    textarea, select, .wcemp-country-picker-button, .wcemp-country-search
  ) {
    background-color: var(--aphro-theme-surface);
    color: var(--aphro-theme-text);
    border-color: #89717f;
  }
  html.aphro-dark body.aphro-theme-enabled #wcemp-lead-form-1 :is(input, textarea)::placeholder {
    color: var(--aphro-theme-muted);
  }
  html.aphro-dark body.aphro-theme-enabled #wcemp-lead-form-1 :is(
    input, textarea, select, .wcemp-country-picker-button, .wcemp-country-search
  ):focus-visible {
    border-color: var(--aphro-theme-accent);
    outline-color: var(--aphro-theme-accent);
  }
  html.aphro-dark body.aphro-theme-enabled #wcemp-lead-form-1 .wcemp-lead-form-submit {
    background-color: var(--aphro-theme-accent);
    color: var(--aphro-theme-on-accent);
  }
  html.aphro-dark body.aphro-theme-enabled .wcemp-country-picker-button::after {
    border-top-color: var(--aphro-theme-muted);
  }
  html.aphro-dark body.aphro-theme-enabled .wcemp-lead-form .required { color: #ffb4c2; }
  html.aphro-dark body.aphro-theme-enabled .wcemp-lead-form-message {
    background-color: #19343e;
    color: #a6dced;
  }
  html.aphro-dark body.aphro-theme-enabled .wcemp-message .success {
    background-color: #20382a;
    color: #a9dfbd;
  }
  html.aphro-dark body.aphro-theme-enabled .wcemp-message .error {
    background-color: #43232c;
    color: #ffb4c2;
  }
  html.aphro-dark body.aphro-theme-enabled .j17track-track-form::before {
    color: var(--aphro-theme-muted);
    opacity: 1;
  }
  html.aphro-dark body.aphro-theme-enabled .j17track-track-form input::placeholder {
    color: var(--aphro-theme-muted);
    opacity: 1;
  }
}
