/* ===== Overlay ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
}

.overlay.open {
  display: block;
}

/* ===== Drawer ===== */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(470px, 100%);
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 3px solid var(--ink);
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px;
  border-bottom: 2px solid #ededf0;
}

.drawer-head h2 {
  margin: 0;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.drawer-foot {
  padding: 20px;
  border-top: 2px solid #ededf0;
  background: #fbfbfc;
}

/* ===== Cart Items ===== */
.cart-item,
.order-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 2px solid #ededf0;
}

.cart-item img,
.order-item img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border: 2px solid #ededf0;
  border-radius: 14px;
  background: #f7f7f8;
}

/* ===== Modal Base ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(960px, 100%);
  max-height: min(calc(var(--real-vh, 1vh) * 92), 940px);
  height: fit-content;
  overflow: visible;
  border: 3px solid #000;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform: translateY(8px);
  transition: transform 0.25s ease;
}

.modal.open .modal-panel {
  transform: translateY(0);
}

.modal-panel::-webkit-scrollbar {
  display: none;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
}

.modal-head h2 {
  margin: 0;
}

.modal-content {
  padding: 0 20px 20px;
}

.modal-close-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  flex-shrink: 0;
  box-shadow: none;
  cursor: pointer;
}

.modal-close-btn:hover {
  background: var(--soft);
  border-color: #ebebef;
}

.modal-close-btn:active {
  transform: translateY(1px);
}

/* ===== Product Detail Modal ===== */
#productModal .modal-head {
  display: none;
}

#productModal .modal-content {
  padding: 0;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  transition: grid-template-columns 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --dynamic-thumb-pt: 24px;
}

.detail-image {
  transition: aspect-ratio 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s ease;
}

