/**
 * RX Direct Child — My Account redesign.
 *
 * Restyles the WooCommerce account page (parent myaccount templates + woopw
 * prescription views + WC core endpoints) to the refreshed teal/navy design
 * system. DESIGN ONLY — no markup, hooks, or logic are changed; the parent
 * templates and their JS (login/register tab switch, etc.) stay intact.
 *
 * Loaded only on is_account_page() (see functions.php). Scoped under
 * body.rx-direct-refreshed.rxd-account-page so nothing leaks elsewhere.
 *
 * @package RX_Direct_Child
 */

/* ============================================================
   Shell / container
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page .woocommerce{
  max-width:1140px;
  margin:0 auto;
  padding:8px 20px 72px;
}
body.rx-direct-refreshed.rxd-account-page{
  background:
    radial-gradient(900px 420px at 90% -8%, rgba(84,191,180,.10), transparent 60%),
    linear-gradient(180deg, var(--bg-soft) 0%, #fff 320px);
}
/* default-page-template title above the account content */
body.rx-direct-refreshed.rxd-account-page .entry-title,
body.rx-direct-refreshed.rxd-account-page .page-title,
body.rx-direct-refreshed.rxd-account-page h1.entry-title{
  font-family:var(--display) !important;
  color:var(--navy) !important;
  text-align:center;
}

/* back-to-dashboard / log-out buttons (parent woocommerce.php) */
body.rx-direct-refreshed.rxd-account-page .my-account-action-wrapper{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:12px;
  margin:0 0 30px;
}

/* ============================================================
   Shared button styling (theme-btn / WC buttons -> teal pill)
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page .theme-btn,
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content .button,
body.rx-direct-refreshed.rxd-account-page .woocommerce-Button,
body.rx-direct-refreshed.rxd-account-page button.woocommerce-button,
body.rx-direct-refreshed.rxd-account-page .nav-cta-block a:not(.theme-btn-s4),
body.rx-direct-refreshed.rxd-account-page .woocommerce-form-login__submit,
body.rx-direct-refreshed.rxd-account-page .woocommerce-form-register__submit{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:11px 24px !important;
  border-radius:999px !important;
  border:1.5px solid var(--teal) !important;
  background:var(--teal) !important;
  color:#fff !important;
  font-family:var(--body) !important;
  font-size:.95rem !important;
  font-weight:600 !important;
  line-height:1.3 !important;
  text-transform:none !important;
  text-decoration:none !important;
  box-shadow:none !important;
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,transform .18s ease;
}
body.rx-direct-refreshed.rxd-account-page .theme-btn:hover,
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content .button:hover,
body.rx-direct-refreshed.rxd-account-page .woocommerce-Button:hover,
body.rx-direct-refreshed.rxd-account-page button.woocommerce-button:hover,
body.rx-direct-refreshed.rxd-account-page .nav-cta-block a:not(.theme-btn-s4):hover,
body.rx-direct-refreshed.rxd-account-page .woocommerce-form-login__submit:hover,
body.rx-direct-refreshed.rxd-account-page .woocommerce-form-register__submit:hover{
  background:var(--navy) !important;
  border-color:var(--navy) !important;
  color:#fff !important;
  transform:translateY(-1px);
}
/* secondary / outline button */
body.rx-direct-refreshed.rxd-account-page .theme-btn-s4,
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content .button.alt-outline{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:11px 24px !important;
  border-radius:999px !important;
  border:1.5px solid var(--teal-line) !important;
  background:#fff !important;
  color:var(--navy) !important;
  font-family:var(--body) !important;
  font-size:.95rem !important;
  font-weight:600 !important;
  text-transform:none !important;
  text-decoration:none !important;
  transition:background .18s ease,border-color .18s ease,color .18s ease;
}
body.rx-direct-refreshed.rxd-account-page .theme-btn-s4:hover,
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content .button.alt-outline:hover{
  background:var(--teal-soft) !important;
  border-color:var(--teal) !important;
  color:var(--navy) !important;
}

