.shop-header .nav {
  gap: clamp(0.75rem, 1.45vw, 1.3rem);
}

.shop-utilities {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.shop-header .nav .shop-cart,
.shop-header .nav .shop-favorites {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  min-height: 46px;
  padding: 0.55rem 0.85rem;
  border: 1px solid;
  border-radius: 0.55rem;
  font: 750 0.875rem/1.2 Montserrat, Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.shop-header .nav .shop-favorites {
  border-color: #b18c46;
  background: #0e2037;
  color: #ffdc85;
}

.shop-header .nav .shop-favorites:hover {
  background: #203752;
}

.shop-heart {
  font: 700 1.3rem/1 Arial, sans-serif;
}

.shop-cart-count {
  min-width: 1.65rem;
  padding: 0.25rem;
  border-radius: 10rem;
  background: #0b1a2e;
  color: #ffdc85;
  text-align: center;
}

.shop-cart .shop-cart-count {
  background: #09235a;
  color: #fff;
}

.shop-cart-total {
  padding-inline-start: 0.58rem;
  border-inline-start: 1px solid #ffffff59;
  font-variant-numeric: tabular-nums;
}

#products .item, .hero-product {
  position: relative;
}

#products .item .favorite-toggle,
.hero-product .favorite-toggle,
.favorite-remove {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffdc85;
  font: 700 1.6rem/1 Arial, sans-serif;
  cursor: pointer;
}

.favorite-toggle {
  position: absolute;
  z-index: 2;
  inset-block-start: 0.65rem;
  inset-inline-end: 0.65rem;
}

#products .item .favorite-toggle[aria-pressed="true"],
.hero-product .favorite-toggle[aria-pressed="true"],
.favorite-remove {
  color: #ff8b9b;
}

.hero-product-open {
  margin: 0 auto 0.85rem;
  padding: 0.25rem 0.75rem;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #ffdc85;
  background: transparent;
  color: #ffdc85;
  font: 650 0.875rem Montserrat, Arial, sans-serif;
  cursor: pointer;
}

#products .product-open::after, .hero-product-open::after {
  position: absolute;
  inset: 0;
  content: "";
}

#products .item:has(.product-open:focus-visible) .product-studio,
.hero-product:has(.hero-product-open:focus-visible) {
  outline: 1px solid #ffd25d;
}

#product-dialog {
  max-width: 850px;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 4vw, 2rem);
}

.product-detail .dialog-visual {
  margin-block: 0;
}

.product-detail .dialog-visual .studio-offer {
  display: none;
}

.product-actions > p {
  margin-top: 0;
}

.product-buy {
  margin: 0.75rem 0;
}

.product-price {
  display: block;
  margin-bottom: 0.6rem;
  color: #ffdc85;
  font: 700 clamp(1.65rem, 4vw, 2.5rem)/1.2 Cinzel, Georgia, serif;
}

.product-colour {
  margin: 0 0 0.75rem;
  color: var(--silver);
  font-size: 0.9rem;
}
.product-colour strong {
  margin-inline-start: 0.25rem;
  color: var(--ink);
}

.product-sizes {
  min-width: 0;
  margin: 0 0 0.65rem;
  padding: 0;
  border: 0;
}

