:root {
  --paper: #f5f3ef;
  --panel: #ede9e2;
  --card: #ffffff;
  --line: #ddd6cb;
  --ink: #4a4742;
  --muted: #736e65;
  --accent: #b56a41;
  --shell-gutter: 2rem;
  --sand-beige: #ece2d3;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Manrope', sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.page {
  width: 90vw;
  max-width: none;
  margin: 0 auto;
  min-height: 100vh;
}

.header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.206rem 2rem;
}

.logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.logo img {
  display: block;
  height: 76px;
  width: auto;
  filter: brightness(0) saturate(100%) invert(37%) sepia(4%) saturate(428%) hue-rotate(355deg) brightness(94%) contrast(86%);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.55rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav a {
  text-decoration: none;
  color: #5b5a57;
  font-size: 0.94rem;
  font-weight: 600;
}

.nav-personalize {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.4rem 0.62rem;
  border-radius: 999px;
  background: #ece2d3;
  color: #67452f !important;
}

.nav-personalize.is-active {
  box-shadow: 0 0 0 2px #b56a41 inset;
}

.nav-personalize span {
  display: inline-block;
  padding: 0.09rem 0.4rem;
  border-radius: 999px;
  background: #b56a41;
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.nav-icons {
  display: flex;
  gap: 0.35rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: #f0efeb;
}

.icon-btn:focus-visible {
  outline: 2px solid #b7b2aa;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #6a6763;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.personalize-main {
  padding: 1.2rem 0 2rem;
}

.personalize-main h1 {
  margin: 0;
  font-size: 2rem;
}

.personalize-main .lead {
  margin: 0.45rem 0 1rem;
  color: var(--muted);
}

.personalize-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
}

.filter-pane,
.canvas-pane {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}

.filter-pane {
  padding: 1rem;
}

.filter-group {
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #ece7de;
}

.filter-group:last-of-type {
  border-bottom: 0;
}

.filter-group h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.filter-pane select {
  width: 100%;
  border: 1px solid #d8d0c3;
  border-radius: 6px;
  padding: 0.48rem 0.52rem;
  font: inherit;
  background: #fcfbf8;
}

.filter-group-last {
  margin-bottom: 0;
  padding-bottom: 0;
}

.product-grid-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-height: 360px;
  overflow: auto;
  padding-right: 0.1rem;
}

.product-tile {
  border: 1px solid #ddd6cb;
  border-radius: 6px;
  padding: 0.4rem;
  background: #fbf9f5;
  display: grid;
  gap: 0.4rem;
  cursor: pointer;
  text-align: left;
}

.product-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e8e0d3;
}

.product-tile span {
  font-size: 0.78rem;
  line-height: 1.25;
  color: #5a564f;
  font-weight: 700;
}

.product-tile.is-selected {
  border-color: #b56a41;
  box-shadow: 0 0 0 1px #b56a41 inset;
}

.attribute-grid-select {
  display: grid;
  gap: 0.45rem;
  min-height: 2.4rem;
}

.attribute-group {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 0.45rem;
}

.attribute-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #5a564f;
  white-space: nowrap;
}

.attribute-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
}

.attribute-tile {
  border: 1px solid #ddd6cb;
  border-radius: 6px;
  padding: 0.34rem 0.52rem;
  background: #fbf9f5;
  color: #5a564f;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.attribute-tile.is-selected {
  border-color: #b56a41;
  box-shadow: 0 0 0 1px #b56a41 inset;
}

.attribute-tile.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}

.attribute-tile.is-disabled:hover::after {
  content: 'stock habis';
  position: absolute;
  left: 50%;
  top: -0.45rem;
  transform: translate(-50%, -100%);
  background: rgba(31, 31, 31, 0.94);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 6;
  pointer-events: none;
}

.color-grid-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  min-height: 2.4rem;
}

.color-tile {
  border: 1px solid #ddd6cb;
  border-radius: 6px;
  padding: 0.44rem 0.5rem;
  background: #fbf9f5;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #5a564f;
  min-height: 2.2rem;
}

.color-swatch {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--swatch, #b4a18f);
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex: 0 0 auto;
}

.color-tile.is-selected {
  border-color: #b56a41;
  box-shadow: 0 0 0 1px #b56a41 inset;
}

.color-tile.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}

.color-tile.is-disabled:hover::after {
  content: 'stock habis';
  position: absolute;
  left: 50%;
  top: -0.45rem;
  transform: translate(-50%, -100%);
  background: rgba(31, 31, 31, 0.94);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 6;
  pointer-events: none;
}

.meta-empty {
  grid-column: 1 / -1;
  font-size: 0.86rem;
  color: #7a746a;
  margin: 0.2rem 0;
}

.apply-btn {
  width: 100%;
  margin-top: 0.65rem;
}

.apply-btn:disabled {
  background: #d5cdc1;
  color: #7e7467;
  cursor: not-allowed;
}

.canvas-pane {
  padding: 1rem;
}

.canvas-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  gap: 0.7rem;
}

.canvas-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.logo-type-row {
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  border: 1px solid #5a3b28;
  border-radius: 8px;
  background: #67452f;
  padding: 0.3rem 0.45rem;
}

