:root {
  --bg: #f3f3f3;
  --paper: #ffffff;
  --ink: #161616;
  --muted: #6a6a6a;
  --line: #d9d9d9;
  --pill: #111111;
}

@font-face {
  font-family: "Libre Bodoni Local";
  src: url("./public/fonts/LibreBodoni-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  background: #e6e6e6;
  color: var(--ink);
  padding: 0;
}

button,
input,
select {
  font: inherit;
}

/* Design rule: all buttons across the app must remain square. */
button,
button[type="button"],
button[type="submit"],
button[type="reset"] {
  border-radius: 0 !important;
}

.phone-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: #ececec;
  box-shadow: none;
  position: relative;
  padding-top: 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-nav {
  display: none;
  align-items: center;
  gap: 10px;
}

.mobile-menu-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.topbar-search {
  margin-left: auto;
}

.top-login-btn {
  border: 1px solid #111;
  background: #111;
  color: #fff;
  border-radius: 999px;
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.top-login-btn:hover {
  opacity: 0.92;
}

.top-link {
  border: none;
  background: #fff;
  color: #1a1a1a;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.top-link:hover {
  background: #f3f3f3;
}

.brand {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
}

.brand img {
  width: 100px;
  height: auto;
  object-fit: contain;
  transition: width 0.2s ease;
}

.topbar.topbar--compact .brand img {
  width: 50px;
}

.category-dropdown {
  position: relative;
}

.category-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 180px;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  padding: 6px;
  z-index: 35;
}

.category-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}

.category-item:hover {
  background: #f3f3f3;
}

.topbar-search {
  flex: 0 1 160px;
}

.topbar-search input {
  width: 100%;
  border: 1px solid #d6d6d6;
  border-radius: 0;
  background: #fafafa;
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  outline: none;
}

.topbar-search input:focus {
  border-color: #bdbdbd;
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.top-section {
  padding: 0;
}

.top-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 0;
  overflow: hidden;
  min-height: 300px;
  padding: 0 8px;
  background: #f8f8f8;
}

.top-hero::after {
  display: none;
}

