:root {
  --pink: #d98a9e;
  --pink-dark: #b5647a;
  --cream: #fdf6f0;
  --text: #3a2e2e;
  --border: #e7d9d3;
  --section-border-frame: linear-gradient(135deg, #38bdf8 0%, #2563eb 32%, #8b5cf6 66%, #ec4899 100%);
  --section-surface: #ffffff;
  --section-radius: 12px;
  --site-banner: none;
  --site-left-pane: none;
  --site-right-pane: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

#try-on-auth-content[hidden],
#try-on-guest-state[hidden] {
  display: none !important;
}

/* Auth content stays closed until the server confirms a logged-in user. */
#try-on-section[data-auth="guest"] #try-on-auth-content {
  display: none !important;
}

#try-on-section[data-auth="authenticated"] #try-on-auth-content {
  display: grid !important;
}

#try-on-section[data-auth="authenticated"] #try-on-guest-state {
  display: none !important;
}

.photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.photo-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.photo-icon-button {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--pink-dark);
  border-radius: 50%;
  background: #fff;
  color: var(--pink-dark);
  font: inherit;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.photo-icon-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  text-align: center;
}

.photo-icon-button:hover,
.photo-icon-button:focus-visible {
  background: #fff1f5;
  transform: translateY(-1px);
}

.photo-icon-button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.96rem;
  line-height: 1.45;
  background:
    linear-gradient(135deg, rgba(253, 246, 240, 0.94), rgba(255, 237, 242, 0.88)),
    radial-gradient(circle at 12% 18%, rgba(217, 138, 158, 0.22), transparent 30%),
    var(--cream);
  color: var(--text);
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  background: var(--cream);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  color: var(--pink-dark);
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 1px;
  animation: loader-rise 0.7s ease both;
}

.loader-logo-img {
  width: min(320px, 80vw);
  height: auto;
  animation: loader-rise 0.7s ease both;
}

.loader-tagline {
  margin: 8px 0 24px;
  color: #7a6b6b;
  font-size: 1rem;
  animation: loader-rise 0.7s 0.12s ease both;
}

.loader-line {
  width: min(180px, 50vw);
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--border);
}

.loader-line span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--pink-dark);
  animation: loader-progress 1.1s ease-in-out infinite;
}

@keyframes loader-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loader-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(250%); }
}

.header {
  position: relative;
  text-align: center;
  min-height: 118px;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image: linear-gradient(90deg, rgba(253, 246, 240, 0.86), rgba(255, 241, 245, 0.72)), var(--site-banner);
  background-position: center;
  background-size: cover;
}

.header-logo-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.25s ease;
  margin-bottom: 6px;
}

.header-logo-link:hover {
  transform: scale(1.02);
}

.header-logo-img {
  width: min(220px, 52vw);
  height: auto;
  max-height: 110px;
  display: block;
  margin: 0 auto;
}

.subtitle {
  margin: 4px 0 0;
  color: #7a6b6b;
  font-size: 0.98rem;
  letter-spacing: 0.5px;
}
  color: #7a6b6b;
}

.subtitle strong em {
  font-style: italic;
  font-weight: 700;
}

.auth-bar {
  position: absolute;
  top: 14px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 0;
  font-size: 0.9rem;
}

.auth-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-action {
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--pink-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.cart-btn {
  background: linear-gradient(var(--pink-dark), var(--pink-dark)) padding-box, var(--section-border-frame) border-box;
  color: white;
  border: 2px solid transparent;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.1rem;
}

.cart-btn span {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--pink-dark);
  font-size: 0.68rem;
  font-weight: 800;
}

