/* Complete storefront pages. All visual tokens are supplied by Theme Customize. */
body:not(.fashion-home) {
  background: var(--fashion-bg);
  color: var(--fashion-text);
}

body:not(.fashion-home) #app > main {
  width: 100%;
  min-width: 0;
  background: var(--fashion-bg);
}

body:not(.fashion-home) :is(
  [ui-section="single-collection"],
  [ui-section="list-collections"],
  [ui-section="search"],
  [ui-section="cart"],
  [ui-section="page"],
  [ui-section="upsell"]
) {
  box-sizing: border-box;
  width: min(100%, var(--fashion-page-width));
  max-width: var(--fashion-page-width);
  margin-inline: auto;
  color: var(--fashion-text);
}

body:not(.fashion-home) :is(
  [ui-section="single-collection"],
  [ui-section="list-collections"],
  [ui-section="search"],
  [ui-section="cart"],
  [ui-section="page"],
  [ui-section="upsell"]
) > [ui-slot="head"] .heading {
  color: var(--fashion-text);
  font-family: var(--font-heading-family);
  font-size: clamp(30px, 3vw, 48px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.05;
}

body:not(.fashion-home) :is(input, textarea, select, [ui-slot="input"], [ui-slot="textarea"], [ui-slot="select"]) {
  border-color: var(--fashion-border) !important;
  border-radius: var(--fashion-input-radius) !important;
  background: var(--fashion-input-bg) !important;
  color: var(--fashion-text) !important;
}

body:not(.fashion-home) [ui-slot="button"] {
  border-radius: var(--fashion-button-radius) !important;
}

body:not(.fashion-home) [ui-slot="button"][data-mode="filled"],
body:not(.fashion-home) #checkout-button {
  border-color: var(--fashion-accent) !important;
  background: var(--fashion-accent) !important;
  color: var(--fashion-accent-text) !important;
}

body:not(.fashion-home) [ui-slot="button"][data-mode="stroke"] {
  border-color: var(--fashion-border) !important;
  background: transparent !important;
  color: var(--fashion-text) !important;
}

/* Header and footer follow the same quiet fashion system on every inner page. */
body:not(.fashion-home) [ui-layout="navbar"] {
  width: 100%;
  min-height: 64px;
  padding-inline: max(var(--fashion-desktop-gutter), calc((100vw - var(--fashion-page-width)) / 2));
  border-bottom: 1px solid var(--fashion-border);
  background: var(--fashion-header-bg);
  color: var(--fashion-text);
}

body:not(.fashion-home) [ui-layout="navbar"] .links a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

[ui-layout="footer"] {
  border-top: 1px solid var(--fashion-border);
  background: var(--fashion-footer-bg) !important;
  color: var(--fashion-text) !important;
}

[ui-layout="footer"] .main-area,
[ui-layout="footer"] .secondary-area {
  width: min(100%, var(--fashion-page-width));
  max-width: var(--fashion-page-width);
  padding-inline: var(--fashion-desktop-gutter);
}

[ui-layout="footer"] .group .title,
[ui-layout="footer"] .fashion-newsletter h4 {
  font-family: var(--font-heading-family);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
}

/* Collection and search: wide editorial grid inspired by the reference store. */
body:not(.fashion-home) [ui-section="single-collection"] {
  width: 100%;
  max-width: none;
  gap: 28px !important;
  padding: var(--fashion-page-space) 0 !important;
}

[ui-section="single-collection"] > [ui-slot="breadcrumb"],
[ui-section="single-collection"] > [ui-slot="head"],
[ui-section="single-collection"] > .sub-collections-area,
[ui-section="single-collection"] .core-area > .controller,
[ui-section="single-collection"] .core-area > :not(.items) {
  width: min(calc(100% - (var(--fashion-desktop-gutter) * 2)), var(--fashion-page-width));
  margin-inline: auto !important;
}

[ui-section="single-collection"] > [ui-slot="divider"] {
  display: none;
}