.top-hero-bg {
  position: absolute;
  right: 0;
  top: 50%;
  left: auto;
  width: 70%;
  height: auto;
  max-height: 100%;
  transform: translate(20px, -50%);
  object-fit: contain;
  object-position: right center;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.top-hero-content {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  flex: 0 1 52%;
  max-width: 52%;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.top-hero-mark {
  display: none;
}

.top-kicker {
  font-family: "Libre Bodoni Local", serif;
  font-size: 16px;
  letter-spacing: 4px;
  margin-bottom: 2px;
}

.top-title {
  font-family: "Libre Bodoni Local", serif;
  font-size: 30px;
  line-height: 30px;
  font-weight: 500;
  max-width: 100%;
  margin: 0 0 12px;
}

.top-divider {
  width: 60px;
  height: 1px;
  background: #111;
  position: relative;
  margin: 0 0 12px;
}

.top-divider span {
  width: 6px;
  height: 6px;
  background: #111;
  position: absolute;
  left: calc(50% - 3px);
  top: -2px;
}

.top-tagline {
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.top-cta {
  border: 1px solid #111;
  background: transparent;
  min-width: 190px;
  height: 38px;
  font-size: 12px;
  font-weight: 700;
  font-family: "Playfair Display", serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}

.top-cta:hover {
  background: #111;
  color: #fff;
}

@media (min-width: 400px) {
  .top-hero {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 0 8px;
    min-height: 360px;
  }

  .top-hero-content {
    order: 1;
    flex: 0 1 50%;
    max-width: 50%;
    width: auto;
    min-width: 0;
    margin: 0;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    align-items: flex-start;
    text-align: left;
  }

  .top-hero-bg {
    order: 2;
    position: absolute;
    right: 0;
    top: 50%;
    left: auto;
    width: 70%;
    height: auto;
    max-height: 100%;
    transform: translate(20px, -50%);
    object-fit: contain;
    opacity: 1;
    z-index: 0;
  }

  .top-title {
    font-size: 30px;
  }

  .top-tagline {
    font-size: 14px;
  }

  .top-cta {
    min-width: 216px;
    height: 42px;
    font-size: 14px;
  }
}

@media (min-width: 900px) {
  .top-hero {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    min-height: 530px;
    padding: 0 8px;
    background: #ececec;
  }

  .top-hero-content {
    flex: 0 1 46%;
    max-width: 46%;
    width: auto;
    min-width: 0;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
  }

  .top-hero-bg {
    position: absolute;
    right: 0;
    top: 50%;
    left: auto;
    width: 70%;
    max-width: 560px;
    max-height: 100%;
    transform: translate(20px, -50%);
    object-position: right center;
    object-fit: contain;
    z-index: 0;
  }

  .top-title {
    font-size: 30px;
    line-height: 30px;
    margin: 0 0 12px;
  }

  .top-kicker {
    margin-bottom: 2px;
  }

  .top-divider {
    margin: 0 0 12px;
  }

  .top-tagline {
    margin-bottom: 20px;
  }
}

.type-toggle {
  margin: 2px 14px 8px;
  border: 1px solid #191919;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.type-option {
  border: 0;
  background: #fff;
  padding: 5px;
  font-size: 10px;
  cursor: pointer;
}

.type-option.active {
  background: #111;
  color: #fff;
}

.feed {
  padding: 0 0 24px;
}

.feed-heading {
  margin: 0;
  padding: 10px 8px;
  font-family: "Libre Bodoni Local", serif;
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 2px;
  column-gap: 2px;
  padding-inline: 0;
  align-items: stretch;
}

@media (min-width: 400px) {
  .product-grid {
    padding-inline: 0;
  }
}

@media (min-width: 900px) {
  .product-grid {
    width: 70vw;
    margin-left: 15vw;
    margin-right: 15vw;
    padding-inline: 0;
  }
}

.product-card {
  background: #fff;
  border-radius: 0;
  border: 1px solid #ececec;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.image-wrap {
  border-radius: 0;
  border: 1px solid #f0f0f0;
  background: #f8f8f8;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.fav {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 15px;
  height: 15px;
  border-radius: 0;
  border: 0;
  background: #e8e8e8;
  font-size: 8px;
  color: #222;
  display: grid;
  place-items: center;
}

.preview {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}

.preview .base {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview .emb {
  display: block;
  object-fit: contain;
}

.preview .emb-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preview.custom-mask-preview {
  isolation: isolate;
}

.preview.custom-mask-preview .preview-shirt-fill {
  position: absolute;
  inset: 0;
  z-index: 1;
  -webkit-mask-image: url('./public/customize/tshirt_mask.png');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center top;
  mask-image: url('./public/customize/tshirt_mask.png');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center top;
}

.preview.custom-mask-preview .preview-shirt-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.preview.custom-mask-preview .emb-wrap {
  z-index: 3;
}

.detail-mask-preview .custom-shirt-features-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
  z-index: 2;
  opacity: 0.72;
  mix-blend-mode: multiply;
  filter: grayscale(1) contrast(1.05);
}

.detail-mask-preview[data-shirt-tone="dark"] .custom-shirt-features-overlay {
  mix-blend-mode: normal;
  opacity: 0.2;
  filter: grayscale(1) contrast(1.18) brightness(1.04);
}

.detail-mask-preview[data-shirt-tone="light"] .custom-shirt-features-overlay {
  mix-blend-mode: multiply;
  opacity: 0.72;
  filter: grayscale(1) contrast(1.05);
}

.detail-mask-preview .custom-design-wrap {
  z-index: 3;
}

.card-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.card-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.25s ease;
  will-change: transform;
}

.card-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

.card-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.card-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.8);
  padding: 0;
  cursor: pointer;
}

.card-carousel-dot.active {
  background: #111;
  border-color: #111;
}

.card-title {
  margin-top: 5px;
  padding: 4px 6px 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  min-height: 22px;
}