.cart-btn:hover {
  background: linear-gradient(#a8124b, #a8124b) padding-box, var(--section-border-frame) border-box;
}

.shop-config-btn {
  position: fixed;
  left: 8px;
  bottom: 22px;
  z-index: 1200;
  background: linear-gradient(#6f42c1, #6f42c1) padding-box, var(--section-border-frame) border-box;
  color: white;
  border: 2px solid transparent;
  border-radius: 24px;
  font-weight: 600;
  padding: 11px 15px;
  box-shadow: 0 8px 22px rgba(111, 66, 193, 0.25);
}

.shop-config-btn:hover {
  background: linear-gradient(#5a32a3, #5a32a3) padding-box, var(--section-border-frame) border-box;
}

#auth-user-label {
  color: var(--pink-dark);
  font-weight: 600;
}

.guest-auth-prompt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: linear-gradient(#fff1f4, #fff1f4) padding-box, var(--section-border-frame) border-box;
  border: 1px solid transparent;
  border-radius: 18px;
  color: #9e3f5b !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(181, 100, 122, 0.12);
  animation: guest-prompt-glow 2.4s ease-in-out infinite;
}

.auth-bar > #auth-user-label { display: none; }

.auth-bar > #auth-user-label.guest-auth-prompt {
  display: inline-flex;
  position: absolute;
  top: 47px;
  right: 0;
  padding: 5px 10px;
  font-size: 0.76rem;
}

body::before,
body::after {
  position: fixed;
  top: 150px;
  bottom: 72px;
  z-index: -1;
  width: min(13vw, 170px);
  content: "";
  background-position: center;
  background-size: cover;
  border-radius: 0 24px 24px 0;
  opacity: 0.22;
  pointer-events: none;
}

body::before { left: 0; background-image: var(--site-left-pane); }
body::after { right: 0; border-radius: 24px 0 0 24px; background-image: var(--site-right-pane); }

@keyframes guest-prompt-glow {
  0%, 100% { box-shadow: 0 4px 14px rgba(181, 100, 122, 0.12); }
  50% { box-shadow: 0 5px 20px rgba(181, 100, 122, 0.28); }
}

.auth-panel {
  position: relative;
  max-width: 480px;
  margin: 0 auto 24px;
  padding: 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.auth-close-button {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pink-dark);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.auth-close-button:hover,
.auth-close-button:focus-visible {
  background: #fff1f5;
  outline: 2px solid var(--pink-dark);
  outline-offset: 1px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form h2 {
  margin: 0 0 4px;
  color: var(--pink-dark);
}

.auth-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.auth-form select,
.dress-upload-controls input[type="text"] {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.shop-details {
  display: grid;
  gap: 10px;
}

.link-button {
  padding: 4px;
  background: transparent;
  color: var(--pink-dark);
}

.social-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 12px 0 6px;
  color: #777;
  font-size: 0.85rem;
}

.social-auth-divider::before,
.social-auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e0e0e0;
}

.social-auth-divider span {
  padding: 0 8px;
}

.social-auth-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.social-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  border: 1px solid #ccc;
  background: #ffffff;
  color: #333333;
}

.google-btn:hover {
  background: #f8f9fa;
  border-color: #4285F4;
}

.facebook-btn:hover {
  background: #f0f2f5;
  border-color: #1877F2;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.dress-gallery {
  min-inline-size: 0;
  width: 100%;
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(var(--section-surface), var(--section-surface)) padding-box, var(--section-border-frame) border-box;
  border: 1px solid transparent;
  border-radius: var(--section-radius);
}

.dress-search-section {
  min-inline-size: 0;
  width: 100%;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: linear-gradient(var(--section-surface), var(--section-surface)) padding-box, var(--section-border-frame) border-box;
  border: 1px solid transparent;
  border-radius: var(--section-radius);
}

.dress-gallery > legend,
.dress-search-section > legend,
.try-on-section > legend,
.try-on-panel > legend {
  display: block;
  width: max-content;
  padding: 2px 10px 1px;
  margin: -27px 0 12px 8px;
  background: linear-gradient(var(--section-surface), var(--section-surface)) padding-box, var(--section-border-frame) border-box;
  border: 1px solid transparent;
  border-radius: var(--section-radius);
  color: var(--pink-dark);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.dress-search-section > label {
  display: block;
  margin-bottom: 8px;
  color: var(--pink-dark);
  font-weight: 700;
}

.dress-search-controls {
  display: flex;
  gap: 10px;
}

.dress-search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.dress-search-controls input {
  width: 100%;
  min-width: 0;
  padding: 10px 40px 10px 14px;
  background: linear-gradient(var(--section-surface), var(--section-surface)) padding-box, var(--section-border-frame) border-box;
  border: 1px solid transparent;
  border-radius: var(--section-radius);
  font: inherit;
}

.dress-search-controls input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.dress-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pink-dark);
  font-size: 1.3rem;
  line-height: 1;
}

.dress-search-clear:hover,
.dress-search-clear:focus-visible {
  background: #fff1f5;
}

.dress-search-section .dress-gallery-viewport {
  margin-top: 16px;
  padding-bottom: 0;
}

.dress-gallery,
.dress-search-section {
  position: relative;
}

.gallery-heading {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  z-index: 2;
}

#dress-gallery .gallery-heading {
  justify-content: flex-end;
}

#dress-gallery .gallery-controls {
  order: 0;
}

