/* ============================================================
   simsonic — Northwind design foundation
   Ported from design/mockups/app-home-glass-video-v2.html.
   Tokens only + base typeface; screen-level styling lives in
   each route's *.module.css and inherits from here.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&display=swap');

:root {
  /* simsonic brand palette */
  --brand-base: #1c1b29;
  --brand-base-2: #100f1d;
  --brand-magenta: #ff00ff;
  --brand-violet: #8b00ff;

  /* semantic roles — names kept so existing modules inherit the rebrand */
  --marine-ink: #1c1b29; /* primary text on light surfaces = brand base */
  --ice-blue: #b085ff; /* violet highlight */
  --foil-gold: #ff00ff; /* accent / CTA / badge = brand magenta */
  --ink-deep: #100f1d;
  --ink-mid: #1c1b29;
  --ink-shell: #100f1d;
  --surface-light: #f2f1f6;

  /* glass */
  --glass-fill: rgba(255, 255, 255, 0.62);
  --glass-fill-2: rgba(255, 255, 255, 0.80);
  --glass-fill-drawer: rgba(255, 255, 255, 0.78);
  --glass-line: rgba(255, 255, 255, 0.32);

  /* type — Sora across the whole app */
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: 'Sora', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'Sora', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* text tone */
  --text-dim: rgba(28, 27, 41, 0.56);

  /* motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-normal: 300ms;

  /* app shell */
  --shell-tabbar-h: 62px;
}

body {
  font-family: var(--font-body);
}

:root {
  --aside-width: 400px;
  --cart-aside-summary-height-with-discount: 300px;
  --cart-aside-summary-height: 250px;
  --grid-item-width: 355px;
  --header-height: 64px;
  --color-dark: #000;
  --color-light: #fff;
}

img {
  border-radius: 4px;
}

/*
* --------------------------------------------------
* Non anchor links
* --------------------------------------------------
*/
.link:hover {
  text-decoration: underline;
  cursor: pointer;
}

/*
* --------------------------------------------------
* components/MockShopNotice
* --------------------------------------------------
*/
.mock-shop-notice {
  background: var(--color-light);
  border: 1px solid var(--color-dark);
  border-left-width: 0.5rem;
  margin: 1rem 0;
  padding: 0;

  .inner {
    padding: 0.875rem 1rem;
  }

  h2 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
  }

  p {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }

  footer {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.5rem 1rem;
  }

  .small {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }

  code {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 0.25rem;
    padding: 0.1em 0.3em;
  }

  a {
    text-decoration: underline;
    text-underline-offset: 6px;
  }
}

/*
* --------------------------------------------------
* components/Aside
* --------------------------------------------------
*/
@media (max-width: 45em) {
  html:has(.overlay.expanded) {
    overflow: hidden;
  }
}

aside {
  background: var(--color-light);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
  height: 100vh;
  width: min(var(--aside-width), 100vw);
  position: fixed;
  right: calc(-1 * var(--aside-width));
  top: 0;
  transition: transform 200ms ease-in-out;
}

aside header {
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  height: var(--header-height);
  justify-content: space-between;
  padding: 0 24px;
}

aside header h3 {
  margin: 0;
}

aside header .close {
  font-weight: 400;
  opacity: 1;
  text-decoration: none;
  transition: background 200ms, transform 200ms;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.05);
}

aside header .close:hover {
  background: rgba(0, 0, 0, 0.12);
  transform: rotate(90deg);
}

aside header h2 {
  margin-bottom: 0.6rem;
  margin-top: 0;
}

aside main {
  margin: 1rem;
}

aside p {
  margin: 0 0 0.25rem;
}

aside p:last-child {
  margin: 0;
}

aside li {
  margin-bottom: 0.125rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border-width: 0;
}