.detail-thumbs-row, 
.detail-actions {
  transition: padding 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Adaptive Layouts based on Aspect Ratio */

/* 1. Square (1:1) - Classic Premium Look */
.product-detail.ratio-1-1,
.product-detail.ratio-original {
  grid-template-columns: 1.25fr 0.75fr;
}

/* 2. Portrait (4:5) - Balanced Editorial Look */
.product-detail.ratio-4-5 {
  grid-template-columns: 1fr 1fr;
}

/* 3. Tall (9:16) - Smartphone / Cinematic Look */
.product-detail.ratio-9-16 {
  grid-template-columns: 0.8fr 1.2fr;
}

.product-detail.ratio-1-1 .detail-image,
.product-detail.ratio-original .detail-image {
  height: auto;
  max-height: none;
  aspect-ratio: 1 / 1;
}

.product-detail.ratio-4-5 .detail-image {
  height: auto;
  max-height: none;
  aspect-ratio: 4 / 5;
}

.product-detail.ratio-9-16 .detail-image {
  height: auto;
  max-height: none;
  aspect-ratio: 9 / 16;
}


.detail-left {
  grid-area: 1 / 1 / 2 / 2;
  padding: 40px 24px 0 40px;
  display: flex;
  flex-direction: column;
}

.detail-right {
  grid-area: 1 / 2 / 2 / 3;
  padding: 40px 40px 0 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.detail-thumbs-row {
  grid-area: 2 / 1 / 3 / 2;
  padding: var(--dynamic-thumb-pt, 24px) 24px 60px 40px;
}

/* For 9:16, we might want thumbnails under the wider text area if needed, but keeping it consistent for now */

.detail-image {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--paco-image-radius, 0px) !important;
  background: #f7f7f8;
  padding: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-image img {
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  transition: opacity 0.3s ease;
}


.thumbs {
  display: flex;
  gap: 10px;
  margin-top: 0px;
  overflow: auto;
  padding: 12px 0;
}

.thumbs button {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid #ededf0;
  border-radius: var(--paco-image-radius, 0px) !important;
  background: #fff;
  transition: all 160ms ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbs button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumbs button.active {
  border-color: var(--ink);
  background: var(--paper);
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.detail-tag {
  padding: 6px 12px;
  background: #f1f1f4;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-title {
  margin: 0 0 2px;
  font-size: 3rem;
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.detail-price {
  font-size: 1.8rem;
  font-weight: 950;
  margin-bottom: 8px;
  color: var(--ink);
}

.detail-subtitle {
  color: #888;
  font-size: 0.95rem;
  margin: 0 0 20px;
  line-height: 1.4;
  font-weight: 800;
}

.detail-info {
  margin-top: auto;
  padding-top: 24px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border: none;
  font-size: 0.88rem;
  font-weight: 800;
}

.info-row span {
  color: #999;
}

.stock-status {
  color: #1b6b35;
  font-weight: 900;
}

.detail-actions {
  grid-area: 2 / 2 / 3 / 3;
  padding: var(--dynamic-thumb-pt, 24px) 40px 60px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: flex-end;
}

.qty-line {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.9rem;
  font-weight: 950;
  color: #000;
}

.qty-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
  background: #f7f7f8;
  border-radius: 999px;
}

.qty-selector button {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-weight: 950;
}

.modal-add-btn {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 950;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.modal-add-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.modal-add-btn:not(:disabled):active {
  transform: scale(0.98);
  box-shadow: none;
}

.modal-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #888 !important;
  color: #fff !important;
  border: 2px solid transparent !important;
}

.modal-add-btn.added {
  background-color: #4ade80 !important;
  background: #4ade80 !important;
  color: #000 !important;
  border: none !important;
  pointer-events: none;
}

/* ===== Custom Option Drops ===== */
.option-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.custom-select-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  user-select: none;
}

.custom-select-container h4 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-select-trigger {
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  background: var(--paper);
  border: 2px solid #ededf0;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 850;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 160ms ease;
}

.custom-select-trigger:hover {
  border-color: var(--ink);
}

.custom-select-trigger svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.custom-select-container.open .custom-select-trigger {
  border-color: var(--ink);
}

.custom-select-container.open .custom-select-trigger svg {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.custom-select-container.open .custom-select-options {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.custom-option {
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms ease;
}

.custom-option:hover {
  background: #f7f7f8;
}

.custom-option.selected {
  background: var(--ink);
  color: var(--paper);
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

/* ===== Checkout Modal ===== */
.checkout-panel {
  width: min(640px, 92vw);
  max-height: calc(var(--real-vh, 1vh) * 88);
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  border-radius: 16px;
}

#checkoutModal .modal-head {
  display: flex;
  position: sticky;
  top: 0;
  background: #f8f8f9;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 10;
  align-items: center;
  justify-content: space-between;
}

#checkoutModal .modal-head h2 {
  font-size: 1.35rem;
  font-weight: 950;
  margin: 0;
}

#checkoutModal .modal-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  background: var(--paper);
  scrollbar-width: none;
}

#checkoutModal .modal-scroll-area::-webkit-scrollbar {
  display: none;
}

.modal-foot-sticky {
  padding: 24px 32px 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--paper);
  z-index: 2;
}

.account-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 32px;
  border: 1px solid #d0e2ff;
  border-radius: 18px;
  background: #f1f7ff;
}

.account-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  color: #0066ff;
  border: 1px solid #d0e2ff;
  flex-shrink: 0;
}

.account-box strong {
  display: block;
  font-size: 1rem;
  color: #003366;
}

.account-box p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #557799;
}