.logo-type-field {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.logo-type-field span {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f3e8dc;
  white-space: nowrap;
}

.logo-type-field select {
  width: min(280px, 100%);
  border: 1px solid #aa8a74;
  border-radius: 6px;
  padding: 0.42rem 0.52rem;
  font: inherit;
  background: #f9f5ef;
}

.logo-sample-link {
  border: 0;
  background: transparent;
  color: #f3e8dc;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15rem;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.45rem 0;
}

.logo-sample-link:disabled,
.logo-sample-link[aria-disabled='true'] {
  opacity: 0.52;
  cursor: not-allowed;
  text-decoration: none;
}

.canvas-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #ddd5c8;
  border-radius: 8px;
  overflow: hidden;
  background: #ece2d3;
}

.canvas-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: none;
}

.canvas-stage.has-product img {
  display: block;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: #7a746a;
  font-weight: 600;
  padding: 1rem;
}

.canvas-stage.has-product .placeholder {
  display: none;
}

.personalize-zone {
  position: absolute;
  border: 2px dashed rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.14);
  display: none;
}

.canvas-stage.has-product .personalize-zone {
  display: block;
}

.zone-label {
  position: absolute;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  display: none;
  pointer-events: none;
  z-index: 6;
}

.text-item {
  position: absolute;
  border: 1px dashed rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.12);
  cursor: move;
  user-select: none;
  transform-origin: center;
  padding: 6px;
}

.text-item.is-selected {
  border-color: #f9efe1;
  box-shadow: 0 0 0 1px rgba(249, 239, 225, 0.4);
}

.text-content {
  position: absolute;
  inset: 6px;
  color: #f9efe1;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.42);
  font-weight: 500;
  line-height: 1.2;
  outline: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: text;
}

.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  right: -6px;
  bottom: -6px;
  border: 0;
  border-radius: 2px;
  background: #f9efe1;
  cursor: nwse-resize;
  padding: 0;
}

.rotate-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  left: 50%;
  transform: translateX(-50%);
  top: -20px;
  border: 1px solid #f9efe1;
  border-radius: 50%;
  background: #b56a41;
  cursor: grab;
  padding: 0;
}

.canvas-tools {
  margin-top: 0.9rem;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  flex-wrap: nowrap;
  z-index: 20;
}

.canvas-tools.is-sticky-active {
  position: sticky;
  top: 0.4rem;
}

.canvas-tools.is-disabled {
  opacity: 0.58;
}

.canvas-tools.is-disabled .btn,
.canvas-tools.is-disabled .tool-field select,
.canvas-tools.is-disabled .tool-field input,
.canvas-tools.is-disabled .style-dropdown summary {
  pointer-events: none;
}

.ribbon-box {
  border: 1px solid #5a3b28;
  border-radius: 8px;
  background: #67452f;
  padding: 0.3rem;
}

.ribbon-box-add {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.ribbon-box-tools {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 0.35rem;
}

.canvas-tools .btn {
  height: 34px;
  min-height: 34px;
  padding: 0 0.55rem;
  line-height: 1;
  font-size: 0.8rem;
  white-space: nowrap;
}

.font-tools-inline {
  display: contents;
}

.font-tools-inline .tool-field {
  min-width: 0;
}

.tool-field {
  display: grid;
  gap: 0.18rem;
}

.tool-field span {
  font-size: 0.67rem;
  color: #f3e8dc;
  font-weight: 700;
  display: none;
}

.tool-field select {
  border: 1px solid #aa8a74;
  border-radius: 6px;
  padding: 0 0.4rem;
  font: inherit;
  background: #f9f5ef;
  width: 100%;
  height: 34px;
  min-height: 34px;
  line-height: 1;
  font-size: 0.82rem;
}

.tool-field input[type='color'] {
  width: 100%;
  height: 34px;
  min-height: 34px;
  border: 1px solid #aa8a74;
  border-radius: 6px;
  background: #f9f5ef;
  padding: 0.08rem;
  min-width: 54px;
  box-sizing: border-box;
}

.style-dropdown {
  position: relative;
  min-width: 0;
}

.style-dropdown summary {
  list-style: none;
  border: 1px solid #aa8a74;
  border-radius: 6px;
  background: #f9f5ef;
  height: 34px;
  min-height: 34px;
  padding: 0 0.6rem;
  line-height: 34px;
  font-size: 0.82rem;
  color: #4b443b;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.style-dropdown summary::-webkit-details-marker {
  display: none;
}

.style-dropdown .style-menu {
  position: absolute;
  top: calc(100% + 0.28rem);
  right: 0;
  background: #f9f5ef;
  border: 1px solid #aa8a74;
  border-radius: 6px;
  padding: 0.38rem 0.5rem;
  min-width: 150px;
  display: grid;
  gap: 0.25rem;
  z-index: 8;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.style-dropdown .style-menu label {
  font-size: 0.82rem;
  color: #4b443b;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.tool-field select:disabled,
.tool-field input[type='color']:disabled {
  opacity: 0.55;
}

.style-dropdown.is-disabled {
  opacity: 0.55;
}

.style-dropdown.is-disabled summary {
  pointer-events: none;
}

.delete-text-btn {
  width: 100%;
  min-height: 34px;
}

.delete-text-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.actions {
  margin-top: 0.8rem;
  display: flex;
  justify-content: center;
}

.btn {
  border: 0;
  border-radius: 6px;
  padding: 0.58rem 0.84rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  background: #ece2d3;
  color: #67452f;
}

.buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  min-height: 62px;
  padding: 0.87rem 1.26rem;
  font-size: 1.32rem;
}

.buy-btn.is-disabled {
  background: #c4b8aa;
  pointer-events: none;
}

.personalize-cart-toast {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translate(-50%, -8px);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(38, 31, 26, 0.92);
  color: #f7efe4;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 18px rgba(34, 24, 18, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 170ms ease, transform 170ms ease;
  z-index: 1700;
}

.personalize-cart-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.personalize-cart-fly-ghost {
  position: fixed;
  top: 0;
  left: 0;
  width: 120px;
  height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 22px rgba(33, 20, 13, 0.22);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.98;
  pointer-events: none;
  z-index: 1805;
}

.shared-floating-cart.is-cart-receiving,
.icon-btn.is-cart-receiving {
  animation: personalize-cart-receive-bounce 380ms cubic-bezier(0.22, 0.72, 0.2, 1);
}

@keyframes personalize-cart-receive-bounce {
  0% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-5px) scale(1.09);
  }
  75% {
    transform: translateY(1px) scale(0.97);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.logo-sample-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.logo-sample-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 27, 21, 0.44);
}