.overlay {
  background: rgba(8, 7, 11, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  bottom: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 400ms ease-in-out;
  visibility: hidden;
  z-index: 10;
}

.overlay .close-outside {
  background: transparent;
  border: none;
  color: transparent;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: calc(100% - var(--aside-width));
}

.overlay .light {
  background: rgba(255, 255, 255, 0.5);
}

.overlay .cancel {
  cursor: default;
  height: 100%;
  position: absolute;
  width: 100%;
}

.overlay.expanded {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}
/* reveal aside */
.overlay.expanded aside {
  transform: translateX(calc(var(--aside-width) * -1));
}

button.reset {
  border: 0;
  background: inherit;
  font-size: inherit;
}

button.reset > * {
  margin: 0;
}

button.reset:not(:has(> *)) {
  height: 1.5rem;
  line-height: 1.5rem;
}

button.reset:hover:not(:has(> *)) {
  text-decoration: underline;
  cursor: pointer;
}

/*
* --------------------------------------------------
* components/Header
* --------------------------------------------------
*/
.header {
  align-items: center;
  background: #fff;
  display: flex;
  height: var(--header-height);
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.header-menu-mobile-toggle {
  @media (min-width: 48em) {
    display: none;
  }
}

.header-menu-mobile {
  display: flex;
  flex-direction: column;
  grid-gap: 1rem;
}

.header-menu-desktop {
  display: none;
  grid-gap: 1rem;
  @media (min-width: 45em) {
    display: flex;
    grid-gap: 1rem;
    margin-left: 3rem;
  }
}

.header-menu-item {
  cursor: pointer;
}

.header-ctas {
  align-items: center;
  display: flex;
  grid-gap: 1rem;
  margin-left: auto;
}

.header-ctas > * {
  min-width: fit-content;
}

/*
* --------------------------------------------------
* components/Footer
* --------------------------------------------------
*/
.footer {
  background: var(--color-dark);
  margin-top: auto;
}

.footer-menu {
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  grid-gap: 1rem;
  padding: 1rem;
}

.footer-menu a {
  color: var(--color-light);
  min-width: fit-content;
}

/*
* --------------------------------------------------
* components/Cart
* --------------------------------------------------
*/
.cart-main {
  height: 100%;
  max-height: calc(100vh - var(--cart-aside-summary-height));
  overflow-y: auto;
  width: auto;
}

.cart-main.with-discount {
  max-height: calc(100vh - var(--cart-aside-summary-height-with-discount));
}

.cart-line {
  padding: 0.75rem 0;
}

.cart-line-inner {
  display: flex;
}

.cart-line img {
  height: 100%;
  display: block;
  margin-right: 0.75rem;
}

.cart-summary-page {
  position: relative;
}

.cart-summary-aside {
  background: white;
  border-top: 1px solid var(--color-dark);
  bottom: 0;
  padding-top: 0.75rem;
  position: absolute;
  width: calc(var(--aside-width) - 40px);
}

.cart-line-quantity {
  display: flex;
}

/* Child line components (warranties, gift wrapping, etc.) */
.cart-line-children {
  padding-left: 2rem;
}

.cart-discount {
  align-items: center;
  display: flex;
  margin-top: 0.25rem;
}

.cart-subtotal {
  align-items: center;
  display: flex;
}
/*
* --------------------------------------------------
* components/Search
* --------------------------------------------------
*/
.predictive-search {
  height: calc(100vh - var(--header-height) - 40px);
  overflow-y: auto;
}

.predictive-search-form {
  background: var(--color-light);
  position: sticky;
  top: 0;
}

.predictive-search-result {
  margin-bottom: 2rem;
}

.predictive-search-result h5 {
  text-transform: uppercase;
}

.predictive-search-result-item {
  margin-bottom: 0.5rem;
}

.predictive-search-result-item a {
  align-items: center;
  display: flex;
}

.predictive-search-result-item a img {
  margin-right: 0.75rem;
  height: 100%;
}

.search-result {
  margin-bottom: 1.5rem;
}

.search-results-item {
  margin-bottom: 0.5rem;
}

.search-results-item a {
  display: flex;
  flex: row;
  align-items: center;
  gap: 1rem;
}

/*
* --------------------------------------------------
* routes/__index
* --------------------------------------------------
*/
.featured-collection {
  display: block;
  margin-bottom: 2rem;
  position: relative;
}

.featured-collection-image {
  aspect-ratio: 1 / 1;
  @media (min-width: 45em) {
    aspect-ratio: 16 / 9;
  }
}

.featured-collection img {
  height: auto;
  max-height: 100%;
  object-fit: cover;
}

.recommended-products-grid {
  display: grid;
  grid-gap: 1.5rem;
  grid-template-columns: repeat(2, 1fr);
  @media (min-width: 45em) {
    grid-template-columns: repeat(4, 1fr);
  }
}

.recommended-product img {
  height: auto;
}

/*
* --------------------------------------------------
* routes/collections._index.tsx
* --------------------------------------------------
*/
.collections-grid {
  display: grid;
  grid-gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
  margin-bottom: 2rem;
}

.collection-item img {
  height: auto;
}

/*
* --------------------------------------------------
* routes/collections.$handle.tsx
* --------------------------------------------------
*/
.collection-description {
  margin-bottom: 1rem;
  max-width: 95%;
  @media (min-width: 45em) {
    max-width: 600px;
  }
}

.products-grid {
  display: grid;
  grid-gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
  margin-bottom: 2rem;
}

.product-item img {
  height: auto;
  width: 100%;
}

/*
* --------------------------------------------------
* routes/products.$handle.tsx
* --------------------------------------------------
*/
.product {
  display: grid;
  @media (min-width: 45em) {
    grid-template-columns: 1fr 1fr;
    grid-gap: 4rem;
  }
}

.product h1 {
  margin-top: 0;
}

.product-image img {
  height: auto;
  width: 100%;
}

.product-main {
  align-self: start;
  position: sticky;
  top: 6rem;
}

.product-price-on-sale {
  display: flex;
  grid-gap: 0.5rem;
}

.product-price-on-sale s {
  opacity: 0.5;
}

.product-options-grid {
  display: flex;
  flex-wrap: wrap;
  grid-gap: 0.75rem;
}

.product-options-item,
.product-options-item:disabled {
  padding: 0.25rem 0.5rem;
  background-color: transparent;
  font-size: 1rem;
  font-family: inherit;
}

.product-option-label-swatch {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.25rem 0;
}

.product-option-label-swatch img {
  width: 100%;
}

/*
* --------------------------------------------------
* routes/blog._index.tsx
* --------------------------------------------------
*/
.blog-grid {
  display: grid;
  grid-gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
  margin-bottom: 2rem;
}

.blog-article-image {
  aspect-ratio: 3/2;
  display: block;
}

.blog-article-image img {
  height: 100%;
}

/*
* --------------------------------------------------
* routes/blog.$articlehandle.tsx
* --------------------------------------------------
*/
.article img {
  height: auto;
  width: 100%;
}

/*
* --------------------------------------------------
* routes/account
* --------------------------------------------------
*/

.account-logout {
  display: inline-block;
}

/*
* --------------------------------------------------
* Order Search Form - Minimal & Responsive
* --------------------------------------------------
*/
.order-search-form {
  margin-bottom: 1.5rem;
}

.order-search-fieldset {
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 1rem;
}

.order-search-legend {
  font-weight: 600;
  padding: 0 0.5rem;
}

.order-search-active {
  font-weight: normal;
  opacity: 0.7;
  margin-left: 0.5rem;
}

.order-search-inputs {
  display: grid;
  gap: 1rem;
  margin: 0.25rem 0 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .order-search-inputs {
    grid-template-columns: 1fr 1fr;
  }
}

.order-search-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 1rem;
}

.order-search-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ============================================================
   Branded cart drawer (Aside) — brand base panel, magenta/violet CTA.
   Scoped to `aside` so it covers CartMain/CartLineItem/CartSummary
   without depending on their exact class names.
   ============================================================ */
aside {
  background: var(--brand-base);
  color: #fff;
  font-family: var(--font-body);
}
aside header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
aside header h3 {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
aside .close {
  color: inherit;
  opacity: 0.8;
}
aside .close:hover {
  opacity: 1;
}
aside a {
  color: #fff;
}
aside dl,
aside dt,
aside dd,
aside p,
aside h4 {
  color: #fff;
}
aside .cart-line {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
aside small,
aside .cart-line-quantity {
  color: rgba(255, 255, 255, 0.6);
}
aside input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
}
aside input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
aside button {
  color: #fff;
}
.cart-summary-aside {
  background: var(--brand-base-2);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
/* primary checkout CTA — the "Continue to Checkout" link */
.cart-summary-aside a[href] {
  display: block;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--brand-violet), var(--brand-magenta));
  color: #fff;
  text-align: center;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
}
.cart-summary-aside a[href] p {
  margin: 0;
}
.cart-summary-aside a[href]:hover {
  filter: brightness(1.08);
}

/* ---- Cart drawer as a BOTTOM SHEET (comes up from the bottom) ---- */
aside {
  right: auto;
  top: auto;
  left: 50%;
  bottom: 0;
  width: 100vw;
  max-width: 620px;
  height: auto;
  max-height: 86vh;
  border-radius: 22px 22px 0 0;
  transform: translate(-50%, 100%);
  transition: transform 280ms var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -24px 60px -14px rgba(0, 0, 0, 0.6);
}
.overlay.expanded aside {
  transform: translate(-50%, 0);
}
.overlay {
  background: rgba(4, 3, 10, 0.55);
}
.overlay .close-outside {
  width: 100%;
  height: 100%;
}
aside header {
  flex-shrink: 0;
}
aside main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
/* grab handle */
aside header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.14);
}
aside header {
  position: relative;
  padding-top: 18px;
}