.order-total-line {
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.order-total-line strong:first-child {
  font-size: 1.1rem;
  color: var(--muted);
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== Shipping Summary ===== */
.shipping-summary-box {
  padding: 16px;
  border: 1px solid #ededf0;
  border-radius: 16px;
  background: #f8f8f9;
  margin-bottom: 32px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}

.summary-line span {
  color: var(--muted);
  flex-shrink: 0;
  width: 60px;
}

.summary-line strong {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

/* ===== Payment Grid ===== */
.payment-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 20px;
  border-radius: 20px;
  background: #fcfcfc;
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 200ms ease;
  width: 100%;
  text-align: left;
  min-height: 84px;
}

.payment-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.15);
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.payment-card.active {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.payment-card.promptpay.active {
  border-color: #1e4b8f;
  background: rgba(30, 75, 143, 0.04);
  box-shadow: 0 4px 14px rgba(30, 75, 143, 0.1);
}

.payment-card.promptpay.active .payment-icon {
  background: rgba(30, 75, 143, 0.1);
  color: #1e4b8f;
}

.payment-card.card.active {
  border-color: #222;
  background: rgba(0, 0, 0, 0.03);
}

.payment-card.card.active .payment-icon {
  background: rgba(0, 0, 0, 0.08);
  color: #222;
}

.payment-card.stripe.active {
  border-color: #635bff;
  background: rgba(99, 91, 255, 0.04);
  box-shadow: 0 4px 14px rgba(99, 91, 255, 0.1);
}

.payment-card.stripe.active .payment-icon {
  background: rgba(99, 91, 255, 0.1);
  color: #635bff;
}

.payment-card.bank.active {
  border-color: #475569;
  background: rgba(71, 85, 105, 0.04);
  box-shadow: 0 4px 14px rgba(71, 85, 105, 0.1);
}

.payment-card.bank.active .payment-icon {
  background: rgba(71, 85, 105, 0.1);
  color: #475569;
}

.payment-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f1f4;
  color: var(--ink);
  flex-shrink: 0;
}

.payment-card.active .payment-icon {
  background: var(--soft);
}

.payment-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.payment-info strong {
  font-size: 1.05rem;
  font-weight: 900;
  display: block;
}

.payment-info span {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ===== PromptPay Modal ===== */
.promptpay-panel {
  width: min(420px, 92vw);
  border-radius: 16px;
  background: var(--paper);
  overflow: hidden;
}

.promptpay-modal {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.promptpay-header {
  position: relative;
  text-align: center;
  margin-bottom: 28px;
  width: 100%;
}

.promptpay-close {
  position: absolute;
  top: -8px;
  right: -8px;
}

.pp-logo-circle {
  width: 52px;
  height: 52px;
  background: #1e4b8f;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.promptpay-header h2 {
  font-size: 1.4rem;
  font-weight: 950;
  margin: 0;
}

.promptpay-header p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 4px 0 0;
}

.qr-card {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.qr-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-amount-card {
  width: 100%;
  padding: 16px 20px;
  background: #f7f7f8;
  border-radius: 20px;
  margin-bottom: 16px;
}

.payment-amount-card span {
  display: block;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 2px;
  letter-spacing: 0.05em;
}

.payment-amount-card strong {
  font-size: 1.8rem;
  font-weight: 950;
  color: var(--ink);
}

.pp-id-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
  background: var(--paper);
  border: 1px solid #ededf0;
  padding: 8px 16px;
  border-radius: 999px;
}

.pp-id-box strong {
  color: var(--ink);
}

.copy-icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease;
  padding: 0;
}

.copy-icon-btn:hover {
  color: var(--ink);
}

.pp-instructions {
  width: 100%;
  padding: 24px;
  background: #fcfcfc;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 24px;
  text-align: left;
  margin-bottom: 28px;
}

.pp-instructions ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.9rem;
  color: #555;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pp-instructions ol li::marker {
  font-weight: 900;
  color: #1e4b8f;
}

.promptpay-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.promptpay-submit {}

.pp-timer {
  margin-top: 16px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}

/* ===== Auth Modal ===== */
.auth-panel {
  width: min(420px, 92vw);
  border-radius: 42px;
  background: var(--paper);
  overflow: hidden;
}

.auth-content {
  padding: 0 32px 32px;
}

.auth-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 2px solid #ededf0;
}

.auth-tab {
  padding: 12px 0;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 200ms ease;
}