[ui-section="single-collection"] > [ui-slot="head"] {
  align-items: flex-start;
  min-height: 92px;
}

[ui-section="single-collection"] > [ui-slot="head"] .description {
  max-width: 62ch;
  color: var(--fashion-muted);
  line-height: 1.65;
}

[ui-section="single-collection"] .core-area {
  gap: 18px;
}

[ui-section="single-collection"] .core-area .controller,
#youcan-section--search [ui-section="search"] .controller {
  min-height: 44px;
  border-bottom: 1px solid var(--fashion-border);
}

[ui-section="single-collection"] .core-area .controller .result,
#youcan-section--search [ui-section="search"] .controller .result {
  color: var(--fashion-muted);
  font-size: 12px;
  font-weight: 500;
}

[ui-section="single-collection"] .core-area .items,
#youcan-section--search [ui-section="search"] .list {
  width: 100%;
  gap: 36px 0 !important;
}

[ui-section="single-collection"] [ui-block="product"],
#youcan-section--search [ui-section="search"] [ui-block="product"] {
  min-width: 0;
  gap: 0;
  border: 0;
  border-radius: var(--fashion-card-radius);
  background: var(--fashion-card-info-bg);
}

[ui-section="single-collection"] [ui-block="product"] .media,
#youcan-section--search [ui-section="search"] [ui-block="product"] .media {
  aspect-ratio: var(--fashion-card-ratio) !important;
  border-radius: var(--fashion-card-radius) var(--fashion-card-radius) 0 0;
  background: var(--fashion-card-bg);
}

[ui-section="single-collection"] [ui-block="product"] .content,
#youcan-section--search [ui-section="search"] [ui-block="product"] .content {
  gap: 4px;
  padding: 9px 9px 0;
  background: var(--fashion-card-info-bg);
  text-align: left;
}

[ui-section="single-collection"] [ui-block="product"] .content .title,
#youcan-section--search [ui-section="search"] [ui-block="product"] .content .title {
  min-height: 0;
  color: var(--fashion-text);
  font-size: var(--fashion-card-title-size);
  font-weight: 600;
  line-height: 1.35;
  text-transform: uppercase;
}

[ui-section="single-collection"] [ui-block="product"] .content .price,
#youcan-section--search [ui-section="search"] [ui-block="product"] .content .price {
  color: var(--fashion-text);
  font-size: var(--fashion-card-price-size);
}

[ui-section="single-collection"] [ui-block="product"] .content .price .compare-at-price,
#youcan-section--search [ui-section="search"] [ui-block="product"] .content .price .compare-at-price {
  color: var(--fashion-muted);
}

[ui-section="single-collection"] .sub-collections-area .sub-collection > a {
  border-radius: var(--fashion-card-radius);
}

#youcan-section--search [ui-section="search"] {
  gap: 28px;
  padding: var(--fashion-page-space) var(--fashion-desktop-gutter) !important;
}

#youcan-section--search [ui-section="search"] [ui-slot="head"] {
  align-items: flex-start;
  gap: 24px;
}

#youcan-section--search [ui-section="search"] [ui-slot="head"] .search {
  width: min(100%, 620px);
}

/* Product page: image-led desktop, conversion controls kept close to selection. */
[ui-section="single-product"] {
  background: var(--fashion-bg);
  color: var(--fashion-text);
}

[ui-section="single-product"] > [ui-slot="breadcrumb"],
[ui-section="single-product"] .core,
[ui-section="single-product"] .ruby-product-description {
  width: min(100%, var(--fashion-page-width));
  max-width: var(--fashion-page-width);
}

[ui-section="single-product"] .core > .content {
  color: var(--fashion-text);
}

[ui-section="single-product"] .core .media :is(img, .image) {
  border-radius: var(--fashion-card-radius);
}

[ui-section="single-product"] ui-variants [ui-variant="textual_buttons"] .options .opt,
[ui-section="single-product"] ui-variants [ui-variant="radio_buttons"] .options .opt {
  border-radius: var(--fashion-button-radius);
}

