/*
 * Ómini V7 application extension.
 *
 * `style-omini` is the source of truth for the published V7 composition and
 * is loaded immediately before this file.  This layer only binds live commerce
 * and account content to that exact shell; it intentionally does not recreate
 * the header, logo, hero, account or footer geometry.
 */

:is(.commerce-declared, .customer-portal--commerce) {
  --omini-bg: #f3ede5;
  --omini-surface: #fbf8f4;
  --omini-ink: #2d1109;
  --omini-muted: #786052;
  --omini-clay: #d17f42;
  --omini-line: #dccdbf;
  --omini-night: #25100b;
  --omini-paper: #fffaf4;
  --omini-serif: Georgia, "Times New Roman", serif;
  --omini-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --omini-shadow: 0 20px 50px #2d110912;
  min-width: 320px;
  min-height: 100%;
  background: var(--omini-bg);
  color: var(--omini-ink);
  font-family: var(--omini-sans);
  font-synthesis: none;
}

:is(.commerce-declared, .customer-portal--commerce) *,
:is(.commerce-declared, .customer-portal--commerce) *::before,
:is(.commerce-declared, .customer-portal--commerce) *::after {
  box-sizing: border-box;
}

/* Literal V7 shell hooks: their composition is defined by style-omini. */
:is(.commerce-declared, .customer-portal--commerce) .site-header,
:is(.commerce-declared, .customer-portal--commerce) .site-footer {
  isolation: isolate;
}

:is(.commerce-declared, .customer-portal--commerce) .hero,
:is(.commerce-declared, .customer-portal--commerce) .hero-copy,
:is(.commerce-declared, .customer-portal--commerce) .hero-media,
:is(.commerce-declared, .customer-portal--commerce) .account,
:is(.commerce-declared, .customer-portal--commerce) .account-copy {
  min-width: 0;
}

:is(.commerce-declared, .customer-portal--commerce) .site-header .brand {
  flex-shrink: 0;
}

:is(.commerce-declared, .customer-portal--commerce) .site-header .brand img {
  max-width: 100%;
}

:is(.commerce-declared, .customer-portal--commerce) .site-header .site-nav {
  min-width: 0;
}

:is(.commerce-declared, .customer-portal--commerce) .site-header .site-nav [aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: .32em;
}

:is(.commerce-declared, .customer-portal--commerce) .hero-media img {
  display: block;
}

