@import url("./styles/fonts.css");
@import url("./styles/globals.css");
@import url("./styles/home.css");
@import url("./styles/result.css");
@import url("./styles/footer.css");
@import url("./styles/register.css");

[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
body {
  color: #061f45;
}
button,
select {
  font: inherit;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 40px 48px;
  padding-bottom: 58px;
  pointer-events: none;
}
.site-header .brand,
.site-header .page-lang-select {
  pointer-events: auto;
}
.style-selection-page[data-active-screen="selection"] .logo-marella {
  width: 114px;
  height: 16px;
  aspect-ratio: 57 / 8;
}
.style-selection-page[data-active-screen="products"] .logo-marella {
  width: 170px;
  height: 24px;
  aspect-ratio: 85 / 12;
}
.brand {
  display: block;
  line-height: 0;
}
body.is-home-screen {
  background: #0f0f10;
  color: #fff;
}
.is-home-screen .brand img {
  filter: brightness(0) invert(1);
}
.register-form-description {
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.5;
}
.register-form input[type="date"] {
  width: 100%;
  height: 26px;
  border: 0;
  border-bottom: 1px solid #000;
  background: transparent;
  padding: 0 4px 4px 0;
  font: inherit;
  font-size: 14px;
}
.register-form input:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}
.start-screen {
  min-height: calc(100vh - 202px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 38px 130px;
}
.screen-home::before {
  background-image: none;
}
.start-content {
  margin-top: 160px;
}
.home-title {
  text-align: center;
}
.style-selection-page[data-active-screen="selection"] {
  min-height: 100vh;
  overflow-x: clip;
  background: #061f45 url("./assets/chooseStyle-selectionStep-bg.png") center / cover fixed no-repeat;
}
.style-selection-page[data-active-screen="selection"] .site-header .logo-marella {
  filter: brightness(0) invert(1);
}
.style-selection-page[data-active-screen="selection"] .site-header {
  padding-bottom: 57px;
}
.style-selection-page[data-active-screen="selection"] .site-header .page-lang-select {
  color: #fff;
}
.style-selection-page[data-active-screen="selection"] .footer-lang-select {
  color: #fff;
}
.style-selection-page[data-active-screen="selection"] .page-lang-select > .selected::after {
  filter: brightness(0) invert(1);
}
.selection-screen {
  display: flex;
  flex-direction: column;
  padding: 0 38px 130px;
}
.section-heading {
  margin: 0 0 64px;
  color: #fff;
  font-family: "Pilat Extended", "Segoe UI", sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 110.722%;
  letter-spacing: -1.44px;
  text-align: center;
  text-transform: uppercase;
  white-space: pre-line;
}
.selection-instruction {
  order: 2;
  margin: 65px 0 0;
  color: #fff;
  font-family: "Brown", "Segoe UI", sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 120%;
  text-align: center;
  white-space: pre-line;
}
.style-grid {
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  order: 1;
  gap: 100px;
  /* Preserve room for two rotated card slots. */
  column-gap: clamp(0px, calc(100% - 625.764px), 100px);
  width: 100%;
  max-width: 1440px;
  margin: auto;
}
.style-card-slot {
  --card-angle: -6.425deg;
  --card-scale: 1;
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  /* Bounding box of the rotated card, so the visible gap remains 100px. */
  width: min(312.882px, 100%);
  height: 452.209px;
}
.style-card-slot[data-style="party"] {
  --card-angle: -5.43deg;
}
.style-card-slot[data-style="cozy-and-chic"] {
  --card-angle: 5.478deg;
}
.style-sparkles {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 431.892px;
  height: 567.928px;
  aspect-ratio: 54 / 71;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--card-angle)) scale(var(--card-scale));
  transition: opacity 200ms;
}
.style-card-slot:has(.style-card:hover) .style-sparkles,
.style-card-slot:has(.style-card:focus-visible) .style-sparkles {
  opacity: 1;
}
.style-sparkles svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.style-sparkles circle {
  fill-opacity: 0.55;
}
.style-sparkles path {
  transform-box: fill-box;
  transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
  .style-sparkles circle,
  .style-sparkles path {
    animation: sparkle-fade var(--sparkle-duration) ease-in-out var(--sparkle-delay) infinite alternate paused;
  }
  .style-sparkles path {
    animation-name: sparkle-grow;
  }
  .style-card-slot:has(.style-card:hover) .style-sparkles circle,
  .style-card-slot:has(.style-card:hover) .style-sparkles path,
  .style-card-slot:has(.style-card:focus-visible) .style-sparkles circle,
  .style-card-slot:has(.style-card:focus-visible) .style-sparkles path {
    animation-play-state: running;
  }
}
@keyframes sparkle-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sparkle-grow {
  from { opacity: 0; transform: scale(1); }
  to { opacity: 1; transform: scale(1.25); }
}
.style-card {
  position: relative;
  display: flex;
  flex: 0 0 267px;
  flex-direction: column;
  width: 267px;
  height: 425px;
  border: 0;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  color: #061f45;
  text-align: center;
  transform: rotate(var(--card-angle)) scale(var(--card-scale));
}
.style-card .product-media {
  width: 243px;
  height: 364px;
  flex: 0 0 364px;
  aspect-ratio: 243 / 364;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .style-card .product-media img {
    transform-origin: 66.0685% 31.9867%;
    transition: opacity 0.5s ease, transform 400ms ease-in-out;
  }
  .style-card:hover .product-media img,
  .style-card:focus-visible .product-media img {
    transform: scale(1.21664);
  }
}
.style-card-title {
  display: block;
  padding-top: 9px;
  font-family: "Brown", "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 26px;
  text-transform: uppercase;
}
.style-selection-page {
  position: relative;
}
.page-corner {
  position: absolute;
  top: -7px;
  right: 7px;
  width: 200px;
  height: 213.584px;
  aspect-ratio: 103 / 110;
  transform: rotate(90deg);
  pointer-events: none;
}
.change-style {
  position: absolute;
  z-index: 2;
  top: 90px;
  left: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #061f45;
  font-family: "Pilat Extended", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 110%;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  cursor: pointer;
}
.change-style span {
  position: relative;
}
.change-style span::after {
  content: "";
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  border-bottom: 1px solid #061f45;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}
.change-style:focus-visible span::after {
  transform: scaleX(1);
}
@media (min-width: 769px) and (hover: hover) {
  .change-style:hover span::after {
    transform: scaleX(1);
  }
}
.products-intro {
  position: relative;
  text-align: center;
  padding-bottom: 88px;
}
.products-intro h1 {
  color: #061f45;
  font-family: "Pilat Extended";
  font-size: 32px;
  font-weight: 700;
  line-height: 110.722%; /* 35.431px */
  letter-spacing: -0.96px;
  text-transform: uppercase;
}
.style-description {
  margin: 24px auto 0;
  text-align: center;
  font-family: Brown;
  font-size: 24px;
  font-style: normal;
  font-weight: 300;
  line-height: 140%; /* 33.6px */
}
.style-description #style-description-intro {
  font-weight: 300;
}
.style-description #style-description-instruction {
  font-weight: 400;
}
.category-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 45px;
  padding: 16px;
  background: linear-gradient(rgba(6, 31, 69, 0.4), rgba(6, 31, 69, 0.4))
    center bottom / calc(100% - 96px) 1px no-repeat;
  overflow-x: auto;
}
.category-navigation a {
  color: #061f45;
  text-align: center;
  font-family: "Pilat Extended";
  font-size: 18px;
  font-weight: 700;
  line-height: 110.722%; /* 19.93px */
  letter-spacing: -0.54px;
  text-transform: uppercase;
  text-decoration: none;
}
.category-navigation a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.category-section {
  --carousel-inset: max(38px, calc((100vw - 1440px) / 2 + 38px));
  padding: 72px 0 0 var(--carousel-inset);
  scroll-margin-top: 24px;
}
.category-section:last-child {
  padding-bottom: 130px;
}
.category-heading {
  text-transform: uppercase;
  font-size: 21px;
  font-style: normal;
  font-weight: 700;
  line-height: 110.722%; /* 23.252px */
  letter-spacing: -0.63px;
  text-transform: uppercase;
}
.category-section .carousel-wrap {
  margin-top: 32px;
  margin-left: calc(-1 * var(--carousel-inset));
}
.category-section .carousel {
  margin: 0;
  padding: 0 48px 0 var(--carousel-inset);
  gap: 16px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--carousel-inset);
  scroll-padding-right: 48px;
}
.carousel-progress {
  position: relative;
  height: 3px;
  margin: 48px 48px 0 var(--carousel-inset);
}
.carousel-progress::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #133061;
}
.carousel-progress-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #133061;
}
.product-card {
  min-width: 0;
  scroll-snap-align: start;
}
.product-card:last-child {
  scroll-snap-align: end;
}
.product-media {
  position: relative;
  aspect-ratio: 47 / 62;
  background: #dadada;
  overflow: hidden;
  cursor: pointer;
}
.product-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease;
}
.product-card .product-media img {
  aspect-ratio: 47 / 62;
  height: auto;
  object-fit: contain;
}
.product-card .product-media {
  aspect-ratio: auto;
}
.product-media.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(100deg, #d8d8d8 10%, #efefef 40%, #d8d8d8 70%);
  animation: productShimmer 1.1s linear infinite;
}
.product-card .product-media.is-loading:not(.is-image-visible)::before {
  animation-play-state: paused;
}
.product-media.is-loading img {
  opacity: 0;
}
@keyframes productShimmer {
  from {
    transform: translateX(-75%);
  }
  to {
    transform: translateX(75%);
  }
}
.purchase-unavailable {
  text-decoration: underline;
}
.try-on-button {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 40px;
  padding: 4px;
  border: 0;
  background: #133061;
  /* background: #000; */
  color: #fff;
  font-size: 14px;
  letter-spacing: 1.5px;
}
.try-on-button::before {
  content: "";
  width: 32px;
  height: 32px;
  background: url("./assets/icons/virtual-try-on.svg") center / contain
    no-repeat;
}
.carousel-previous {
  left: 40px;
}
.carousel-previous::before {
  transform: scaleX(-1);
}
.carousel-next {
  right: 40px;
}
.carousel-nav:disabled {
  visibility: hidden;
}
.load-error {
  padding: 40px 38px;
}