[ui-section="single-product"] .ruby-inline-checkout,
[ui-section="single-product"] .ruby-size-guide-dialog__panel {
  border-color: var(--fashion-border);
  border-radius: var(--fashion-card-radius);
  background: var(--fashion-soft-bg);
}

/* Cart: readable line items and a strong, stable summary column. */
[ui-section="cart"] {
  gap: 28px;
  padding: var(--fashion-page-space) var(--fashion-desktop-gutter) !important;
}

[ui-section="cart"] .core-area {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  align-items: start;
  gap: 42px;
}

[ui-section="cart"] .core-area table thead {
  border-block: 1px solid var(--fashion-border);
  background: transparent;
}

[ui-section="cart"] .core-area table tbody tr:not(:last-child) {
  border-color: var(--fashion-border);
}

[ui-section="cart"] .core-area table tbody tr td .product .image {
  border-radius: var(--fashion-card-radius);
  background: var(--fashion-card-bg);
}

[ui-section="cart"] .core-area .summary {
  position: sticky;
  top: 90px;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--fashion-border);
  border-radius: var(--fashion-card-radius);
  background: var(--fashion-soft-bg);
}

[ui-section="cart"] .core-area .summary [ui-slot="accordion-item"] {
  border-radius: var(--fashion-input-radius) !important;
  background: var(--fashion-surface);
}

[ui-section="cart"] .core-area .summary .details [ui-slot="button"] {
  min-height: 52px;
  text-transform: uppercase;
}

/* Standard content and contact pages. */
[ui-section="page"] {
  gap: 34px;
  padding: var(--fashion-page-space) var(--fashion-desktop-gutter) !important;
}

[ui-section="page"] > :not([ui-slot="head"]):not(form) {
  max-width: 860px;
  line-height: 1.75;
}

[ui-section="page"] > form {
  width: min(100%, 760px) !important;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 42px);
  border: 1px solid var(--fashion-border);
  border-radius: var(--fashion-card-radius);
  background: var(--fashion-soft-bg);
}

[ui-section="page"] > form .fields {
  gap: 16px;
}

[ui-section="page"] > form [ui-slot="button"] {
  min-height: 50px;
}

/* Collection index and upsell pages use the same content width. */
[ui-section="list-collections"],
[ui-section="upsell"] {
  padding: var(--fashion-page-space) var(--fashion-desktop-gutter) !important;
}

[ui-section="list-collections"] .core-area .items {
  gap: 20px;
}

[ui-section="list-collections"] [ui-block="collection"] {
  border-radius: var(--fashion-card-radius);
  background: var(--fashion-surface);
}

/* Thank-you page inherits the merchant palette instead of a fixed pink skin. */
body.fashion-template-thankyou [ui-section="thankyou"] {
  width: 100%;
  max-width: none;
  padding: var(--fashion-page-space) max(var(--fashion-desktop-gutter), calc((100vw - var(--fashion-page-width)) / 2)) !important;
  background: var(--fashion-soft-bg) !important;
  color: var(--fashion-text) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] .content-area,