.gallery-heading h2 {
  margin: 0;
  color: var(--pink-dark);
}

.gallery-heading .hint {
  margin-bottom: 0;
}

.gallery-controls {
  display: flex;
  gap: 8px;
}

.gallery-arrow {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
}

.search-load-more {
  display: block;
  margin: 14px auto 0;
  padding: 8px 22px;
  background: linear-gradient(var(--section-surface), var(--section-surface)) padding-box, var(--section-border-frame) border-box;
  border: 1px solid transparent;
  border-radius: var(--section-radius);
  color: var(--pink-dark);
  font-weight: 700;
}

.search-load-more:hover,
.search-load-more:focus-visible {
  background: linear-gradient(#fff1f5, #fff1f5) padding-box, var(--section-border-frame) border-box;
}

.dress-gallery-viewport {
  width: 100%;
  min-width: 0;
  padding-bottom: 52px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--pink) var(--border);
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.dress-gallery-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: max-content;
  min-height: 240px;
}

.dress-card {
  flex: 0 0 clamp(160px, calc((min(960px, 100vw - 32px) - 132px) / 4), 220px);
  scroll-snap-align: start;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}

.dress-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.dress-card.selected {
  outline: 3px solid var(--pink);
}

.dress-card img {
  display: block;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  box-sizing: border-box;
  object-fit: cover;
  object-position: center;
  background: #f0e6e0;
}

.dress-card .dress-info {
  padding: 10px 12px 16px;
}

.dress-card .dress-info { display: none; }

.dress-card .dress-info h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--pink-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dress-card .dress-info p {
  margin: 0;
  font-size: 0.85rem;
  color: #7a6b6b;
}

#search-results-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  min-height: 0;
  gap: 8px;
}

#search-results-track .search-dress-card {
  min-width: 0;
  width: 100%;
  border-radius: 8px;
}

#search-results-track .search-dress-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  background: #f0e6e0;
}

#search-results-track .search-dress-card .dress-info {
  padding: 7px 8px 10px;
}

#search-results-track .search-dress-card .dress-info h3,
#search-results-track .search-dress-card .dress-info p {
  font-size: 0.76rem;
}

.upload-section,
.result-section,
.dress-upload-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.upload-section h2,
.result-section h2,
.dress-upload-section h2 {
  margin: 0 0 8px;
  color: var(--pink-dark);
}

.upload-section > p,
.result-section > p,
.dress-upload-section > p {
  margin: 4px 0;
}

.dress-upload-section h3 {
  margin: 18px 0 8px;
  color: var(--pink-dark);
  font-size: 1rem;
}

main.admin-layout {
  display: flex;
  flex-direction: column;
}

main:not(.admin-layout) {
  display: flex;
  flex-direction: column;
}

main:not(.admin-layout) > section {
  order: 10;
}

main:not(.admin-layout) #auth-panel { order: 0; }
main:not(.admin-layout) #dress-gallery { order: 1; }
main:not(.admin-layout) #try-on-section { order: 2; }
main:not(.admin-layout) #dress-search-section { order: 3; }

main.admin-layout #admin-payments-section { order: 1; }
main.admin-layout #admin-shops-section { order: 2; }
main.admin-layout #admin-product-section { order: 3; }
main.admin-layout #dress-gallery { order: 4; }
main.admin-layout #dress-search-section { order: 5; }
main.admin-layout #try-on-section { order: 6; }
main.admin-layout .result-section { order: 7; }

.admin-pricing-settings {
  margin-top: 18px;
  padding-bottom: 0; /* This line is unchanged */
}

.search-load-more {
  display: block;
  margin: 14px auto 0;
  padding: 8px 22px;
  background: linear-gradient(var(--section-surface), var(--section-surface)) padding-box, var(--section-border-frame) border-box;
  border: 1px solid transparent;
  border-radius: var(--section-radius);
  color: var(--pink-dark);
  font-weight: 700;
}

.search-load-more:hover,
.search-load-more:focus-visible {
  background: linear-gradient(#fff1f5, #fff1f5) padding-box, var(--section-border-frame) border-box;
}

.pricing-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.pricing-settings-grid label {
  display: grid;
  gap: 5px;
  color: var(--pink-dark);
  font-size: 0.84rem;
  font-weight: 600;
}

.pricing-settings-grid input,
#payment-search-input,
#shop-search-input {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.try-on-section {
  min-inline-size: 0;
  width: 100%;
  position: relative;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: linear-gradient(var(--section-surface), var(--section-surface)) padding-box, var(--section-border-frame) border-box;
  border: 1px solid transparent;
  border-radius: var(--section-radius);
}

