:root {
  --ink: #211534;
  --muted: #645674;
  --green: #6d26bc;
  --dark: #211034;
  --line: #e5dbef;
  --paper: #faf7fd;
  --soft: #f0e5fa;
}

.top {
  background: radial-gradient(ellipse at 22% -85%, #8032bb, transparent 75%), #1c102c;
  border-bottom: 2px solid #b34dff;
}

.top .brand-mark,
.top .cart-link span { background: #e9c8ff; color: #321347; }
.marketplace-link,
.purchase-reviews {
  display: flex;
  align-items: center;
  gap: .4em;
  min-height: 44px;
  color: #efdbff;
  font-size: .875rem;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: .18em;
}

@media (max-width: 780px) {
  .top-inner:has(.marketplace-link) { flex-wrap: wrap; padding-top: 8px; column-gap: 8px; row-gap: 0; }
  .top-inner:has(.marketplace-link) .brand { flex: 1; min-width: 0; }
  .marketplace-link { flex-basis: 100%; order: 1; }
}

.primary { background: linear-gradient(120deg, #7023bd, #8f24c1); border-color: #7927bc; }
.primary:hover { background: #55208c; }
:focus-visible { outline-color: #a542e6; }
.tile-body strong { color: #612099; font-size: 1.25rem; }
.product-heading { margin-bottom: 22px; }
.product-heading h1 { font-size: clamp(1.35rem, 2.45vw, 2rem); }

.product-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, .56fr);
  grid-template-areas: "gallery purchase" "information purchase";
  align-items: start;
  gap: 20px;
}

.product-workspace .gallery { grid-area: gallery; }
.product-main-info { grid-area: information; min-width: 0; }
.product-workspace .thumbs { max-height: min(68vw, 640px); }
.product-workspace .stage { max-height: 640px; }
.thumb { background: #eee4f7; }
.thumb[aria-current=true] { border-color: #a333e8; }

.product-facts {
  grid-area: facts;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.product-facts { font-size: .875rem; line-height: 1.45; }
.product-facts h2 { font-size: .98rem; }
.product-facts .specs { margin: 8px 0 14px; }
.product-facts .specs div { grid-template-columns: 1fr; gap: 2px; }
.product-workspace .specs dd, .details .specs dd { overflow-wrap: anywhere; }

.purchase-panel {
  grid-area: purchase;
  position: sticky;
  top: 20px;
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid #6c4391;
  border-radius: 20px;
  color: #fff;
  background: radial-gradient(ellipse at 100% 0%, #542377, transparent 72%), #251538;
  box-shadow: 0 14px 30px #361b5b22;
}

.product-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.product-price strong { color: #f2d6ff; font-size: clamp(1.5rem, 2.45vw, 2rem); line-height: 1.2; white-space: nowrap; }
.product-price s { color: #d2bedf; font-size: .95rem; white-space: nowrap; }
.purchase-quick { text-align: center; padding: 10px; border-radius: 12px; color: #4a1a65; background: #f0dfff; font-weight: 700; }
.purchase-delivery { color: #e4d3f0; font-size: .82rem; line-height: 1.45; padding-top: 12px; border-top: 1px solid #67467f; }
.purchase-delivery strong { display: block; margin-top: 3px; color: #fff; }
.purchase-seller { display: flex; flex-wrap: wrap; gap: 4px 9px; font-size: .82rem; line-height: 1.45; }
.purchase-seller span { color: #f1c1ff; font-weight: 700; white-space: nowrap; }
.related-products { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.related-products a { display: block; padding: 2px; border: 1px solid var(--line); border-radius: 9px; }
.related-products a[aria-current="page"] { border-color: #a333e8; }
.related-products img { display: block; width: 45px; height: 58px; object-fit: cover; border-radius: 6px; }
.mobile-purchase { display: none; }

@media (min-width: 1050px) {
  .product-workspace {
    grid-template-columns: minmax(0, 1.46fr) minmax(235px, 1fr) minmax(215px, .75fr);
    grid-template-areas: "gallery information purchase";
  }
}

@media (max-width: 780px) {
  .product-main-info { display: contents; }
  .product-heading { grid-area: title; margin: 0; }
  .product-workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "gallery" "purchase" "facts"; gap: 16px; }
  .product-workspace .thumbs { max-height: none; }
  .product-workspace .stage { max-height: 65svh; }
  .product-facts .specs div { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 10px; }
  .purchase-panel { position: static; padding: 14px; gap: 8px; }
  .purchase-panel .product-price, .purchase-panel button { display: none; }
  .purchase-delivery { padding-top: 8px; }
  body:has(.mobile-purchase) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .mobile-purchase {
    position: fixed;
    z-index: 5;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 16px max(10px, env(safe-area-inset-bottom));
    background: #241437;
    border-top: 1px solid #8b46be;
    box-shadow: 0 -4px 20px #28104535;
  }
  .mobile-purchase .product-price { flex-direction: column; }
  .mobile-purchase .product-price strong { font-size: 1.3rem; }
  .mobile-purchase .product-price s { font-size: .8rem; }
  .mobile-purchase .primary { padding-inline: 8px; }
}

.brand-mark { flex: none; }
.brand-copy { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 14px; }
.brand-tagline { color: #ebd9f6; font-size: .94rem; font-weight: 500; line-height: 1.25; letter-spacing: 0; }

@media (max-width: 780px) {
  .brand-copy { display: grid; gap: 2px; }
  .brand-tagline { font-size: .72rem; }
}

.catalog-heading { font-size: clamp(1.65rem, 3.2vw, 2.65rem); }

.product-grid .tile {
  display: flex;
  flex-direction: column;
}

.product-grid .tile-body {
  flex: 1;
  grid-template-rows: auto 1fr auto auto;
}

@supports (grid-template-rows: subgrid) {
  .product-grid .tile {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .product-grid .tile-body {
    grid-row: span 4;
    grid-template-rows: subgrid;
  }
}

.tile-body .product-price strong { color: #612099; font-size: 1.25rem; }
.tile-body .product-price s { color: var(--muted); font-size: .86rem; }

.store-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, .85fr) minmax(0, 1.15fr) minmax(0, .75fr);
  gap: 10px;
  margin-top: 32px;
  padding-bottom: 22px;
}

.store-footer-block {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  overflow-wrap: anywhere;
}

.store-footer-block h2 { font-size: .94rem; line-height: 1.3; }
.store-footer-block p { margin-top: 6px; font-size: .84rem; line-height: 1.4; }
.store-footer-block a { color: var(--green); }
.store-footer-block p a { text-decoration: underline; }

@media (max-width: 940px) {
  .store-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

@media (max-width: 480px) {
  .store-footer { grid-template-columns: 1fr; margin-top: 22px; }
  .store-footer-block { padding: 10px 12px; }
}


.store-footer-block h2::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin-bottom: 8px;
  padding: 6px;
  box-sizing: content-box;
  border-radius: 9px;
  background: var(--footer-icon) center / 18px no-repeat #f3e7fc;
}

.store-footer-block:nth-child(1) {
  --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237429b0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-6 9 6M5 10v10h14V10M9 20v-6h6v6M3 20h18'/%3E%3C/svg%3E");
}
.store-footer-block:nth-child(2) {
  --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237429b0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.5 8.5 0 0 1-8.5 8.5c-1.4 0-2.7-.3-3.8-.9L4 21l1.7-4.7a8.5 8.5 0 1 1 15.3-4.8Z M9 11.5h7M9 14.5h4'/%3E%3C/svg%3E");
}
.store-footer-block:nth-child(3) {
  --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237429b0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 4.5v9L12 21l-9-4.5v-9L12 3Zm0 9 9-4.5M12 12 3 7.5m9 4.5v9M7.5 5.25l9 4.5'/%3E%3C/svg%3E");
}
.store-footer-block:nth-child(4) {
  --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237429b0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 7 3v5c0 4.6-2.7 8-7 10-4.3-2-7-5.4-7-10V6l7-3Zm-3 9 2 2 4-4'/%3E%3C/svg%3E");
}
.store-footer-block:nth-child(5) {
  --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237429b0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v11a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm7 0v5h5m-10 5h6m-6 4h6'/%3E%3C/svg%3E");
}
