:root {
  --brand: #ea580c;
  --brand-hover: #c2410c;
  --brand-light: #fff7ed;
}

.navbar-h57 {
  height: 57px;
}

.font-06rem {
  font-size: 0.6rem;
}

.font-095rem {
  font-size: 0.95rem;
}

.text-brand {
  color: #ea580c;
}

.user-photo-square {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
}

.user-thumb-small {
  width: 60px;
  height: 60px;
  border-radius: 12px;
}

.preview-actions-bg {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.modal-body-preview {
  min-height: 340px;
}

.loader-overlay {
  background: rgba(255, 255, 255, 0.85);
}

.spinner-custom {
  width: 1.8rem;
  height: 1.8rem;
  border-width: 2.5px;
}

.offcanvas-h72 {
  max-height: 72vh;
}

.offcanvas-h60 {
  max-height: 60vh;
}

.offcanvas-h75 {
  max-height: 75vh;
}

.camera-video {
  max-height: 300px;
  object-fit: cover;
}

.camera-preview-img {
  max-height: 280px;
  object-fit: contain;
}

.icon-22rem {
  font-size: 2.2rem;
}

.view-all-min-h {
  min-height: calc(100vh - 110px);
}

.chip-filter-btn {
  min-width: 42px;
  height: 38px;
  border-radius: 8px;
}

.chip-dropdown-btn {
  height: 38px;
  border-radius: 8px;
}

.no-items-icon {
  font-size: 1.8rem;
  opacity: 0.28;
}

@media (min-width: 768px) {
  .border-start-md {
    border-left: 1px solid #e5e7eb !important;
  }
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}

.preview-icon-placeholder {
  font-size: 2.8rem;
  opacity: 0.25;
}

.mobile-preview-icon {
  font-size: 2.6rem;
  opacity: 0.3;
}

:root {
  --scale: 1;
  --mobile-scale: 1;
}

/* Mobile Preview Modal Custom Styles */
.mobile-preview-dialog {
  max-width: 90%;
  margin: 1.75rem auto;
}

.mobile-preview-content {
  border-radius: 28px !important;
  overflow: visible !important;
  border: none !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
}

.mobile-preview-close {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  background: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1061;
  color: #000;
  cursor: pointer;
  transition: transform 0.2s;
}

.mobile-preview-close:active {
  transform: translateX(-50%) scale(0.9);
}

.modal-body-preview {
  min-height: 400px;
  max-height: 75vh;
  padding: 1rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}


.product-grid-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1/1.2;
  border: 1px solid #e5e7eb;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
}

.product-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--brand);
}

.product-grid-img {
  object-fit: contain;
  border-radius: 8px;
  width: 100%;
  height: 100%;
}

body {
  font-family: "DM Sans", sans-serif;
  background-color: #f8f9fa;
}

/* On desktop, prevent the main window from scrolling so columns can scroll independently */
@media (min-width: 768px) {
  body {
    height: 100vh;
    overflow: hidden;
  }
}

/* Brand */
.brand-name {
  font-family: "Playfair Display", serif;
  font-weight: 600;
  color: var(--brand);
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
  flex-shrink: 0;
}

.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(180, 83, 9, 0.2);
}

.sidebar-scroll {
  height: calc(100vh - 57px);
  overflow-y: auto;
}

.garment-card {
  aspect-ratio: 3/4;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.garment-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.garment-card.selected {
  border-color: var(--brand);
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.15);
}

.garment-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.18s;
}

.garment-card:hover img {
  transform: scale(1.04);
}

/* Preview area */
.preview-area {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: auto; /* Use auto for both X and Y when zooming */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

#previewImg,
#mobilePreviewImg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  margin: auto;
  transform: scale(var(--scale, 1));
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
  object-fit: contain;
}