.card-price {
  margin-top: 8px;
  padding: 0 6px 4px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.card-actions {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 6px;
}

.mini-btn {
  border: 1px solid #111;
  border-radius: 0;
  height: 24px;
  background: #fff;
  font-size: 9px;
  cursor: pointer;
}

.mini-btn.primary {
  background: #111;
  color: #fff;
  font-size: 11px;
  height: auto;
  padding: 10px 12px;
}

.bottom-nav {
  display: none;
}

.tab {
  border: 0;
  background: transparent;
  font-size: 14px;
  color: #2b2b2b;
  cursor: pointer;
}

.tab.active {
  color: #000;
}

.floating-cart {
  position: fixed;
  right: 16px;
  bottom: 86px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  z-index: 45;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
  overflow: visible;
  transition: opacity 180ms ease, transform 180ms ease;
}

.floating-cart.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-cart:active {
  transform: scale(0.98);
}

.floating-cart.cart-pulse {
  animation: cartPulse 260ms ease;
}

.floating-cart.cart-shake {
  animation: cartShake 240ms ease;
}

.floating-cart-icon {
  position: relative;
  z-index: 2;
  font-size: 22px;
  line-height: 1;
}

.floating-cart-poppers {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 170px;
  height: 170px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  transition: opacity 120ms ease;
}

.floating-cart-poppers.is-active {
  opacity: 1;
}

.floating-cart-poppers svg {
  width: 100% !important;
  height: 100% !important;
}

.floating-cart-badge {
  position: absolute;
  top: -5px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3131;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ececec;
  z-index: 3;
}

@media (min-width: 900px) {
  .floating-cart {
    right: 22px;
    bottom: 22px;
  }
}

@keyframes cartPulse {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(0) scale(1.08); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes cartShake {
  0% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(0) translateX(-2px); }
  50% { transform: translateY(0) translateX(2px); }
  75% { transform: translateY(0) translateX(-1px); }
  100% { transform: translateY(0) translateX(0); }
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

.drawer.hidden {
  display: none;
}

.drawer-panel {
  width: 250px;
  height: 100%;
  background: #fff;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
}

.drawer-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid #ececec;
}

.drawer-avatar {
  width: 38px;
  height: 38px;
  border: 1px solid #1a1a1a;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.drawer-profile-name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #161616;
  line-height: 1.2;
}

.drawer-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.drawer-link {
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 10px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}

.drawer-link:hover {
  background: #f3f3f3;
}

.drawer-separator {
  border: 0;
  border-top: 1px solid #ececec;
  margin: 8px 2px;
}

.drawer-link-secondary {
  font-weight: 600;
}

.drawer-logout-btn {
  margin-top: auto;
  width: 100%;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  padding: 10px 8px;
  font-size: 13px;
  cursor: pointer;
}

@media (max-width: 899px) {
  .top-login-btn.is-hidden-mobile {
    display: none;
  }
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.hidden {
  display: none;
}

.sheet {
  width: min(360px, 100%);
  max-height: 94vh;
  min-height: 50vh;
  overflow: auto;
  background: #fff;
  border-radius: 0;
  padding: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
}

#cartOverlay .sheet,
#addressSelectOverlay .sheet,
#ordersOverlay .sheet {
  max-height: 80vh;
  min-height: 0;
  overflow: hidden;
}

#cartContent,
#addressSelectContent,
#ordersContent {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.checkout-modal-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.checkout-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.checkout-modal-footer {
  flex-shrink: 0;
  margin-top: 10px;
  padding-top: 50px;
}

/* Design rule (mobile): popup actions should sit at the bottom when they are the final vertical elements. */
.sheet .auth-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sheet .auth-form > .auth-error + button,
.sheet > .actions:last-child,
.sheet > button:last-child {
  margin-top: auto;
}

@media (min-width: 400px) {
  .sheet {
    min-height: 50vh;
  }
}

@media (min-width: 900px) {
  .sheet {
    width: 60vw;
    max-width: 60vw;
    min-height: 50vh;
    max-height: none;
    overflow: visible;
  }

  #cartOverlay .sheet,
  #addressSelectOverlay .sheet,
  #ordersOverlay .sheet {
    max-height: 80vh;
    min-height: 0;
    overflow: hidden;
  }
}

.orders-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-list-btn {
  width: 100%;
  border: 1px solid #dedede;
  background: #fff;
  text-align: left;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.order-list-btn:hover {
  border-color: #bdbdbd;
  background: #fafafa;
}

.order-list-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #2c2c2c;
}

.order-list-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.order-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center top;
  border: 1px solid #e5e5e5;
  background: #f8f8f8;
}