.try-on-section > .try-on-guest-state,
.try-on-section > .try-on-auth-content {
  margin-top: 6px;
}
.try-on-caption {
  padding: 0 8px 12px;
  color: #8a7b7b;
  font-size: 0.84rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
}

.try-on-guidance {
  margin: 6px 8px 8px;
  color: #8a7b7b;
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: center;
}
.try-on-auth-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.try-on-panel .user-preview-wrapper,
.try-on-panel .result-image-wrapper {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #f8f2ef;
}

.try-on-panel .user-preview-wrapper.has-preview,
.try-on-panel .result-image-wrapper.has-preview {
  height: auto;
  min-height: 0;
}

.try-on-panel .user-preview-wrapper:not(.has-preview),
.try-on-panel .result-image-wrapper:not(.has-preview) {
  aspect-ratio: auto;
  height: 0;
  min-height: 0;
  background: transparent;
}

.try-on-panel .preview-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}
.try-on-panel {
  min-inline-size: 0;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(var(--section-surface), var(--section-surface)) padding-box, var(--section-border-frame) border-box;
}

.try-on-panel > legend {
  margin-inline-start: auto;
}
.try-on-panel h3 {
  margin: 0 0 8px;
  color: var(--pink-dark);
}
.try-on-processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 12px;
  pointer-events: all;
}

.dress-upload-section {
  position: relative;
}

.dress-upload-processing-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  min-height: 180px;
  background: rgba(255, 250, 248, 0.92);
}

#payment-search-input {
  margin-bottom: 12px;
}

#save-pricing-button {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .try-on-auth-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .try-on-panel .user-preview-wrapper,
  .try-on-panel .result-image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4;
    min-height: 0;
  }

  .try-on-panel .user-preview-wrapper.has-preview,
  .try-on-panel .result-image-wrapper.has-preview {
    height: min(72vh, 620px);
    min-height: 380px;
  }

  .try-on-panel .user-preview-wrapper:not(.has-preview),
  .try-on-panel .result-image-wrapper:not(.has-preview) {
    height: 0;
    min-height: 0;
  }

  .pricing-settings-grid { grid-template-columns: repeat(2, 1fr); }
}

.pending-products-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.pending-products-heading h3 {
  margin: 0;
}

.result-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.result-section {
  position: relative;
  min-height: 0;
}

.try-on-processing-overlay {
  position: absolute;
  border-radius: 12px;
}

.processing-dots {
  display: inline-flex;
  width: 1.25em;
  margin-left: 2px;
  overflow: hidden;
  vertical-align: bottom;
}

.processing-dots i {
  font-style: normal;
  opacity: 0;
  animation: processing-dot 1.2s infinite;
}

.processing-dots i:nth-child(2) { animation-delay: 0.2s; }
.processing-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes processing-dot {
  0%, 20% { opacity: 0; }
  40%, 80% { opacity: 1; }
  100% { opacity: 0; }
}

.result-action-bar {
  margin-top: 8px;
  animation: fadeInMenu 0.3s ease-out;
}

.result-cart-btn {
  background: var(--pink-dark);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(216, 27, 96, 0.3);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.result-cart-btn:hover {
  background: #a8124b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(216, 27, 96, 0.4);
}
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--pink-dark);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.hint {
  margin: 4px 0;
  font-size: 0.85rem;
  color: #7a6b6b;
}

.image-guidance {
  margin: 6px 0 0;
  line-height: 1.45;
}

.status-text {
  margin: 6px 0;
  font-size: 0.9rem;
  color: #7a6b6b;
}

.user-preview-wrapper,
.result-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

.preview-image {
  max-width: 100%;
  max-height: 480px;
  border-radius: 10px;
  display: block;
  margin: 10px auto 0;
  object-fit: contain;
}

#result-image {
  /* Chặn menu "Lưu ảnh/Sao chép ảnh" mặc định của trình duyệt/thiết bị khi giữ
     hoặc chuột phải, để menu chia sẻ tự vẽ của VTRYON hiện ra ngay lần đầu. */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  cursor: pointer;
}

.result-share-hint {
  /* Tooltip tự vẽ duy nhất (không dùng title mặc định của trình duyệt vì thời
     điểm/vị trí hiện không kiểm soát được) - bám theo con trỏ/ngón tay và luôn
     hiện phía DƯỚI, toạ độ do JS cập nhật theo mousemove/touchstart. */
  position: fixed;
  left: 0;
  top: 0;
  background: #ffffff;
  color: #333333;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  white-space: nowrap;
  z-index: 1200;
  transform: translate(-50%, 14px);
}