.auth-tab.active {
  color: var(--ink);
}

.auth-tab::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform 200ms ease;
  transform-origin: left;
}

.auth-tab.active::after {
  transform: scaleX(1);
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.social-btn.google {
  background: #fff;
  border: 1px solid #ededf0;
  color: #3c4043;
}

.social-btn.apple {
  background: #000;
  border: 1px solid #000;
  color: #fff;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 2px solid #ededf0;
}

.auth-divider span {
  padding: 0 12px;
}

.auth-forgot {
  text-align: right;
  margin-top: -8px;
  margin-bottom: 20px;
}

.auth-submit {
  width: 100%;
  height: 48px;
  font-size: 1.05rem;
  border-radius: 14px;
}

.auth-disclaimer {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ===== Studio Product Modal (Rebuild) ===== */
.studio-modal-panel {
  width: min(1040px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 42px;
}

.studio-modal-panel .modal-content {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  height: 100%;
  overflow: hidden;
}

.dash-left,
.dash-right {
  overflow-y: auto;
  padding: 32px;
  scrollbar-width: none !important;
}

.dash-left {
  background: #fbfbfd;
  border-right: 2px solid #ededf0;
}

.dash-right {
  background: var(--paper);
}

.section-group {
  margin-bottom: 40px;
}

.section-group:last-child {
  margin-bottom: 0;
}

.section-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* Image Manager */
.image-manager {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drop-zone {
  border: 2px dashed #d1d1d6;
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  transition: all 200ms ease;
  cursor: pointer;
  background: #fff;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--ink);
  background: #f7f7f8;
}

.drop-zone svg {
  color: #d1d1d6;
  margin-bottom: 12px;
}

.drop-zone p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 800;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.image-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  background: #fff;
  border: 2px solid #ededf0;
  overflow: hidden;
}

.image-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.remove-img-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  border: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.image-slot:hover .remove-img-btn {
  opacity: 1;
}

/* Color Manager */
.color-row-card {
  background: #fff;
  border: 2px solid #ededf0;
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.color-swatch-large {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.color-info {
  flex: 1;
}

.color-name-input {
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 900;
  width: 100%;
  padding: 0;
  margin-bottom: 2px;
}

.color-price-tag {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 800;
}

/* Variant Manager */
.variant-card {
  background: #fff;
  border: 2px solid #ededf0;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.variant-card .field {
  margin: 0;
}

/* Dashboard Actions */
.dash-footer {
  position: sticky;
  bottom: 0;
  padding: 24px 32px;
  border-top: 2px solid #ededf0;
  background: var(--paper);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

@media (max-width: 860px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dash-left {
    border-right: none;
    border-bottom: 2px solid #ededf0;
  }

  .studio-modal-panel {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* Slide Editor Styling (Unified) */
.slide-card {
  background: #fff;
  border: 2px solid #ededf0;
  border-radius: 28px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.slide-upload-section {
  display: flex;
  justify-content: center;
  margin: 14px 0;
}

.slide-img-preview-container {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16/9;
  background: #f3f3f3;
  border: 2px dashed #d1d1d6;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transition: all 200ms ease;
}

.preview-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.preview-empty:hover {
  background: #f0f0f2;
  border-color: var(--ink);
  color: var(--ink);
}

.preview-active {
  width: 100%;
  height: 100%;
  position: relative;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 200ms ease;
}

.preview-active:hover .preview-overlay {
  opacity: 1;
}

/* ===== iPad Checkout Panel ===== */
#checkoutPanelIpad {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 95;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}
#checkoutPanelIpad.open { display: flex; }
#checkoutPanelIpad .ipad-checkout-panel {
  width: 92vw;
  max-width: 1280px;
  height: 88vh;
  max-height: 920px;
  display: flex;
  flex-direction: column;
  border: 3px solid #000;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: none;
  overflow: hidden;
}
#checkoutPanelIpad .ipad-checkout-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--paper);
  z-index: 10;
}
#checkoutPanelIpad .ipad-checkout-head h2 { margin: 0; font-size: 1.35rem; font-weight: 950; }
#checkoutPanelIpad .ipad-checkout-head-inner { display: flex; align-items: center; gap: 16px; }
#checkoutPanelIpad .checkout-badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); background: var(--soft);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
#checkoutPanelIpad .ipad-checkout-body {
  flex: 1; display: grid;
  grid-template-columns: 1.7fr 0.9fr;
  column-gap: 24px;
  overflow: hidden; min-height: 0;
}
#checkoutPanelIpad .ipad-checkout-col-left {
  overflow-y: auto; padding: 28px 32px 120px;
  background: var(--paper); scrollbar-width: thin;
}
#checkoutPanelIpad .ipad-checkout-col-right {
  overflow-y: auto; padding: 44px 28px 28px 24px;
  background: var(--paper); border-left: 1px solid #ededf0; scrollbar-width: thin;
}
#checkoutPanelIpad .ipad-checkout-col-right h3 { margin: 0 0 20px; font-size: 1.05rem; font-weight: 900; color: var(--ink); }
#checkoutPanelIpad .ipad-checkout-foot {
  flex: 0 0 auto;
  padding: 14px 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--paper);
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
}
#checkoutPanelIpad .ipad-checkout-foot-row { display: flex; align-items: center; justify-content: flex-end; gap: 24px; width: 100%; }
#checkoutPanelIpad .ipad-foot-pricing { display: flex; align-items: center; gap: 12px; margin-right: auto; }
#checkoutPanelIpad .ipad-foot-total-label {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
#checkoutPanelIpad .ipad-foot-total-price {
  font-weight: 950;
  font-size: 1.15rem;
  color: var(--ink);
}
#checkoutPanelIpad .ipad-foot-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#checkoutPanelIpad .ipad-foot-actions .primary-cta { width: auto; min-width: 240px; height: 48px; font-size: 1rem; border-radius: 20px; }
#checkoutPanelIpad .ipad-foot-actions .minimal-btn { width: auto; height: 40px; font-size: 0.85rem; padding: 0 10px; white-space: nowrap; }
#checkoutPanelIpad .ipad-order-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
#checkoutPanelIpad .ipad-order-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f0f0f2; align-items: center;
}
#checkoutPanelIpad .ipad-order-item:last-child { border-bottom: none; }
#checkoutPanelIpad .ipad-order-item img {
  width: 52px; height: 52px; object-fit: contain;
  border: 1.5px solid #ededf0; border-radius: 10px; background: var(--soft);
}
#checkoutPanelIpad .ipad-order-item-info { min-width: 0; }
#checkoutPanelIpad .ipad-order-item-name { font-size: 0.85rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
#checkoutPanelIpad .ipad-order-item-qty { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
#checkoutPanelIpad .ipad-order-item-price { font-size: 0.88rem; font-weight: 850; color: var(--ink); white-space: nowrap; }
#checkoutPanelIpad .ipad-summary-pricing { padding-top: 16px; border-top: 1px solid #ededf0; display: flex; flex-direction: column; gap: 10px; }
#checkoutPanelIpad .ipad-summary-pricing .line-between { font-size: 0.88rem; }
#checkoutPanelIpad .ipad-summary-pricing .summary-total { font-weight: 950; font-size: 1.1rem; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,0.08); }
#checkoutPanelIpad .ipad-summary-pricing .price { font-weight: 850; }
#checkoutPanelIpad .ipad-payment-step { display: none; }
#checkoutPanelIpad .ipad-payment-step.active { display: block; }
#checkoutPanelIpad .ipad-shipping-row { display: none; }
#checkoutPanelIpad .ipad-shipping-row.show { display: flex; }
#checkoutPanelIpad .ipad-foot-actions-payment { display: none; }
#checkoutPanelIpad .ipad-foot-actions-payment.active { display: flex; gap: 12px; align-items: center; }
#checkoutPanelIpad .ipad-foot-actions-shipping { display: flex; }
#checkoutPanelIpad .ipad-foot-actions-shipping.hidden { display: none; }
#checkoutPanelIpad .account-box { margin-bottom: 24px; }
#checkoutPanelIpad .form-grid { grid-template-columns: 1fr 1fr; }
#checkoutPanelIpad .form-grid .full { grid-column: 1 / -1; }
#checkoutPanelIpad .shipping-methods-wrapper { grid-column: 1 / -1; }
@media (max-width: 820px) {
  #checkoutPanelIpad .ipad-checkout-body { grid-template-columns: 1fr; }
  #checkoutPanelIpad .ipad-checkout-col-right { border-left: none; border-top: 1px solid #ededf0; padding: 20px 32px; }
  #checkoutPanelIpad .ipad-checkout-foot-row { flex-direction: column; gap: 12px; }
  #checkoutPanelIpad .ipad-foot-pricing { width: 100%; justify-content: space-between; }
  #checkoutPanelIpad .ipad-foot-actions .primary-cta { min-width: 160px; }
}
@media (max-width: 768px) and (orientation: portrait) {
  #checkoutPanelIpad .ipad-checkout-body { grid-template-columns: 1fr; }
  #checkoutPanelIpad .ipad-checkout-col-right { border-left: none; border-top: 1px solid #ededf0; padding: 20px 24px; }
}