.order-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #666;
}

.order-list-amount {
  font-weight: 700;
}

.order-detail-card {
  border: 1px solid #e4e4e4;
  background: #fff;
  padding: 10px;
  font-size: 12px;
  color: #232323;
  line-height: 1.45;
}

.order-detail-thumb-wrap {
  margin-bottom: 10px;
}

.order-detail-thumb-wrap .order-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.order-detail-card p + p {
  margin-top: 6px;
}

.order-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-item-card {
  border: 1px solid #ececec;
  background: #fff;
  padding: 10px;
}

.order-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}

.order-item-meta {
  margin-top: 3px;
  font-size: 11px;
  color: #4b4b4b;
}

.order-item-price {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #161616;
}

/* Product details popup sizing */
#detailsOverlay {
  padding-inline: 0;
}

#detailsOverlay .sheet {
  width: 100vw;
  max-width: 100vw;
  border-radius: 0;
}

@media (min-width: 400px) {
  #detailsOverlay {
    padding-inline: 0;
  }

  #detailsOverlay .sheet {
    width: 100vw;
    max-width: 100vw;
  }
}

@media (min-width: 900px) {
  #detailsOverlay .sheet {
    width: 60vw;
    max-width: 60vw;
    border-radius: 0;
  }
}

#detailsOverlay .close-x {
  right: 16px;
  top: 16px;
}

.close-x {
  position: absolute;
  right: 8px;
  top: 6px;
  border: 0;
  background: transparent;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  color: #444;
}

.account-created-sheet {
  background: #fff;
  border-radius: 18px;
  padding: 20px 16px 16px;
  text-align: center;
  overflow: hidden;
}

.account-created-animation {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
}

.account-created-logo,
.account-created-title,
.account-created-subtitle,
#accountCreatedLoginBtn {
  position: relative;
  z-index: 1;
}

.account-created-logo {
  width: 116px;
  height: auto;
  margin: 6px auto 14px;
  display: block;
}

.account-created-title {
  font-family: "Libre Bodoni Local", serif;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  margin-bottom: 8px;
  color: #111;
}

.account-created-subtitle {
  font-size: 13px;
  color: #5b5b5b;
  margin-bottom: 14px;
}

/* Exception: generic alert/confirm dialog should follow content height, not sheet min-height rule. */
.app-dialog-sheet {
  min-height: auto !important;
  width: min(360px, 100%);
  max-width: 100%;
  max-height: 90vh;
  overflow: auto;
}

.app-dialog-message {
  font-size: 13px;
  color: #2f2f2f;
  line-height: 1.45;
  text-align: center;
  margin: 8px 0 14px;
}

.app-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.app-dialog-actions.is-single {
  grid-template-columns: 1fr;
}

.app-dialog-actions .cta:only-child,
.app-dialog-actions .cta-secondary:only-child {
  grid-column: 1 / -1;
}

#accountCreatedLoginBtn {
  margin-top: 2px;
}

.sheet-title {
  text-align: center;
  font-weight: 400;
  font-size: 24px;
  font-family: "Poppins", sans-serif;
  margin-bottom: 8px;
}

.sheet-subtitle {
  text-align: center;
  font-size: 12px;
  color: #5e5e5e;
  line-height: 1.4;
  margin: 0 0 10px;
}

.details-head {
  position: relative;
  width: 92%;
  margin-inline: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #f7f7f7;
  overflow: hidden;
}

.product-name {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

.price {
  margin-top: 2px;
  font-weight: 400;
  font-size: 20px;
}

.field {
  margin-top: 8px;
}

.field label {
  display: block;
  font-size: 11px;
  color: #2c2c2c;
  margin-bottom: 4px;
}

.field select {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 0;
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

.field input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 0;
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  background: #fff;
}

.field textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 0;
  min-height: 66px;
  padding: 6px 10px;
  font-size: 11px;
  background: #fff;
  resize: vertical;
}

.auth-error {
  min-height: 16px;
  margin-top: 6px;
  color: #b40000;
  font-size: 11px;
}

.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #d8d8d8;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.swatch.active {
  outline: 2px solid #111;
}