.result-share-hint.is-visible {
  opacity: 1;
}

input[type="file"] {
  margin-top: 6px;
}

.dress-upload-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.owned-dresses {
  margin-top: 18px;
}

.owned-dresses h3 {
  margin: 0 0 8px;
  color: var(--pink-dark);
  font-size: 1rem;
}

.owned-dress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.product-management-grid,
.admin-shops-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.managed-product-card,
.admin-shop-card {
  overflow: hidden;
  background: #fffaf7;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.managed-product-image {
  display: block;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 180px;
  box-sizing: border-box;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
}

.managed-product-info {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px;
  font-size: 0.85rem;
}

.managed-product-info span {
  color: #7a6b6b;
}

.managed-product-info strong,
.managed-product-info span,
.managed-product-field {
  display: block;
  width: 100%;
}

.product-link {
  padding: 0;
  background: transparent;
  color: var(--pink-dark);
  text-align: left;
  text-decoration: underline;
}

.product-action {
  padding: 6px 8px;
  font-size: 0.8rem;
}

.product-select {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--pink-dark);
  font-weight: 600;
}

.shop-submit-button {
  margin-top: 16px;
}

.dashboard-heading,
.dashboard-metrics,
.dashboard-rankings {
  display: grid;
  gap: 14px;
}

.dashboard-heading {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.dashboard-heading h2,
.dashboard-chart-panel h3,
.dashboard-rankings h3 {
  margin-top: 0;
}

.dashboard-periods {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-period {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--pink-dark);
  cursor: pointer;
}

.dashboard-period.is-active {
  background: var(--pink-dark);
  color: #fff;
}

.dashboard-metrics {
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0;
}

.dashboard-metric {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffaf7;
}

.dashboard-metric span,
.sales-ranking-item small {
  color: #7a6b6b;
  font-size: 0.8rem;
}

.dashboard-metric strong {
  color: var(--pink-dark);
  font-size: 1.15rem;
}

.dashboard-chart-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffaf7;
}

.sales-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 220px;
  padding: 20px 6px 0;
  border-bottom: 1px solid var(--border);
}

.sales-bar-column {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: end;
  gap: 5px;
  min-width: 0;
  height: 100%;
  flex-direction: column;
}

.sales-bar {
  width: min(32px, 80%);
  min-height: 4px;
  border-radius: 5px 5px 0 0;
  background: var(--pink-dark);
}

.sales-bar-column small,
.sales-bar-value {
  overflow: hidden;
  max-width: 100%;
  color: #7a6b6b;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-bar-value {
  color: var(--text);
}