.logo-sample-dialog {
  position: relative;
  width: min(620px, calc(100% - 2rem));
  margin: 3rem auto;
  background: #fff;
  border: 1px solid #d8d0c3;
  border-radius: 10px;
  padding: 0.95rem;
  box-shadow: 0 18px 40px rgba(26, 17, 10, 0.24);
}

.logo-sample-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.logo-sample-head h2 {
  margin: 0;
  color: #4f4338;
  font-size: 1.06rem;
}

.logo-sample-close {
  border: 1px solid #d8d0c3;
  border-radius: 8px;
  background: #fff;
  color: #6e655c;
  width: 34px;
  height: 34px;
  line-height: 1;
  cursor: pointer;
}

.logo-sample-body {
  min-height: 240px;
  display: grid;
  place-items: center;
  border: 1px solid #ece5d9;
  border-radius: 8px;
  background: #faf8f4;
  padding: 1rem;
}

.logo-sample-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.logo-sample-empty {
  color: #7a746a;
  font-size: 0.9rem;
  text-align: center;
}

.note {
  margin-top: 0.55rem;
  color: #766f65;
  font-size: 0.84rem;
}

.contact-footer {
  width: 100%;
  margin: 0;
  border-top: 1px solid #5a3e2b;
  background: #67452f;
  color: #ece2d3;
  padding: 1.6rem 2rem 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  gap: 1.2rem;
}

.footer-col {
  min-width: 0;
}

.footer-title {
  margin: 0 0 0.55rem;
  color: #f0e7da;
  font-size: 1rem;
  font-weight: 800;
}

.footer-title-link {
  display: inline-block;
  text-decoration: none;
}

.footer-title-link:hover,
.footer-title-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.footer-text {
  margin: 0;
  color: #e4d5c1;
  line-height: 1.55;
  font-size: 0.75rem;
}

.footer-link {
  display: block;
  text-decoration: none;
  color: #e8dbc9;
  margin: 0.3rem 0;
  font-weight: 600;
  font-size: 0.75rem;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.2rem;
}

.social-link {
  color: #ece2d3;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-link svg {
  width: 22px;
  height: 22px;
  display: block;
}

.social-link svg * {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.social-link .tiktok-path {
  fill: currentColor;
  stroke: none;
}

.social-link:hover,
.social-link:focus-visible {
  color: #ffffff;
}

.whatsapp-cta {
  position: fixed !important;
  left: auto !important;
  right: calc((100vw - min(1024px, 100vw)) / 2 + var(--shell-gutter)) !important;
  bottom: 1.15rem !important;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid #1dad55;
  box-shadow: 0 12px 24px rgba(22, 99, 52, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  z-index: 1200;
}

.whatsapp-cta span {
  display: none;
}

.whatsapp-cta svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.whatsapp-cta:hover,
.whatsapp-cta:focus-visible {
  background: #1fab57;
  box-shadow: 0 14px 26px rgba(37, 211, 102, 0.32);
  transform: translateY(-2px) scale(1.03);
}

@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .header-inner {
    padding: 0.3rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav {
    gap: 0.85rem;
  }

  .personalize-main {
    padding: 1rem;
  }

  .personalize-layout {
    grid-template-columns: 1fr;
  }

  .contact-footer {
    padding-left: 1rem;
    padding-right: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .logo img {
    height: 36px;
  }

  .attribute-group {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .canvas-tools {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .font-tools-inline {
    flex-wrap: wrap;
  }
}