@media (max-width: 768px) {
  .change-style {
    position: relative;
    top: auto;
    left: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    width: 100%;
    margin-inline: 0;
    font-size: 12px;
  }
  .change-style svg {
    grid-column: 1;
    justify-self: end;
    position: static;
    margin-right: 8px;
  }
  .change-style span {
    grid-column: 2;
  }
  .site-header {
    min-height: 80px;
    padding: 40px 16px 24px;
  }
  .style-selection-page[data-active-screen="products"] .site-header {
    min-height: 0;
  }
  .style-selection-page[data-active-screen="products"] .logo-marella {
    width: 114px;
    height: 16px;
    aspect-ratio: 57 / 8;
  }
  .page-corner {
    top: -2.1555px;
    right: 2.1555px;
    width: 89.895px;
    height: 94.206px;
    aspect-ratio: 89.90 / 94.21;
  }
  .style-selection-page[data-active-screen="selection"] .site-header {
    min-height: 0;
    padding-bottom: 16px;
  }
  .start-screen {
    min-height: calc(100vh - 258px);
    padding: 0 16px 66px;
  }
  .start-content {
    margin-top: 58px;
  }
  .selection-screen {
    padding: 0 clamp(8px, calc((100% - 347.148px) / 2), 16px) 66px;
  }
  .section-heading {
    margin-bottom: 12px;
    font-size: 24px;
    letter-spacing: -0.72px;
  }
  .selection-instruction {
    order: 0;
    margin: 0 0 30px;
    font-size: 16px;
    font-weight: 300;
  }
  .style-grid {
    gap: 20px;
    max-width: 347.148px;
  }
  .style-card-slot {
    --card-angle: 0deg;
    width: min(163.574px, calc((100% - 20px) / 2));
    height: auto;
    aspect-ratio: 163.574 / 261.349;
  }
  .style-card-slot[data-style="party"],
  .style-card-slot[data-style="cozy-and-chic"] {
    --card-angle: 0deg;
  }
  .style-sparkles {
    display: none;
  }
  .style-card {
    flex-basis: 100%;
    width: 100%;
    height: 100%;
    padding: 4.5114%;
    transform: none;
  }
  .style-card .product-media {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    aspect-ratio: 148.815 / 223.837;
  }
  @media (prefers-reduced-motion: no-preference) {
    .style-card.is-selecting .product-media img {
      transform-origin: 66.0685% 31.9867%;
      animation: styleSelectionZoom 400ms ease-in-out forwards;
    }
  }
  .style-card-title {
    padding-top: 5.534px;
    font-size: 12px;
    line-height: 15.988px;
  }
  .products-intro {
    padding: 32px 24px 40px;
  }
  .products-intro h1 {
    font-size: 20px;
  }
  .style-description {
    margin-top: 32px;
    font-size: 16px;
  }
  .category-navigation {
    justify-content: flex-start;
    gap: 24px;
    padding: 20px 24px 8px;
    background-size: calc(100% - 48px) 1px;
  }
  .category-navigation a {
    font-size: 12px;
    line-height: 1.10722;
    letter-spacing: -0.36px;
  }
  .category-section {
    --carousel-inset: 24px;
    padding-top: 72px;
  }
  .category-section:last-child {
    padding-bottom: 66px;
  }
  .category-heading {
    font-size: 16px;
  }
  .products-screen .carousel-progress {
    display: none;
  }
  .carousel-previous {
    left: 24px;
  }
  .carousel-next {
    right: 24px;
  }
  @media (prefers-reduced-motion: no-preference) {
    .change-style.is-activating span::after {
      animation: changeStyleUnderline 250ms ease forwards;
    }
  }
}
@keyframes changeStyleUnderline {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes styleSelectionZoom {
  to {
    transform: scale(1.21664);
  }
}
@media (prefers-reduced-motion: reduce) {
  html,
  .carousel {
    scroll-behavior: auto;
  }
  .product-media.is-loading::before {
    animation: none;
  }
  .product-media img {
    transition: none;
  }
  .change-style span::after {
    transition: none;
  }
  .style-sparkles {
    transition: none;
  }
}
