:root {
  --ma-blue: #4f80e7;
  --ma-cream: #fdf9ef;
  --ma-ink: #242424;
  --ma-muted: #716e68;
  --ma-border: #ebe5da;
}

body.woocommerce-account #wrapper > [role="main"] {
  padding: clamp(55px, 7vw, 100px) 24px clamp(80px, 9vw, 130px);
  background: #fff;
}

body.woocommerce-account #wrapper > [role="main"] > .row,
body.woocommerce-account #wrapper > [role="main"] .woocommerce {
  width: min(100%, 1180px);
  max-width: 1180px;
  margin-inline: auto;
}

body.woocommerce-account .woocommerce {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 70px);
  align-items: start;
}

body.woocommerce-account .woocommerce-MyAccount-navigation {
  width: 100% !important;
  margin: 0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 10px;
  list-style: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation li { margin: 0; }

body.woocommerce-account .woocommerce-MyAccount-navigation a {
  display: flex;
  min-height: 52px;
  padding: 12px 18px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--ma-border);
  border-radius: 12px;
  background: #fff;
  color: var(--ma-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

body.woocommerce-account .woocommerce-MyAccount-navigation a::after {
  color: currentColor;
  font-size: 18px;
  content: "→";
}

body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a,
body.woocommerce-account .woocommerce-MyAccount-navigation a:hover {
  border-color: var(--ma-blue);
  background: var(--ma-blue);
  color: #fff;
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--customer-logout a {
  margin-top: 8px;
  color: #a33b31;
}

body.woocommerce-account .woocommerce-MyAccount-content {
  width: 100% !important;
  min-width: 0;
  margin: 0 !important;
  padding: clamp(25px, 3.5vw, 44px);
  border: 1px solid var(--ma-border);
  border-radius: 22px;
  background: var(--ma-cream);
  color: var(--ma-ink);
  box-shadow: 0 14px 42px rgba(54, 76, 118, .07);
}

body.woocommerce-account .woocommerce-MyAccount-content > :first-child { margin-top: 0; }
body.woocommerce-account .woocommerce-MyAccount-content > :last-child { margin-bottom: 0; }

body.woocommerce-account .woocommerce-MyAccount-content h2,
body.woocommerce-account .woocommerce-MyAccount-content h3,
body.woocommerce-account .woocommerce-Addresses .woocommerce-Address-title h3 {
  color: var(--ma-ink);
  font-family: Lora, Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -.03em;
}

body.woocommerce-account .woocommerce-MyAccount-content p {
  color: var(--ma-muted);
  font-size: 15px;
  line-height: 1.75;
}

body.woocommerce-account .woocommerce-MyAccount-content a:not(.button) { color: var(--ma-blue); }

body.woocommerce-account .woocommerce-MyAccount-content .button,
body.woocommerce-account .woocommerce-form-login .button,
body.woocommerce-account .woocommerce-form-register .button {
  display: inline-flex;
  min-height: 48px;
  padding: 11px 22px !important;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ma-blue) !important;
  border-radius: 999px !important;
  background: var(--ma-blue) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-decoration: none;
  text-transform: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-content .button:hover { background: #fff !important; color: var(--ma-blue) !important; }

body.woocommerce-account table.shop_table {
  overflow: hidden;
  border: 1px solid var(--ma-border) !important;
  border-radius: 14px !important;
  background: #fff;
  border-collapse: separate !important;
  border-spacing: 0;
}

body.woocommerce-account table.shop_table th,
body.woocommerce-account table.shop_table td { padding: 15px !important; border-color: var(--ma-border) !important; }
body.woocommerce-account table.shop_table th { background: #edf5fc; color: var(--ma-ink); font-size: 13px; }

body.woocommerce-account .woocommerce-Addresses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

body.woocommerce-account .woocommerce-Addresses .woocommerce-Address {
  width: 100% !important;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--ma-border);
  border-radius: 14px;
  background: #fff;
  box-sizing: border-box;
}

body.woocommerce-account form .form-row { margin-bottom: 18px; }
body.woocommerce-account form label { margin-bottom: 7px; color: var(--ma-ink); font-size: 14px; font-weight: 600; }
body.woocommerce-account form input.input-text,
body.woocommerce-account form select,
body.woocommerce-account form textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 15px !important;
  border: 1px solid var(--ma-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

body.woocommerce-account:not(.logged-in) .woocommerce {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

body.woocommerce-account:not(.logged-in) .woocommerce > h2,
body.woocommerce-account:not(.logged-in) .woocommerce > form {
  grid-column: auto;
}

body.woocommerce-account:not(.logged-in) form.login,
body.woocommerce-account:not(.logged-in) form.register,
body.woocommerce-account:not(.logged-in) form.lost_reset_password {
  margin: 0;
  padding: 30px;
  border: 1px solid var(--ma-border);
  border-radius: 20px;
  background: var(--ma-cream);
}

@media (max-width: 800px) {
  body.woocommerce-account .woocommerce { grid-template-columns: 1fr; gap: 28px; }
  body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex;
    padding-bottom: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation li { flex: 0 0 auto; scroll-snap-align: start; }
  body.woocommerce-account .woocommerce-MyAccount-navigation a { min-height: 46px; white-space: nowrap; }
  body.woocommerce-account .woocommerce-MyAccount-navigation a::after { display: none; }
  body.woocommerce-account .woocommerce-Addresses,
  body.woocommerce-account:not(.logged-in) .woocommerce { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body.woocommerce-account #wrapper > [role="main"] { padding-inline: 16px; }
  body.woocommerce-account .woocommerce-MyAccount-content { padding: 22px 18px; border-radius: 17px; }
  body.woocommerce-account table.shop_table_responsive thead { display: none; }
  body.woocommerce-account table.shop_table_responsive tr { display: block; padding: 9px 0; }
  body.woocommerce-account table.shop_table_responsive td { display: flex !important; justify-content: space-between; gap: 20px; text-align: right !important; }
}

/* Milksy account journey: shared public login and authenticated account shell. */
body.milksy-account-redesign {
  --ma-blue: #4f80e7;
  --ma-blue-soft: #eaf2ff;
  --ma-cream: #fbf8ee;
  --ma-paper: #fffdf8;
  --ma-surface: #fff;
  --ma-ink: #181818;
  --ma-muted: #6d6b67;
  --ma-border: #e5e0d5;
  background: var(--ma-paper);
}

body.milksy-account-redesign #wrapper,
body.milksy-account-redesign #primary,
body.milksy-account-redesign #wrapper > [role="main"] { background: var(--ma-paper) !important; }

body.milksy-account-redesign #wrapper > [role="main"],
body.milksy-account-redesign #primary { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }

.msa-hero,
.msa-hero * { box-sizing: border-box; }

.msa-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ma-cream);
}

.msa-hero__texture {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: min(780px, 56vw);
  background: url('../images/brand/milksy-texture-01.webp') center / cover no-repeat;
  opacity: .11;
  pointer-events: none;
}

.msa-hero__inner {
  display: grid;
  width: min(1180px, calc(100% - 56px));
  min-height: 500px;
  margin-inline: auto;
  padding: 72px 0;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .82fr);
  gap: clamp(50px, 8vw, 100px);
  align-items: center;
}

.msa-hero__copy h1 {
  max-width: 670px;
  margin: 0 0 22px;
  color: var(--ma-ink);
  font-family: Lora, Georgia, serif;
  font-size: clamp(47px, 5.2vw, 74px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.02;
}

.msa-hero__copy > p:not(.msp-system-eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--ma-muted);
  font-size: 18px;
  line-height: 1.7;
}

.msp-system-eyebrow {
  margin: 0 0 16px;
  color: var(--ma-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1.45;
  text-transform: uppercase;
}

.msa-hero__benefits {
  display: grid;
  margin: 0;
  padding: 22px;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  background: rgba(255,255,255,.8);
  box-shadow: 0 22px 58px rgba(43, 62, 97, .11);
  list-style: none;
  backdrop-filter: blur(7px);
}

.msa-hero__benefits li {
  display: grid;
  min-height: 72px;
  padding: 15px 17px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-radius: 17px;
  background: var(--ma-surface);
  color: var(--ma-ink);
  font-weight: 700;
}

.msa-hero__benefits svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: var(--ma-blue-soft);
  fill: none;
  stroke: var(--ma-blue);
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msa-content {
  padding: clamp(70px, 8vw, 112px) 28px clamp(90px, 10vw, 140px);
  background: var(--ma-paper);
}

.msa-content > article.milksy-entry {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.msa-content .milksy-entry__content,
.msa-content .woocommerce { width: 100%; max-width: none; margin: 0; }

body.milksy-account-redesign .msa-content .woocommerce {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  gap: clamp(30px, 5vw, 68px);
  align-items: start;
}

body.milksy-account-redesign:not(.logged-in) .msa-content .woocommerce {
  display: block;
  width: min(720px, 100%);
  margin-inline: auto;
}

body.milksy-account-redesign:not(.logged-in) .msa-content .woocommerce > h2 {
  margin: 0 0 25px;
  color: var(--ma-ink);
  font-family: Lora, Georgia, serif;
  font-size: clamp(31px, 3vw, 42px);
  text-align: center;
}

body.milksy-account-redesign:not(.logged-in) .msa-content form.login,
body.milksy-account-redesign:not(.logged-in) .msa-content form.register,
body.milksy-account-redesign:not(.logged-in) .msa-content form.lost_reset_password {
  width: 100%;
  margin: 0 !important;
  padding: clamp(25px, 4vw, 44px) !important;
  border: 1px solid var(--ma-border) !important;
  border-radius: 25px !important;
  background: var(--ma-surface) !important;
  box-shadow: 0 18px 52px rgba(42, 57, 86, .08);
}

body.milksy-account-redesign:not(.logged-in) .msa-content form.lost_reset_password > p:first-child {
  margin-top: 0;
  color: var(--ma-muted);
  font-size: 16px;
  line-height: 1.7;
}

body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 26px;
}

body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce > h2:nth-of-type(1),
body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce > form.login { grid-column: 1; }
body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce > h2:nth-of-type(2),
body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce > form.register { grid-column: 2; }

body.milksy-account-redesign .msa-content .woocommerce-MyAccount-navigation a {
  border-color: var(--ma-border);
  background: var(--ma-surface);
  color: var(--ma-ink);
}

body.milksy-account-redesign .msa-content .woocommerce-MyAccount-content {
  border-color: var(--ma-border);
  background: var(--ma-surface);
  color: var(--ma-ink);
}

body.milksy-account-redesign .msa-content form label,
body.milksy-account-redesign .msa-content .woocommerce-form-login label,
body.milksy-account-redesign .msa-content .woocommerce-form-register label { color: var(--ma-ink) !important; }

body.milksy-account-redesign .msa-content form input.input-text,
body.milksy-account-redesign .msa-content form input[type="text"],
body.milksy-account-redesign .msa-content form input[type="email"],
body.milksy-account-redesign .msa-content form input[type="password"],
body.milksy-account-redesign .msa-content form select,
body.milksy-account-redesign .msa-content form textarea {
  border-color: var(--ma-border) !important;
  background: var(--ma-paper) !important;
  color: var(--ma-ink) !important;
}

body.milksy-account-redesign .msa-content .woocommerce-LostPassword,
body.milksy-account-redesign .msa-content .woocommerce-privacy-policy-text,
body.milksy-account-redesign .msa-content .woocommerce-form__label-for-checkbox { color: var(--ma-muted); }
body.milksy-account-redesign .msa-content .woocommerce-LostPassword a { color: var(--ma-blue); font-weight: 700; }

html[data-milksy-theme="dark"] body.milksy-account-redesign {
  --ma-blue: #73a2ff;
  --ma-blue-soft: #233c60;
  --ma-cream: #111c2d;
  --ma-paper: #0f1724;
  --ma-surface: #18263a;
  --ma-ink: #fbf7ed;
  --ma-muted: #bcc8da;
  --ma-border: #344861;
}

html[data-milksy-theme="dark"] body.milksy-account-redesign .msa-hero__texture { opacity: .09; filter: saturate(.75) brightness(.72); }
html[data-milksy-theme="dark"] body.milksy-account-redesign .msa-hero__benefits { border-color: #334963; background: rgba(17, 28, 45, .78); box-shadow: none; }
html[data-milksy-theme="dark"] body.milksy-account-redesign .msa-content .woocommerce-MyAccount-content p,
html[data-milksy-theme="dark"] body.milksy-account-redesign .msa-content address { color: var(--ma-muted); }
html[data-milksy-theme="dark"] body.milksy-account-redesign .msa-content table.shop_table,
html[data-milksy-theme="dark"] body.milksy-account-redesign .msa-content table.shop_table th,
html[data-milksy-theme="dark"] body.milksy-account-redesign .msa-content .woocommerce-Addresses .woocommerce-Address { border-color: var(--ma-border) !important; background: var(--ma-surface); color: var(--ma-ink); }
html[data-milksy-theme="dark"] body.milksy-account-redesign .msa-content table.shop_table th { background: #20344f; color: var(--ma-ink); }

@media (max-width: 850px) {
  .msa-hero__inner { min-height: auto; grid-template-columns: 1fr; gap: 42px; }
  body.milksy-account-redesign .msa-content .woocommerce { grid-template-columns: 1fr; gap: 30px; }
  body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce { grid-template-columns: 1fr; }
  body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce > h2,
  body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce > form.login,
  body.milksy-account-registration-enabled:not(.logged-in) .msa-content .woocommerce > form.register { grid-column: 1; }
}

@media (max-width: 560px) {
  .msa-hero__inner { width: calc(100% - 36px); padding: 58px 0 64px; }
  .msa-hero__copy h1 { font-size: 43px; }
  .msa-hero__copy > p:not(.msp-system-eyebrow) { font-size: 16px; }
  .msa-hero__texture { width: 100%; opacity: .07; }
  .msa-hero__benefits { padding: 12px; border-radius: 22px; }
  .msa-hero__benefits li { min-height: 64px; padding: 12px; }
  .msa-content { padding: 64px 18px 95px; }
  body.milksy-account-redesign:not(.logged-in) .msa-content form.login,
  body.milksy-account-redesign:not(.logged-in) .msa-content form.register,
  body.milksy-account-redesign:not(.logged-in) .msa-content form.lost_reset_password { padding: 24px 20px !important; border-radius: 20px !important; }
}