.dashboard-rankings {
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.market-intelligence-panel {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.market-intelligence-panel h3,
.market-intelligence-panel h4 {
  margin-top: 0;
}

.market-metrics {
  grid-template-columns: repeat(4, 1fr);
}

.sales-ranking-list {
  display: grid;
  gap: 8px;
}

.sales-ranking-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.82rem;
}

.sales-ranking-position {
  color: var(--pink-dark);
  font-weight: 700;
}

.sales-ranking-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-assistant-toggle {
  position: fixed;
  right: 8px;
  bottom: 78px;
  z-index: 1100;
  padding: 11px 15px;
  background: linear-gradient(#356859, #356859) padding-box, var(--section-border-frame) border-box;
  border: 2px solid transparent;
  border-radius: 22px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(53, 104, 89, 0.28);
}

.become-shop-floating {
  position: fixed;
  left: 8px;
  right: auto;
  bottom: 16px;
  z-index: 1200;
  pointer-events: auto;
  padding: 10px 14px;
  background: linear-gradient(#6f42c1, #6f42c1) padding-box, var(--section-border-frame) border-box;
  border: 2px solid transparent;
  border-radius: 22px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(111, 66, 193, 0.25);
}

.sales-assistant {
  position: fixed;
  right: 8px;
  bottom: 134px;
  z-index: 1101;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(360px, calc(100vw - 28px));
  height: min(480px, calc(100vh - 100px));
  overflow: hidden;
  border: 1px solid #b9d7cb;
  border-radius: 14px;
  background: #f7fcf9;
  box-shadow: 0 14px 36px rgba(53, 104, 89, 0.2);
}

.sales-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: #356859;
  color: #fff;
}

.sales-assistant-header button {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.sales-assistant-header .sales-assistant-close {
  flex-basis: 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  margin: -4px -6px -4px 0;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: #fff;
  color: #24483d;
  font-size: 1.65rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sales-assistant-header .sales-assistant-close:hover,
.sales-assistant-header .sales-assistant-close:focus-visible {
  background: #e8f4ef;
  color: #17362e;
  outline: 3px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.sales-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding: 14px;
}

.sales-assistant-message {
  max-width: 88%;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.sales-assistant-message.assistant { align-self: flex-start; background: #e1f0e9; }
.sales-assistant-message.user { align-self: flex-end; background: #356859; color: #fff; }

.sales-assistant-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}

.sales-assistant-form input {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid #b9d7cb;
  border-radius: 18px;
  font: inherit;
}

.sales-assistant-form button {
  width: 38px;
  border: 0;
  border-radius: 50%;
  background: #356859;
  color: #fff;
}

@media (max-width: 640px) {
  #dress-gallery {
    padding: 8px 10px 12px;
  }

  #dress-gallery > legend {
    margin: -20px 0 4px 4px;
  }

  #dress-gallery .gallery-heading {
    display: none;
  }

  #dress-gallery .dress-gallery-viewport {
    padding-bottom: 0;
  }

  .dress-card {
    flex-basis: clamp(112px, 34vw, 148px);
  }

  #dress-gallery .dress-card {
    flex-basis: clamp(160px, 56vw, 230px);
  }

  #search-results-track .search-dress-card img {
    aspect-ratio: 4 / 5;
  }

  .preview-image {
    width: auto;
    max-width: calc(100% - 16px);
    max-height: min(360px, 55vh);
  }

  .managed-product-image {
    height: 140px;
  }

  .dashboard-heading,
  .dashboard-metrics,
  .dashboard-rankings {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    gap: 8px;
  }

  .sales-chart {
    gap: 3px;
    height: 190px;
  }

  .sales-bar-value {
    font-size: 0.58rem;
  }

  #search-results-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #search-results-track .search-dress-card img {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .sales-assistant-toggle,
  .sales-assistant,
  .become-shop-floating,
  .support-chat-toggle,
  .support-chat {
    right: 8px;
  }

  .auth-bar > #auth-user-label.guest-auth-prompt { top: 47px; }
  .become-shop-floating { left: 12px; right: auto; bottom: 16px; }
}

.payment-date-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.payment-date-fields label {
  display: grid;
  gap: 6px;
  color: var(--pink-dark);
  font-weight: 600;
}

.date-picker-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-picker-control > input[type="text"] {
  width: 125px;
}

.calendar-button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1rem;
}

.native-date-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.payment-date-fields input {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.admin-payment-info {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--border);
  background: #fffaf7;
}

.admin-payment-info p {
  margin: 4px 0;
}

.publication-payment-section {
  position: relative;
}

.payment-processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(253, 246, 240, 0.94);
  color: var(--pink-dark);
  text-align: center;
}

.payment-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--border);
  border-top-color: var(--pink-dark);
  border-radius: 50%;
  animation: payment-spin 0.8s linear infinite;
}

@keyframes payment-spin {
  to { transform: rotate(360deg); }
}

.payment-status {
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.5;
}

.processing-status {
  color: #8a5b00;
  background: #fff3cd;
  border: 1px solid #e7c76a;
}

.rejected-status {
  color: #9c2525;
  background: #fde2e2;
  border: 1px solid #e3a2a2;
}

.success-status {
  color: #1d6b3b;
  background: #def5e5;
  border: 1px solid #9bd1ae;
}

.admin-payments-list {
  overflow-x: auto;
}

.admin-payments-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-payments-table th,
.admin-payments-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-payments-table th {
  color: var(--pink-dark);
  background: #fffaf7;
  white-space: nowrap;
}

.admin-payments-table input.received-amount {
  width: 110px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.admin-payments-table button {
  margin: 2px;
  padding: 6px 8px;
  font-size: 0.78rem;
}

.payment-qr {
  width: 160px;
  max-width: 100%;
  margin-top: 10px;
}

.product-action + .product-action {
  margin-top: 2px;
}

.product-unpublish {
  background: #8b5d4b;
}

#shop-search-input {
  width: 100%;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.admin-shop-card {
  padding: 14px;
}

.admin-shop-card h3 {
  margin: 0 0 6px;
}

.admin-shop-card p {
  margin: 4px 0;
  font-size: 0.85rem;
  color: #7a6b6b;
}

.admin-product-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-product-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.8rem;
}