:is(.commerce-declared, .customer-portal--commerce) .site-header .site-nav .v7-bag-link {
  white-space: nowrap;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-status {
  max-width: 48rem;
  margin: 1.5rem auto 0;
  border: 1px solid var(--omini-line);
  background: var(--omini-paper);
  color: var(--omini-ink);
  padding: 1rem 1.15rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-status h2,
:is(.commerce-declared, .customer-portal--commerce) .v7-status h3,
:is(.commerce-declared, .customer-portal--commerce) .v7-status p {
  color: inherit;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-status p {
  margin-bottom: 0;
  font-size: .93rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-status ul {
  margin: .65rem 0 0;
  padding-left: 1.1rem;
}

/* The account section stays the original clay V7 panel.  The live form is
 * an inner paper surface so the form does not create a second visual theme. */
:is(.commerce-declared, .customer-portal--commerce) .account-copy > h1 {
  color: inherit;
  margin-bottom: 1rem;
  font-family: var(--omini-serif);
  font-size: clamp(2.35rem, 4.4vw, 5.15rem);
  font-weight: 400;
  letter-spacing: -.042em;
  line-height: .98;
}

:is(.commerce-declared, .customer-portal--commerce) .account .v7-login {
  width: min(100%, 30rem);
  margin-top: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--omini-paper) 72%, transparent);
  background: var(--omini-paper);
  color: var(--omini-ink);
  padding: clamp(1.25rem, 3vw, 2.1rem);
  text-align: left;
}

:is(.commerce-declared, .customer-portal--commerce) .account .v7-login h1,
:is(.commerce-declared, .customer-portal--commerce) .account .v7-login h2,
:is(.commerce-declared, .customer-portal--commerce) .account .v7-login h3,
:is(.commerce-declared, .customer-portal--commerce) .account .v7-login p {
  color: var(--omini-ink);
}

:is(.commerce-declared, .customer-portal--commerce) .v7-login form {
  display: grid;
  gap: 1rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-login label {
  display: grid;
  gap: .45rem;
  color: var(--omini-muted);
  font-size: .78rem;
  font-weight: 500;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-login input {
  width: 100%;
  min-height: 2.85rem;
  border: 1px solid var(--omini-line);
  border-radius: 0;
  background: var(--omini-bg);
  color: var(--omini-ink);
  padding: .7rem .8rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-login input:focus-visible {
  outline: 3px solid var(--omini-clay);
  outline-offset: 2px;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .7rem 1rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-remember {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--omini-muted);
  font-size: .78rem;
  font-weight: 500;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-remember input[type="checkbox"] {
  width: 1rem;
  min-height: 0;
  height: 1rem;
  margin: 0;
  accent-color: var(--omini-clay);
  padding: 0;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-actions a {
  color: var(--omini-ink);
  font-size: .78rem;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-login button[type="submit"] {
  width: 100%;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7rem 1rem;
  margin-top: 1.35rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-account-actions a,
:is(.commerce-declared, .customer-portal--commerce) .v7-account-actions button {
  min-height: 2.55rem;
  border: 1px solid color-mix(in srgb, var(--omini-paper) 70%, transparent);
  background: transparent;
  color: inherit;
  padding: .6rem .8rem;
  font-family: var(--omini-sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-account-actions a:hover,
:is(.commerce-declared, .customer-portal--commerce) .v7-account-actions button:hover {
  border-color: var(--omini-paper);
  background: var(--omini-paper);
  color: var(--omini-ink);
}

:is(.commerce-declared, .customer-portal--commerce) .v7-account-actions .button--paper {
  border-color: var(--omini-paper);
  background: var(--omini-paper);
  color: var(--omini-ink);
}

:is(.commerce-declared, .customer-portal--commerce) .v7-account-actions .button--paper:hover {
  border-color: var(--omini-clay);
  background: var(--omini-clay);
  color: var(--omini-ink);
}

:is(.commerce-declared, .customer-portal--commerce) .v7-login__meta {
  margin: .2rem 0 0;
  color: var(--omini-muted);
  font-size: .8rem;
}

/* Reuses the V7 account panel for real orders while keeping order state in
 * application-owned markup. */
:is(.commerce-declared, .customer-portal--commerce) .v7-orders-empty {
  width: 100%;
  margin-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--omini-paper) 64%, transparent);
  color: color-mix(in srgb, var(--omini-paper) 82%, transparent);
  padding-top: 1rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-orders {
  width: 100%;
  margin-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--omini-paper) 64%, transparent);
}

:is(.commerce-declared, .customer-portal--commerce) .v7-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  border-bottom: 1px solid color-mix(in srgb, var(--omini-paper) 64%, transparent);
  color: inherit;
  padding: 1rem 0;
  text-decoration: none;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-order:hover {
  color: var(--omini-paper);
}

:is(.commerce-declared, .customer-portal--commerce) .v7-order > span:first-child {
  display: grid;
  gap: .2rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-order > span:first-child > span {
  color: color-mix(in srgb, var(--omini-paper) 76%, transparent);
  font-size: .86rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-order > span:last-child {
  font-family: var(--omini-serif);
  font-size: 1.25rem;
  white-space: nowrap;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-account-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

:is(.commerce-declared, .customer-portal--commerce) .v7-account-heading .v2-buttonlink {
  color: inherit;
}

@media (width <= 760px) {
  :is(.commerce-declared, .customer-portal--commerce) .v7-order {
    grid-template-columns: 1fr;
    gap: .3rem;
  }

  :is(.commerce-declared, .customer-portal--commerce) .v7-account-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.commerce-declared, .customer-portal--commerce),
  :is(.commerce-declared, .customer-portal--commerce) *,
  :is(.commerce-declared, .customer-portal--commerce) *::before,
  :is(.commerce-declared, .customer-portal--commerce) *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Live commerce content occupies V7 editorial slots without creating a
 * second product-card system or changing the source page geometry. */
:is(.commerce-declared, .customer-portal--commerce) .commerce-product-photo {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: color-mix(in srgb, var(--omini-line) 58%, var(--omini-bg));
}

:is(.commerce-declared, .customer-portal--commerce) .commerce-product-photo > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The application-owned mobile control may reveal navigation, but the V7
 * source remains responsible for the nav, spacing, type and brand geometry. */
:is(.commerce-declared, .customer-portal--commerce) .v7-mobile-menu {
  display: none;
}

@media (width <= 760px) {
  :is(.commerce-declared, .customer-portal--commerce) .v7-mobile-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    padding: .5rem .7rem;
    font: 500 .72rem/1 var(--omini-sans);
    letter-spacing: .01em;
  }

  :is(.commerce-declared, .customer-portal--commerce) .v7-mobile-menu[hidden] {
    display: none;
  }
}