/* ============================================================
   Dashboard navigation — card grid
   (parent navigation.php: .woocommerce-MyAccount-navigation
    .row > .nav-card-wrapper > .nav-card)
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation{
  float:none !important;
  width:100% !important;
  margin:0 0 8px !important;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .row{
  display:grid !important;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:22px;
  margin:0 !important;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .nav-card-wrapper{
  width:auto !important;
  max-width:none !important;
  flex:none !important;
  margin:0 !important;
  padding:0 !important;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .nav-card{
  display:flex;
  flex-direction:column;
  height:100%;
  gap:12px;
  padding:26px 24px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .nav-card:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow-md);
  border-color:var(--teal-line);
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .nav-card h2,
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .nav-content-wrapper h2{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 !important;
  font-family:var(--display) !important;
  font-size:1.2rem !important;
  font-weight:600 !important;
  color:var(--navy) !important;
  line-height:1.2;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .nav-card h2 a{
  color:inherit;
  text-decoration:none;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .nav-card .counter{
  display:inline-grid;
  place-items:center;
  min-width:24px;
  height:24px;
  padding:0 7px;
  border-radius:999px;
  background:var(--teal);
  color:#fff;
  font-family:var(--body);
  font-size:.75rem;
  font-weight:700;
  line-height:1;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .card-short-content{
  flex:1;
  color:var(--muted);
  font-size:.95rem;
  line-height:1.6;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .nav-cta-block{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:auto;
}

/* ============================================================
   Login / Register (parent form-login.php)
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page .my-account-form-wrapper{
  max-width:520px;
  margin:24px auto 0;
}
body.rx-direct-refreshed.rxd-account-page .my-account-form-wrapper .main-heading{
  font-family:var(--display) !important;
  font-size:clamp(1.6rem,3vw,2.1rem) !important;
  font-weight:600 !important;
  color:var(--navy) !important;
}
body.rx-direct-refreshed.rxd-account-page .login-wrapper{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-md);
  padding:30px 30px 34px;
}
/* Login / Register segmented toggle */
body.rx-direct-refreshed.rxd-account-page .login-wrapper .switch-wrapper ul{
  display:flex;
  gap:6px;
  margin:0 0 24px;
  padding:6px;
  list-style:none;
  background:var(--bg-soft);
  border:1px solid var(--border);
  border-radius:999px;
}
body.rx-direct-refreshed.rxd-account-page .login-wrapper .switch-wrapper li.switch{
  flex:1;
  margin:0;
  padding:10px 16px;
  border-radius:999px;
  text-align:center;
  font-family:var(--body);
  font-weight:600;
  font-size:.95rem;
  color:var(--muted);
  cursor:pointer;
  transition:background .18s ease,color .18s ease;
}
body.rx-direct-refreshed.rxd-account-page .login-wrapper .switch-wrapper li.switch.active{
  background:var(--teal);
  color:#fff;
}
body.rx-direct-refreshed.rxd-account-page .login-wrapper #customer_login h2,
body.rx-direct-refreshed.rxd-account-page .my-account-form-wrapper #woo-register h2{
  font-family:var(--display) !important;
  font-size:1.25rem !important;
  font-weight:600 !important;
  color:var(--navy) !important;
}

/* ============================================================
   Forms — inputs / labels (login, register, edit-account, addresses)
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page form .form-row,
body.rx-direct-refreshed.rxd-account-page form .woocommerce-form-row{
  margin:0 0 16px;
}
body.rx-direct-refreshed.rxd-account-page form label{
  display:block;
  margin:0 0 7px;
  font-family:var(--body);
  font-size:.88rem;
  font-weight:600;
  color:var(--navy);
}
body.rx-direct-refreshed.rxd-account-page form .input-text,
body.rx-direct-refreshed.rxd-account-page form input[type="text"],
body.rx-direct-refreshed.rxd-account-page form input[type="email"],
body.rx-direct-refreshed.rxd-account-page form input[type="tel"],
body.rx-direct-refreshed.rxd-account-page form input[type="password"],
body.rx-direct-refreshed.rxd-account-page form input[type="number"],
body.rx-direct-refreshed.rxd-account-page form select,
body.rx-direct-refreshed.rxd-account-page form textarea{
  width:100%;
  min-height:48px;
  padding:11px 15px;
  border:1.5px solid var(--teal-line);
  border-radius:12px;
  background:#fff;
  color:var(--ink);
  font-family:var(--body);
  font-size:.97rem;
  line-height:1.4;
  transition:border-color .18s ease,box-shadow .18s ease;
}
body.rx-direct-refreshed.rxd-account-page form textarea{ min-height:120px; }
body.rx-direct-refreshed.rxd-account-page form .input-text:focus,
body.rx-direct-refreshed.rxd-account-page form input:focus,
body.rx-direct-refreshed.rxd-account-page form select:focus,
body.rx-direct-refreshed.rxd-account-page form textarea:focus{
  outline:none;
  border-color:var(--teal);
  box-shadow:0 0 0 3px rgba(84,191,180,.18);
}
body.rx-direct-refreshed.rxd-account-page .required{ color:var(--teal); border:0; }
body.rx-direct-refreshed.rxd-account-page form .woocommerce-form-login__rememberme{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:500;
  color:var(--muted);
}
body.rx-direct-refreshed.rxd-account-page form .woocommerce-form-login__rememberme input{
  width:auto;
  min-height:0;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-LostPassword a,
body.rx-direct-refreshed.rxd-account-page .lost_password a{
  color:var(--teal);
  font-weight:600;
  text-decoration:none;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-LostPassword a:hover,
body.rx-direct-refreshed.rxd-account-page .lost_password a:hover{
  color:var(--navy);
  text-decoration:underline;
}
/* password strength hint */
body.rx-direct-refreshed.rxd-account-page .woocommerce-password-strength{
  border-radius:10px;
  font-size:.85rem;
  font-weight:600;
}