.admin-product-row img {
  width: 64px;
  height: 78px;
  object-fit: cover;
  border-radius: 4px;
}

.admin-product-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.admin-product-details strong,
.admin-product-details span {
  display: block;
  width: 100%;
}

.admin-product-details label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-priority {
  width: 70px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.admin-product-row button {
  grid-column: 2;
  justify-self: start;
  padding: 6px 8px;
  font-size: 0.8rem;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(58, 46, 46, 0.45);
}

.product-modal-content {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  background: var(--cream);
  border-radius: 10px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
}

.product-modal-image {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  margin-bottom: 14px;
  background: #f0e6e0;
}

/* Custom Context Menu Floating UI */
.custom-context-menu {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  padding: 6px 0;
  overflow: hidden;
  animation: fadeInMenu 0.15s ease-out;
}

@keyframes fadeInMenu {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: #333333;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  border-radius: 0;
}

.context-menu-item:hover {
  background: #fce4ec;
  color: var(--pink-dark);
}

.product-details-popover {
  position: fixed;
  z-index: 1001;
  width: min(320px, calc(100vw - 24px));
  max-height: min(440px, calc(100vh - 24px));
  overflow-y: auto;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  color: var(--text);
  animation: fadeInMenu 0.15s ease-out;
}

.product-details-popover h2 {
  margin: 0 28px 14px 0;
  color: var(--pink-dark);
  font-size: 1.05rem;
  line-height: 1.3;
}

.product-details-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7a6b6b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.product-details-shop,
.product-details-phone,
.product-details-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  margin-top: 9px;
  font-size: 0.86rem;
  line-height: 1.4;
}

.product-details-shop span,
.product-details-row span,
.product-details-phone a {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #5f5151;
  text-decoration: none;
}

.product-details-phone a {
  color: var(--pink-dark);
  text-decoration: underline;
}

.support-chat-toggle {
  position: fixed;
  right: 8px;
  bottom: 22px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 15px;
  background: linear-gradient(var(--pink-dark), var(--pink-dark)) padding-box, var(--section-border-frame) border-box;
  border: 2px solid transparent;
  border-radius: 24px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(181, 100, 122, 0.3);
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px calc(76px + env(safe-area-inset-bottom));
  background: #3d2940;
  color: #fbeaf0;
  font-size: 0.78rem;
}

.trademark-symbol {
  display: inline-block;
  margin-left: 0.04em;
  font-size: 0.58em;
  line-height: 0;
  vertical-align: super;
}

.visual-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.visual-settings-grid label {
  display: grid;
  gap: 6px;
  color: var(--pink-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .try-on-auth-content {
    grid-template-columns: 1fr;
  }

  .try-on-section {
    padding: 20px 14px 14px;
  }

  .header {
    min-height: 0;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .auth-bar {
    position: static;
    width: 100%;
    margin-top: 10px;
    align-items: center;
  }

  .auth-actions {
    width: 100%;
    gap: 2px;
    justify-content: center;
  }

  .header-action {
    flex: 0 1 auto;
    white-space: nowrap;
    font-size: 0.72rem;
    padding: 5px;
  }

  .auth-bar > #auth-user-label.guest-auth-prompt {
    position: static;
    margin-top: 6px;
    max-width: 100%;
    text-align: right;
  }

  .visual-settings-grid { grid-template-columns: 1fr; }
}

.support-chat-toggle span:first-child {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

.support-chat {
  position: fixed;
  right: 8px;
  bottom: 82px;
  z-index: 1101;
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto auto;
  width: min(360px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 110px));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(58, 46, 46, 0.22);
}

.support-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--pink-dark);
  color: #fff;
}

.support-chat-header div {
  display: grid;
  gap: 3px;
}

.support-chat-header span {
  font-size: 0.76rem;
  opacity: 0.88;
}

.support-chat-close {
  padding: 2px 7px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
}

.support-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
  background: #fffaf7;
}

.support-chat-message {
  max-width: 88%;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  #try-on-section .try-on-auth-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
  }

  #try-on-section .try-on-panel {
    width: 100% !important;
  }

  #try-on-section .user-preview-wrapper.has-preview,
  #try-on-section .result-image-wrapper.has-preview {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 3 / 4;
  }

  #try-on-section .user-preview-wrapper:not(.has-preview),
  #try-on-section .result-image-wrapper:not(.has-preview) {
    height: 0 !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    background: transparent !important;
  }

  #try-on-section .preview-image {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
}