/* Payment modals must render ABOVE the iPad checkout panel (z-index 95) */
#checkoutPanelIpad.open ~ #promptPayModal.open,
#checkoutPanelIpad.open ~ #bankTransferModal.open {
  z-index: 100 !important;
}

/* ===== Shipping Details & Payment modals — Medium rounded border style ===== */

/* Modal panels — medium rounded corners (16px), 3px solid black border, no heavy shadows */
#checkoutModal .checkout-panel,
#promptPayModal .promptpay-panel,
#bankTransferModal .promptpay-panel {
  border-radius: 16px !important;
}

/* iPad checkout panel */
#checkoutPanelIpad .ipad-checkout-panel {
  border-radius: 16px !important;
}

/* ===== Phone: full-screen checkout panel, no rounded border ===== */
@media (max-width: 600px) {
  /* Backdrop: hide on phone so the panel can be edge-to-edge */
  #checkoutPanelIpad,
  #checkoutModal {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Desktop modal strip 16px rounded corners & 3px border on phone */
  #checkoutModal .checkout-panel {
    border: none !important;
    border-radius: 0 !important;
  }
  /* PromptPay / BankTransfer modals: strip rounded corners & border on phone */
  #promptPayModal .promptpay-panel,
  #bankTransferModal .promptpay-panel {
    border: none !important;
    border-radius: 0 !important;
  }
  /* iPad panel: full screen, no rounded corners, no border */
  #checkoutPanelIpad .ipad-checkout-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  /* iPad payment panels: also full screen on phone */
  #ipadPromptPayPanel,
  #ipadBankTransferPanel,
  #ipadPaymentReview {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  #ipadPromptPayPanel .ipad-payment-inner,
  #ipadBankTransferPanel .ipad-payment-inner,
  #ipadPaymentReview .ipad-payment-inner {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  /* Payment footer: vertical stacked buttons on phone (override store-nav row) */
  #checkoutModal #footerPayment.checkout-actions {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  #footerPayment .primary-cta,
  #footerPayment .ghost-btn {
    width: 100% !important;
    min-height: 48px !important;
    height: 48px !important;
    border: 2px solid #000 !important;
    border-radius: 14px !important;
  }
}

/* Remove shadows from checkout/payment panels */
#checkoutModal .checkout-panel,
#checkoutPanelIpad .ipad-checkout-panel,
#promptPayModal .promptpay-panel,
#bankTransferModal .promptpay-panel {
  box-shadow: none !important;
}