.swatch:disabled,
.swatch.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.swatch:disabled::after,
.swatch.is-disabled::after {
  content: "";
  position: absolute;
  inset: 4px;
  background:
    linear-gradient(45deg, transparent calc(50% - 0.5px), #111 calc(50% - 0.5px), #111 calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(-45deg, transparent calc(50% - 0.5px), #111 calc(50% - 0.5px), #111 calc(50% + 0.5px), transparent calc(50% + 0.5px));
  pointer-events: none;
}

.swatches-empty {
  min-height: 30px;
  align-items: center;
}

.swatches-empty-text {
  font-size: 11px;
  color: #777;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-btn {
  border: 0;
  background: transparent;
  color: #577ad6;
  font-size: 10px;
  cursor: pointer;
}

.text-only-btn {
  border: 0;
  background: transparent;
  color: #2563eb;
  padding: 0;
  margin-top: 6px;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.auth-inline-link {
  align-self: flex-start;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.actions > :only-child {
  grid-column: 1 / -1;
}

.cta,
.cta-secondary {
  border: 1px solid #111;
  border-radius: 0;
  height: 33px;
  font-size: 11px;
  cursor: pointer;
  width: 100%;
}

/* Design rule: primary buttons are black with white text; secondary buttons are white with black border/text. */
.cta {
  background: #111;
  color: #fff;
}

.cta-secondary {
  background: #fff;
}

.description p {
  color: #666;
  font-size: 10px;
  line-height: 1.45;
}

.address-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.address-default-btn {
  width: 100%;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  text-align: left;
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.address-or-divider {
  position: relative;
  text-align: center;
  margin: 4px 0;
}

.address-or-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #d5d5d5;
  transform: translateY(-50%);
}

.address-or-divider span {
  position: relative;
  background: #fff;
  padding: 0 8px;
  font-size: 11px;
  color: #666;
}

.address-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.address-type-btn {
  border: 1px solid #cfcfcf;
  background: #fff;
  color: #222;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
}

.address-type-btn .icon {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.address-type-btn .label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.address-type-btn.is-active {
  border-color: #111;
  background: #111;
  color: #fff;
}

.address-custom-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.address-custom-fields.hidden {
  display: none;
}

.address-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checkout-list {
  margin-top: 6px;
  border-top: 1px solid #efefef;
}

.checkout-item {
  padding: 8px 0;
  border-bottom: 1px solid #efefef;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
}

.checkout-item .mini {
  width: 56px;
}

.cart-preview-shot {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}

.cart-preview-placeholder {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #777;
  background: #f5f5f5;
  border-radius: 6px;
  text-align: center;
  padding: 4px;
}

.meta {
  font-size: 10px;
  color: #4b4b4b;
}

.qty {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty button {
  width: 18px;
  height: 18px;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.summary {
  margin-top: 10px;
  font-size: 11px;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  margin: 3px 0;
}

.sum-row.total {
  font-weight: 700;
  font-size: 14px;
  margin-top: 5px;
}

.upload-area {
  border: 1px dashed #cfcfcf;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  background: #fafafa;
}

.upload-area p {
  font-size: 10px;
}

.upload-area small {
  display: block;
  margin-top: 4px;
  color: #777;
  font-size: 9px;
}

.upload-trigger {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 26px;
  border: 1px solid #111;
  border-radius: 999px;
  font-size: 10px;
  cursor: pointer;
}

.upload-trigger input {
  display: none;
}

.preview-box {
  margin-top: 10px;
  border: 1px solid #efefef;
  border-radius: 8px;
  background: #f8f8f8;
  overflow: hidden;
}

.customize-sheet {
  min-height: 92vh;
}

.custom-upload-area {
  margin-top: 6px;
  cursor: pointer;
}

.custom-upload-area .upload-trigger {
  margin-inline: auto;
}

.custom-upload-area input {
  display: none;
}

.custom-preview-box {
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  background: #efefef;
  padding: 8px;
  position: relative;
  --custom-shirt-color: #000000;
}

/* Use the T-shirt PNG mask to color the garment while keeping controls unmasked. */
.custom-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  margin-inline: auto;
  aspect-ratio: 1 / 1.05;
  padding: 16px;
  background: transparent;
  isolation: isolate;
}

.custom-shirt-stage {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.custom-shirt-color-layer {
  position: absolute;
  inset: 0;
  background: var(--custom-shirt-color);
  z-index: 1;

  -webkit-mask-image: url('./public/customize/tshirt_mask.png');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center top;

  mask-image: url('./public/customize/tshirt_mask.png');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center top;
}

.custom-shirt-features-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  pointer-events: none;
  z-index: 2;
  opacity: 0.72;
  mix-blend-mode: multiply;
  filter: grayscale(1) contrast(1.05);
}

.custom-preview-box[data-shirt-tone="dark"] .custom-shirt-features-overlay {
  /* Keep black garments deep while still showing seam lines. */
  mix-blend-mode: normal;
  opacity: 0.2;
  filter: grayscale(1) contrast(1.18) brightness(1.04);
}

.custom-preview-box[data-shirt-tone="light"] .custom-shirt-features-overlay {
  mix-blend-mode: multiply;
  opacity: 0.72;
  filter: grayscale(1) contrast(1.05);
}

.custom-preview-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* Layer that displays the uploaded design above the masked shirt color. */
#customPreviewImageLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.custom-design-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.custom-design-image {
  position: absolute;
  display: block;
  object-fit: contain;
  max-width: none;
  z-index: 4;
}

.move-btn {
  border: 1px solid #7c7c7c;
  background: rgba(255, 255, 255, 0.92);
  width: 28px;
  height: 28px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  position: absolute;
  pointer-events: auto;
  border-radius: 999px !important;
  opacity: 0.5;
}

.move-up {
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
}

.move-left {
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.move-right {
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.move-down {
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}

.custom-options {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.custom-option-group {
  border-radius: 10px;
  background: #f2f2f2;
  padding: 10px;
}

.custom-accordion-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  cursor: pointer;
}

.custom-accordion-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.custom-accordion-body {
  margin-top: 8px;
}

.custom-option-group.is-collapsed .custom-accordion-arrow {
  transform: rotate(-90deg);
}

.custom-option-group.is-collapsed .custom-accordion-body {
  display: none;
}

.custom-option-label {
  font-size: 11px;
  letter-spacing: 0.4px;
  margin-bottom: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  border: 1px solid #6f6f6f;
  background: #fff;
  color: #141414;
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 8px;
  min-height: 20px;
  cursor: pointer;
}

.chip-btn.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.chip-btn:disabled,
.chip-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #e8e8e8;
  color: #666;
  border-color: #bdbdbd;
}

.chip-row-size {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.chip-size {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 4px;
}

.chip-size span {
  font-size: 10px;
  line-height: 1.1;
}

.chip-size small {
  margin-top: 2px;
  font-size: 8px;
  text-transform: none;
}

.custom-swatch {
  min-width: 58px;
}

.custom-continue {
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.preview-box {
  margin-top: 10px;
  border: 1px solid #efefef;
  border-radius: 8px;
  background: #f8f8f8;
  overflow: hidden;
}

/* DESKTOP OVERRIDES (min-width: 900px) */
@media (min-width: 900px) {
  .phone-shell {
    padding-top: 72px;
  }

  .topbar-left {
    gap: 64px;
  }

  .mobile-menu-btn {
    display: none;
  }

  .topbar-nav {
    display: flex;
  }

  .drawer {
    display: none;
  }

  .topbar {
    padding: 12px 22px;
    gap: 16px;
  }

  .top-link {
    padding: 8px 14px;
    font-size: 13px;
  }

  .topbar-search {
    flex-basis: 320px;
  }

  .topbar-search input {
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .feed {
    padding: 22px 38px 38px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding-inline: 16px;
    align-items: stretch;
  }

  .product-card {
    background: #ececec;
    border-radius: 0;
    border: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .image-wrap {
    border-radius: 0;
    border: 0;
    background: #d5d5d5;
  }

  .card-title {
    margin-top: 8px;
    font-size: 16px;
    min-height: 40px;
  }

  .card-price {
    margin-top: 4px;
    font-size: 22px;
  }

  .card-actions {
    gap: 8px;
    margin-top: auto;
    padding: 10px;
  }

  .mini-btn {
    border-radius: 0;
    height: 34px;
    font-size: 12px;
  }
}