/* ============================================================
   Responsive split — mobile app design vs desktop marketing.
   Both render server-side; CSS shows the right one at 1024px.
   ============================================================ */
.mobile-only { display: block; }
.desktop-only { display: none; }
@media (min-width: 1024px) {
  .mobile-only { display: none; }
  .desktop-only { display: block; }
  /* bottom tab bar is mobile-app chrome — hide on desktop */
  .tabbar-desktop-hidden { display: none !important; }
}

/* ============================================================
   Desktop cart drawer — FULL-WIDTH bottom sheet.
   The mobile bottom sheet is a 620px centered card; on desktop that
   floats bottom-centre and reads as broken. Here it spans the full
   viewport width, flat top corners, with content re-flowed into two
   columns (line items | sticky summary) inside a centred container.
   ============================================================ */
@media (min-width: 1024px) {
  aside {
    left: 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 72vh;
    border-radius: 0;
    transform: translateY(100%);
  }
  .overlay.expanded aside {
    transform: translateY(0);
  }
  /* drop the mobile grab handle and its extra top padding */
  aside header::before { display: none; }
  aside header { padding-top: 0; }

  /* centre the content and give it room to breathe */
  aside main {
    margin: 0;
    padding: 24px max(32px, calc((100vw - 1200px) / 2)) 32px;
  }
  /* let the panel itself scroll instead of the inner section */
  .cart-main {
    max-height: none;
    height: auto;
    overflow: visible;
  }
  /* two columns: line items on the left, summary on the right */
  .cart-details {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 380px);
    gap: 40px;
    align-items: start;
  }
  /* summary is absolutely pinned for the mobile sheet — flow it into
     the right column and let it stick as the items scroll */
  .cart-summary-aside {
    position: sticky;
    top: 24px;
    width: auto;
    border-top: none;
    align-self: start;
  }
}