.preview-img-contain {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Scrollable garment grid area (desktop) */
.garment-scroll {
  height: calc(100vh - 57px);
  overflow-y: auto;
}

/* Preview panel (desktop) */
.preview-scroll {
  height: calc(100vh - 57px);
  overflow: hidden; /* Prevent the outer panel from scrolling */
  display: flex;
  flex-direction: column;
}

/* Make the preview area fill available space within the flex column */
.preview-scroll .preview-area {
  flex: 1 1 0; /* Force basis to 0 for proper flex behavior */
  min-height: 0;
  overflow-y: auto !important;
}

/* Brand button */
.btn-brand {
  background: var(--brand);
  color: #fff;
  border: none;
  font-weight: 500;
  transition: background 0.18s;
}

.btn-brand:hover:not(:disabled) {
  background: var(--brand-hover);
  color: #fff;
}

.btn-brand:disabled {
  background: #9ca3af;
  color: #fff;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Magic Try-On Button Styles */
.btn-magic {
  background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
  color: #fff !important;
  border: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-magic:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(234, 88, 12, 0.35);
  filter: brightness(1.05);
}

.btn-magic:active:not(:disabled) {
  transform: translateY(0);
}

.btn-magic:disabled {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  box-shadow: none;
  cursor: not-allowed;
}

/* Specific styling for the Capture/Snap button */
#snapBtn {
  background: #ef4444; /* Vibrant Red for Capture */
  border: none;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

#snapBtn:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
}

/* Upload & Continue Button */
#uploadContinueBtn {
  background: #ea580c;
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}

/* Icon button */
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

/* User thumb */
.user-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--brand);
}

.btn-remove-thumb {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

/* Recent thumbs */
.recent-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.18s;
}

.recent-thumb:hover {
  border-color: var(--brand);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #d1d5db;
  cursor: pointer;
  border-radius: 10px;
  transition: border-color 0.18s, background 0.18s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-light);
}

/* Preview action buttons */
.prev-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 0.88rem;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}

.prev-action-btn:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.prev-action-btn:active {
  transform: scale(0.9);
}

/* Chip buttons (mobile navbar) */
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid #d1d5db;
  border-radius: 20px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s;
}

.chip-btn:hover,
.chip-btn.active {
  border-color: var(--brand);
  color: var(--brand);
}

.chip-btn.dropdown-toggle::after {
  display: none;
}

.badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

/* Offcanvas */
.offcanvas-bottom.rounded-top-4 {
  border-radius: 1rem 1rem 0 0;
}

/* Loader overlay */
.preview-loader {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--brand);
}

/* Filter label */
.filter-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #78716c;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-thumb {
  background: #d4d0cb;
  border-radius: 4px;
}

@media (max-width: 767.98px) {

  .garment-scroll {
    height: auto !important;
    overflow-y: visible !important;
    padding: 10px 10px 0 10px !important;
  }

  #garmentGrid {
    display: grid !important;
    grid-template-rows: repeat(2, 240px);
    grid-auto-flow: column;
    grid-auto-columns: 180px;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px !important;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    margin: 0 !important;
    flex-wrap: nowrap !important;
  }

  #garmentGrid::-webkit-scrollbar {
    display: none;
  }

  /* Each Bootstrap col inside the grid */
  .view-all-btn {
    color: #b45309;
    border: 1px solid #b45309;
    background: transparent;
  }

  .view-all-btn:hover {
    background: #b45309;
    color: #fff;
  }

  #viewAllLink {
    color: #b45309;
    border: 1px solid #b45309;
    background: transparent;
  }

  #viewAllLink:hover {
    background: #b45309;
    color: #fff;
  }

  /* 4. Mobile bottom bar — no longer fixed */
  .mobile-bottom-bar {
    display: none;
  }

  /* 5. Body padding removed */
  body {
    padding-bottom: 0;
  }
}

#viewAllModal .garment-card {
  border-radius: 12px;
  overflow: hidden;
}

/* Reusable Chip Button */
.chip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  transition: all 0.2s;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: #ea580c;
  color: #ea580c;
}

.dropdown-toggle::after {
  display: none;
}

.garment-card {
  transition: transform 0.2s;
}

.garment-card:active {
  transform: scale(0.96);
}

/* Multi-capture styles */
.capture-thumb-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.capture-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-thumb-wrap.selected {
  border-color: #10b981;
  /* Green border */
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.selection-tick {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #10b981;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  z-index: 2;
}

.capture-thumb-wrap.selected .selection-tick {
  display: flex;
}

.capture-thumb-wrap:hover {
  transform: scale(1.05);
}

.remove-capture-btn {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  border: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.capture-thumb-wrap:hover .remove-capture-btn {
  opacity: 1;
}

.offcanvas-filter-scroll {
  max-height: 300px;
}

.all-filter-scroll {
  max-height: 250px;
}

/* Magnifier Lens */
.magnifier-lens {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  display: none;
  z-index: 1000;
  background-repeat: no-repeat;
  background-color: #f3f4f6;
}