body.fashion-template-thankyou [ui-section="thankyou"] .order-summary-area > .statuses,
body.fashion-template-thankyou [ui-section="thankyou"] .order-summary-area > .products,
body.fashion-template-thankyou [ui-section="thankyou"] .order-summary-area > .summary {
  border-color: var(--fashion-border) !important;
  border-radius: var(--fashion-card-radius) !important;
  background: var(--fashion-surface) !important;
  box-shadow: none !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] :is(
  .ruby-kicker,
  .content-area .heading,
  .ruby-thankyou__phone strong,
  .ruby-thankyou__timeline h2,
  .ruby-thankyou__steps .ruby-thankyou__step--received,
  .ruby-thankyou__help a
) {
  color: var(--fashion-success) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__celebration b,
body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__phone > span,
body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__steps .ruby-thankyou__step--received b {
  border-color: var(--fashion-success) !important;
  background: var(--fashion-success) !important;
  color: var(--fashion-success-text) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__celebration b {
  border-color: color-mix(in srgb, var(--fashion-success) 18%, var(--fashion-surface)) !important;
  box-shadow: 0 0 0 8px var(--fashion-surface) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__celebration span {
  background: var(--fashion-success) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__phone {
  border-color: var(--fashion-border) !important;
  border-radius: var(--fashion-input-radius) !important;
  background: var(--fashion-soft-bg) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] :is(
  .content-area .description,
  .ruby-thankyou__phone p,
  .ruby-thankyou__steps li,
  .ruby-thankyou__help,
  .order-summary-area [ui-slot="label"]
) {
  color: var(--fashion-muted) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__steps::before {
  background: var(--fashion-border) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__steps b {
  border-color: var(--fashion-border) !important;
  background: var(--fashion-surface) !important;
  color: var(--fashion-success) !important;
}

body.fashion-template-thankyou [ui-section="thankyou"] .order-summary-area > [ui-slot="button"] {
  border-radius: var(--fashion-button-radius) !important;
  background: var(--fashion-accent) !important;
  color: var(--fashion-accent-text) !important;
}

@media (max-width: 1024px) {
  [ui-section="cart"] .core-area {
    grid-template-columns: minmax(0, 1fr);
  }

  [ui-section="cart"] .core-area .summary {
    position: static;
  }
}

@media (max-width: 800px) {
  body:not(.fashion-home) [ui-layout="navbar"] {
    min-height: 52px;
    padding-inline: var(--fashion-mobile-gutter);
  }

  [ui-layout="footer"] .main-area,
  [ui-layout="footer"] .secondary-area {
    padding-inline: var(--fashion-mobile-gutter);
  }

  body:not(.fashion-home) :is(
    [ui-section="list-collections"],
    [ui-section="search"],
    [ui-section="cart"],
    [ui-section="page"],
    [ui-section="upsell"]
  ) {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding: calc(var(--fashion-page-space) * .7) var(--fashion-mobile-gutter) !important;
  }

  body:not(.fashion-home) :is(
    [ui-section="single-collection"],
    [ui-section="list-collections"],
    [ui-section="search"],
    [ui-section="cart"],
    [ui-section="page"],
    [ui-section="upsell"]
  ) > [ui-slot="head"] .heading {
    font-size: 32px;
  }

  [ui-section="single-collection"] {
    padding-block: calc(var(--fashion-page-space) * .65) !important;
  }

  [ui-section="single-collection"] > [ui-slot="breadcrumb"],
  [ui-section="single-collection"] > [ui-slot="head"],
  [ui-section="single-collection"] > .sub-collections-area,
  [ui-section="single-collection"] .core-area > .controller,
  [ui-section="single-collection"] .core-area > :not(.items) {
    width: calc(100% - (var(--fashion-mobile-gutter) * 2));
  }

  [ui-section="single-collection"] .core-area .items,
  #youcan-section--search [ui-section="search"] .list {
    grid-template-columns: repeat(var(--fashion-mobile-columns), minmax(0, 1fr)) !important;
    gap: 24px 0 !important;
  }

  [ui-section="single-collection"] [ui-block="product"] .content,
  #youcan-section--search [ui-section="search"] [ui-block="product"] .content {
    padding: 7px 6px 0;
  }

  #youcan-section--search [ui-section="search"] [ui-slot="head"] {
    align-items: stretch;
  }

  [ui-section="cart"] {
    gap: 22px;
  }

  [ui-section="cart"] .core-area {
    gap: 28px;
  }

  [ui-section="cart"] .core-area .summary {
    padding: 18px;
  }

  [ui-section="page"] > form {
    padding: 18px;
  }

  body.fashion-template-thankyou [ui-section="thankyou"] {
    grid-template-columns: minmax(0, 1fr);
    padding: calc(var(--fashion-page-space) * .7) var(--fashion-mobile-gutter) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.fashion-template-thankyou [ui-section="thankyou"] .ruby-thankyou__celebration * {
    animation: none !important;
  }
}