.support-chat-message.assistant {
  align-self: flex-start;
  background: #f5e8e4;
  color: var(--text);
}

.support-chat-message.user {
  align-self: flex-end;
  background: var(--pink-dark);
  color: #fff;
}

.support-chat-suggestions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 0;
  background: #fffaf7;
}

.support-chat-suggestion {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--pink-dark);
  font-size: 0.75rem;
  cursor: pointer;
}

.support-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fffaf7;
}

.support-chat-form input {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  font: inherit;
}

.support-chat-form button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: var(--pink-dark);
  color: #fff;
}

/* Shop Bank & QR Code Input Container */
.shop-bank-details {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 12px;
  background: #fff8f5;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Cart Review Modal Styling */
.cart-modal-content,
.checkout-modal-content {
  width: min(820px, 98%);
  max-height: 92vh;
}

.cart-items-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  margin: 16px 0;
  padding-right: 4px;
}

.cart-shop-warning {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #e7b1bd;
  border-left: 4px solid var(--pink-dark);
  border-radius: 6px;
  background: #fff1f4;
  color: #8f304d;
  font-weight: 700;
}

.cart-shop-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffaf7;
}

.cart-shop-products h3 {
  margin: 0 0 10px;
  color: var(--pink-dark);
  font-size: 1rem;
}

.cart-item-card {
  display: grid;
  grid-template-columns: 32px 80px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cart-shop-products .cart-item-card {
  padding: 10px;
  background: #fff;
}

.cart-item-img {
  width: 80px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}

.cart-item-title {
  color: var(--pink-dark);
  font-weight: 700;
  font-size: 1rem;
}

.cart-item-shop {
  color: #555555;
  font-size: 0.85rem;
}

.cart-item-policy {
  font-size: 0.82rem;
  color: #777777;
}

.non-online-note {
  font-style: italic;
  color: #d32f2f;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 4px;
  display: block;
  background: #ffebee;
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 3px solid #d32f2f;
}

.cart-item-qty-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-qty-control button {
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
  font-weight: 700;
}

.cart-qty-control span {
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item-subtotal {
  font-weight: 700;
  color: var(--pink-dark);
  font-size: 0.95rem;
}

.cart-item-remove {
  background: transparent;
  color: #d32f2f;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.cart-shop-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid var(--border);
  color: var(--pink-dark);
  text-align: right;
  font-weight: 700;
}

.cart-payment-info {
  align-self: stretch;
  padding: 12px;
  border: 1px dashed var(--pink);
  border-radius: 8px;
  background: #fff;
  font-size: 0.82rem;
}

.cart-payment-info h4 {
  margin: 0 0 8px;
  color: var(--pink-dark);
  font-size: 0.95rem;
}

.cart-payment-info p {
  margin: 5px 0;
  overflow-wrap: anywhere;
}

.cart-payment-qr {
  display: block;
  width: min(150px, 100%);
  margin: 10px auto 0;
  border-radius: 6px;
}

.cart-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
  flex-wrap: wrap;
}

.cart-total-text {
  width: 100%;
  font-size: 1rem;
  color: #333333;
  text-align: right;
}

.cart-total-text strong {
  font-size: 1.25rem;
  color: var(--pink-dark);
  margin-left: 6px;
}

/* Checkout Modal Styling */
.checkout-customer-fields {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.checkout-customer-fields h3,
.checkout-shop-block h3 {
  margin: 0 0 4px;
  color: var(--pink-dark);
  font-size: 1.05rem;
}

.checkout-shop-block {
  padding: 14px;
  background: #fff8f5;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.checkout-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px dashed var(--pink);
}

.checkout-qr-img {
  max-width: 180px;
  height: auto;
  border-radius: 6px;
  margin-top: 6px;
}

.product-form {
  display: grid;
  gap: 10px;
}

.product-form input {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--pink-dark);
  color: white;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.email-template-editor {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px;
  background: #fffaf7;
  border: 1px solid var(--border);
  border-radius: 8px;
}

@media (max-width: 640px) {
  .cart-shop-section {
    grid-template-columns: 1fr;
  }

  .cart-item-card {
    grid-template-columns: 26px 64px minmax(0, 1fr);
    gap: 8px;
  }

  .cart-item-qty-price {
    grid-column: 2 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }
}

.email-template-editor label {
  display: grid;
  gap: 5px;
  color: var(--pink-dark);
  font-size: 0.84rem;
  font-weight: 600;
}

.email-template-editor textarea {
  font: inherit;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}