/* ============================================================
   MyAccount content panel
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content{
  float:none !important;
  width:100% !important;
  margin:0 auto;
  padding:30px 30px 34px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content > p:first-child{ margin-top:0; }
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content h2,
body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content h3{
  font-family:var(--display);
  color:var(--navy);
}

/* Orders / downloads tables */
body.rx-direct-refreshed.rxd-account-page .woocommerce-orders-table,
body.rx-direct-refreshed.rxd-account-page .woocommerce-table,
body.rx-direct-refreshed.rxd-account-page .shop_table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-orders-table thead th,
body.rx-direct-refreshed.rxd-account-page .shop_table thead th{
  padding:14px 16px;
  background:var(--teal-soft);
  color:var(--navy);
  font-family:var(--body);
  font-weight:700;
  font-size:.82rem;
  letter-spacing:.04em;
  text-transform:uppercase;
  text-align:left;
  border:0;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-orders-table tbody td,
body.rx-direct-refreshed.rxd-account-page .shop_table tbody td{
  padding:14px 16px;
  border:0;
  border-top:1px solid var(--border);
  color:var(--ink);
  font-size:.95rem;
  vertical-align:middle;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-orders-table tbody tr:hover td{
  background:var(--bg-soft);
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-orders-table .button{
  min-height:38px;
  padding:7px 16px !important;
  font-size:.85rem !important;
}

/* Addresses */
body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:22px;
  margin-top:6px;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-Address{
  margin:0 !important;
  padding:24px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-Address-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-Address-title h2,
body.rx-direct-refreshed.rxd-account-page .woocommerce-Address-title h3{
  margin:0;
  font-family:var(--display);
  font-size:1.15rem;
  color:var(--navy);
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-Address address{
  color:var(--muted);
  font-style:normal;
  line-height:1.7;
}

/* order details / totals table */
body.rx-direct-refreshed.rxd-account-page .woocommerce-order-details,
body.rx-direct-refreshed.rxd-account-page .woocommerce-customer-details{
  margin-top:28px;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-column__title,
body.rx-direct-refreshed.rxd-account-page .woocommerce-order-details__title{
  font-family:var(--display);
  color:var(--navy);
}

/* ============================================================
   Notices (info / success / error)
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page .woocommerce-message,
body.rx-direct-refreshed.rxd-account-page .woocommerce-info,
body.rx-direct-refreshed.rxd-account-page .woocommerce-error{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px 14px;
  margin:0 0 22px;
  padding:14px 18px;
  border:1px solid var(--border);
  border-left:4px solid var(--teal);
  border-radius:12px;
  background:#fff;
  color:var(--ink);
  list-style:none;
  box-shadow:var(--shadow-sm);
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-error{
  border-left-color:#d9534f;
  background:#fdf2f2;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-message .button,
body.rx-direct-refreshed.rxd-account-page .woocommerce-info .button{
  margin-left:auto;
}

/* pagination */
body.rx-direct-refreshed.rxd-account-page .woocommerce-pagination ul{
  display:flex;
  justify-content:center;
  gap:8px;
  list-style:none;
  padding:0;
  margin:26px 0 0;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-pagination ul li a,
body.rx-direct-refreshed.rxd-account-page .woocommerce-pagination ul li span{
  display:grid;
  place-items:center;
  min-width:40px;
  height:40px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:10px;
  color:var(--navy);
  font-weight:600;
  text-decoration:none;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-pagination ul li .current{
  background:var(--teal);
  border-color:var(--teal);
  color:#fff;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width:991px){
  body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .row{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:640px){
  body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-navigation .row,
  body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses{
    grid-template-columns:1fr;
  }
  body.rx-direct-refreshed.rxd-account-page .woocommerce-MyAccount-content,
  body.rx-direct-refreshed.rxd-account-page .login-wrapper{
    padding:22px 18px 26px;
  }
  body.rx-direct-refreshed.rxd-account-page .woocommerce-orders-table thead{
    display:none;
  }
  body.rx-direct-refreshed.rxd-account-page .woocommerce-orders-table tbody td{
    display:flex;
    justify-content:space-between;
    gap:16px;
    text-align:right;
  }
  body.rx-direct-refreshed.rxd-account-page .woocommerce-orders-table tbody td::before{
    content:attr(data-title);
    font-weight:700;
    color:var(--navy);
    text-align:left;
  }
}

/* ============================================================
   Corrections from live inspection
   - address cards: cancel WooCommerce's float + 48% width
     (woocommerce-layout.css .col2-set .col-1{width:48%}) so each
     card fills its grid cell.
   - real account buttons are .theme-btn-primary (Back to Dashboard)
     and .theme-btn-third (Log Out, was white-on-light = invisible).
   - title sits in parent .woo-myaccount-banner-section.
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses .woocommerce-Address{
  float:none !important;
  width:auto !important;
  max-width:none !important;
  flex:none !important;
}
/* Edit Billing / Shipping address links */
body.rx-direct-refreshed.rxd-account-page .woocommerce-Address-title a,
body.rx-direct-refreshed.rxd-account-page .woocommerce-Address-title a.edit{
  flex:0 0 auto;
  color:var(--teal);
  font-size:.9rem;
  font-weight:600;
  text-decoration:none;
  white-space:nowrap;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-Address-title a:hover{
  color:var(--navy);
  text-decoration:underline;
}

/* account title banner */
body.rx-direct-refreshed.rxd-account-page .woo-myaccount-banner-section{
  padding:30px 0 !important;
  background:var(--bg-soft);
}
body.rx-direct-refreshed.rxd-account-page .woo-myaccount-banner-section .col-lg-12.text-center{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
body.rx-direct-refreshed.rxd-account-page .woo-myaccount-banner-section h1{
  margin:0 !important;
  font-family:var(--display) !important;
  font-size:clamp(1.6rem,3vw,2.2rem) !important;
  font-weight:600 !important;
  color:var(--navy) !important;
}
body.rx-direct-refreshed.rxd-account-page .woo-myaccount-banner-section .col-lg-12.text-center > a{
  margin:0 !important;
}

/* Back to Account Dashboard (primary -> teal pill) */
body.rx-direct-refreshed.rxd-account-page .theme-btn-primary{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:10px 22px !important;
  border-radius:999px !important;
  border:1.5px solid var(--teal) !important;
  background:var(--teal) !important;
  color:#fff !important;
  font-family:var(--body) !important;
  font-size:.92rem !important;
  font-weight:600 !important;
  line-height:1.3 !important;
  text-transform:none !important;
  text-decoration:none !important;
  box-shadow:none !important;
  transition:background .18s ease,border-color .18s ease,transform .18s ease;
}
body.rx-direct-refreshed.rxd-account-page .theme-btn-primary:hover{
  background:var(--navy) !important;
  border-color:var(--navy) !important;
  color:#fff !important;
  transform:translateY(-1px);
}
/* Log Out (third -> outline pill; was invisible white text) */
body.rx-direct-refreshed.rxd-account-page .theme-btn-third{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:10px 22px !important;
  border-radius:999px !important;
  border:1.5px solid var(--teal-line) !important;
  background:#fff !important;
  color:var(--navy) !important;
  font-family:var(--body) !important;
  font-size:.92rem !important;
  font-weight:600 !important;
  line-height:1.3 !important;
  text-transform:none !important;
  text-decoration:none !important;
  box-shadow:none !important;
  transition:background .18s ease,border-color .18s ease,color .18s ease;
}
body.rx-direct-refreshed.rxd-account-page .theme-btn-third:hover{
  background:var(--teal-soft) !important;
  border-color:var(--teal) !important;
  color:var(--navy) !important;
}

/* ============================================================
   Addresses — force a clean 2-up grid with explicit cell placement.
   The two cards were auto-flowing DIAGONALLY on the live page (card 1 ->
   col 2 row 1, card 2 -> col 1 row 2) despite a normal 2-col grid. Pinning
   each card to its cell with grid-area removes the reliance on auto-flow.
   Verified live: both cards same row, left/right columns.
   ============================================================ */
body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  grid-auto-flow:row !important;
  gap:22px !important;
  align-items:start !important;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses > .woocommerce-Address{
  float:none !important;
  width:auto !important;
  max-width:none !important;
  min-width:0 !important;
  margin:0 !important;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses > .woocommerce-Address:nth-of-type(1){
  grid-area:1 / 1 !important;
}
body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses > .woocommerce-Address:nth-of-type(2){
  grid-area:1 / 2 !important;
}
@media (max-width:640px){
  body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses{
    grid-template-columns:1fr !important;
  }
  body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses > .woocommerce-Address:nth-of-type(1),
  body.rx-direct-refreshed.rxd-account-page .woocommerce-Addresses > .woocommerce-Address:nth-of-type(2){
    grid-area:auto !important;
  }
}