.product-sizes legend {
  margin-bottom: 0.5rem;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.size-option {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.55rem;
  border: 1px solid #687994;
  border-radius: 0.4rem;
  background: #0a192b;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}

.size-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.size-option:has(input:checked), .size-option:hover {
  border-color: #ffdc85;
  color: #ffdc85;
}

.size-option:has(input:checked) {
  background: #11294d;
  box-shadow: inset 0 0 0 1px #ffdc85;
}

.size-option:has(input:focus-visible) {
  outline: 2px solid #ffdc85;
  outline-offset: 3px;
}

.product-size-guide {
  margin: 0 0 0.8rem;
  color: var(--silver);
  font-size: 0.85rem;
}

.product-size-guide summary {
  color: #ffdc85;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.product-size-guide table {
  width: 100%;
  margin-block: 0.5rem;
  border-collapse: collapse;
  text-align: left;
}

.product-size-guide th, .product-size-guide td {
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

.cart-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border: 1px solid;
  border-radius: 0.55rem;
  font: 750 0.91rem/1.4 Montserrat, Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.shop-header .nav .shop-cart,
.cart-primary {
  border-color: #4086ff;
  background: linear-gradient(180deg, #0751d6, #06328c);
  color: #fff;
}

.shop-header .nav .shop-cart:hover,
.cart-primary:hover {
  border-color: #72a1ff;
  background: linear-gradient(180deg, #0b64f8, #0844c5);
  color: #fff;
}

.product-availability {
  margin: 0.65rem 0 1rem;
  color: var(--silver);
  font-size: 0.85rem;
}

#cart-dialog, #favorites-dialog {
  inset: 0 0 0 auto;
  width: min(29rem, 100%);
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border-width: 0 0 0 1px;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 100% 0, #183254 0, transparent 45%),
    #0b1a2e;
}

#cart-dialog:has(.cart-preview:not([hidden])) {
  inset: 0;
  width: 100%;
  border: 0;
}

.cart-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  padding: 1.25rem;
}

.favorites-content {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.cart-content .dialog-top {
  margin-bottom: 0;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.cart-content .dialog-top h2 {
  margin: 0;
}

.cart-preview {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #0a1529 url("boutique-studio.png") center / cover no-repeat;
}

.cart-preview[hidden] {
  display: none;
}

.cart-preview-visual {
  container-type: size;
  min-height: 0;
}

.cart-preview-visual > .product-studio {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0.75rem;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  background: transparent;
}

.cart-preview-visual .studio-photo {
  width: min(100%, calc(100cqh - 1.5rem), 39rem);
  max-width: none;
}

.cart-preview-copy {
  padding: clamp(1rem, 2.5vw, 2rem);
  border-top: 1px solid var(--line);
  background: #0b1a2e;
}

.cart-preview-copy h2 {
  margin: 0 0 0.45rem;
  color: #ffcc5f;
  font: 600 clamp(1.5rem, 3vw, 2.5rem)/1.15 Cinzel, Georgia, serif;
}

.cart-preview-copy p {
  margin: 0;
  color: var(--silver);
  font-size: 0.9rem;
}

.cart-status {
  margin: 0.55rem 0 0;
  color: #ffdc85;
  font-size: 0.875rem;
}

.cart-status:empty {
  margin: 0;
}

.cart-body {
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cart-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-item {
  display: grid;
  grid-template-columns: 3.875rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.product-studio.cart-thumbnail {
  width: 3.875rem;
  margin: 0;
  padding: 0.18rem;
  border-color: var(--line);
  border-radius: 7px;
}

.cart-item-name, .cart-item-color {
  display: block;
  overflow-wrap: anywhere;
}

.cart-item-name, .cart-line-price {
  font-size: 0.875rem;
  line-height: 1.4;
}

.cart-preview-choice {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.cart-preview-choice:hover,
.cart-preview-choice[aria-pressed="true"] {
  color: #ffcc5f;
}

.cart-item-color {
  margin-top: 0.2rem;
  color: var(--silver);
  font-size: 0.8rem;
}

.favorite-price {
  display: block;
  margin-top: 0.25rem;
  color: #ffdc85;
  font-size: 0.875rem;
}

.favorite-view {
  min-height: 44px;
  margin-top: 0.35rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid #b18c46;
  border-radius: 0.4rem;
  background: #0e2037;
  color: #ffdc85;
  font-size: 0.84rem;
  cursor: pointer;
}

.favorite-view:hover {
  background: #203752;
}

.cart-size-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  color: var(--silver);
  font-size: 0.8rem;
}

.cart-size-picker select {
  min-height: 38px;
  max-width: 100%;
  border: 1px solid #64748c;
  border-radius: 0.4rem;
  background: #0a192b;
  color: var(--ink);
  font: inherit;
}

.cart-line-price {
  color: #ffdc85;
  white-space: nowrap;
}

.cart-controls, .cart-stepper {
  display: flex;
  align-items: center;
}

.cart-controls {
  flex-wrap: wrap;
  gap: 0.3rem 0.65rem;
  margin-top: 0.65rem;
}

.cart-stepper {
  border: 1px solid #64748c;
  border-radius: 0.5rem;
  color: var(--ink);
}

.cart-quantity-button, .cart-remove, .cart-continue {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.cart-quantity-button {
  min-width: 38px;
  padding: 0.15rem;
  font-size: 1.1rem;
}

.cart-quantity-button:hover, .cart-remove:hover, .cart-continue:hover {
  color: #ffdc85;
}

.cart-quantity-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.cart-quantity {
  min-width: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.cart-remove, .cart-continue {
  padding: 0.2rem;
  font-size: 0.84rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.cart-footer {
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

#cart-destination {
  margin-bottom: 0.75rem;
}

#cart-destination label {
  display: block;
  margin-bottom: 0.3rem;
}

#cart-country {
  width: 100%;
}

.cart-summary {
  margin: 0;
}

.cart-summary div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.25rem 0;
}

.cart-summary dt {
  color: var(--silver);
  font-size: 0.875rem;
}

.cart-summary dd {
  margin: 0;
  color: #ffdc85;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#cart-checkout-help {
  margin: 0.65rem 0;
  color: var(--silver);
  font-size: 0.84rem;
  line-height: 1.5;
}

.cart-continue {
  display: block;
  min-height: 44px;
  margin: 0.35rem auto 0;
}

.cart-primary[hidden] {
  display: none;
}

@media (min-width: 761px) {
  #cart-dialog:has(.cart-preview:not([hidden])) .cart-content {
    grid-template-columns: minmax(0, 1fr) clamp(21.5rem, 35vw, 29rem);
    column-gap: clamp(1rem, 2.5vw, 2rem);
  }

  #cart-dialog:has(.cart-preview:not([hidden])) .cart-content > :not(.cart-preview) {
    grid-column: 2;
  }

  .cart-preview {
    grid-column: 1;
    grid-row: 1 / -1;
  }
}

@media (max-width: 950px) {
  .shop-header .nav {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
  }
}

@media (max-width: 760px) {
  #cart-dialog:has(.cart-preview:not([hidden])) .cart-content {
    height: auto;
    min-height: 100%;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    row-gap: 0.75rem;
  }

  #cart-dialog:has(.cart-preview:not([hidden])) .cart-body {
    overflow-y: visible;
  }

  .cart-preview-visual {
    height: clamp(13rem, 42svh, 22rem);
  }

  .shop-header .nav {
    justify-content: space-between;
  }

  .shop-utilities {
    flex: 1 0 100%;
    flex-wrap: wrap;
  }

  .shop-header .nav .shop-cart,
  .shop-header .nav .shop-favorites {
    flex: 1;
    padding-inline: 0.5rem;
  }
}

@media (max-width: 600px) {
  .product-detail {
    display: flex;
    flex-direction: column-reverse;
  }

  .product-actions {
    width: 100%;
  }

  .cart-content {
    padding: 1rem;
  }
}

@media (max-width: 370px) {
  .cart-item {
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .product-studio.cart-thumbnail {
    width: 3rem;
  }
}
