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

:root {
    --orange:  #C8621A;
    --dark:    #2C2C2C;
    --grey:    #6B7280;
    --cream:   #F5F0E8;
    --white:   #FFFFFF;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -20vw; right: -15vw;
    width: 55vw; height: 55vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200,98,26,0.10) 0%, transparent 70%);
    pointer-events: none;
}

.card {
    text-align: center;
    max-width: 460px;
    width: 90vw;
    padding: 56px 48px;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 16px 56px rgba(44,44,44,0.10);
    animation: fadeUp 0.7s ease both;
}

.icon-wrap {
    width: 72px; height: 72px;
    background: rgba(200,98,26,0.10);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 28px;
}
.icon-wrap svg { color: var(--orange); }

.card h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
}
.card h1 em { color: var(--orange); font-style: italic; }

.card p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--grey);
    margin-bottom: 36px;
}

.btn-tryon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--orange);
    color: var(--white);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 15px 40px;
    border-radius: 100px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 24px rgba(200,98,26,0.32);
    position: relative;
    overflow: hidden;
}
.btn-tryon:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(200,98,26,0.45);
}

.divider {
    width: 40px; height: 2px;
    background: var(--orange);
    opacity: 0.3;
    margin: 36px auto 28px;
    border-radius: 2px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 32px;
}
.stat-num {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
}
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grey);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

@media (max-width: 480px) {
    .card { padding: 40px 28px; }
}

:root {
  --orange:     #C8621A;
  --orange-lt:  rgba(200, 98, 26, 0.12);
  --dark:       #2C2C2C;
  --mid:        #555;
  --grey:       #6B7280;
  --border:     #E5E7EB;
  --bg:         #F9F9F9;
  --white:      #FFFFFF;
  --card-bg:    #F0F0F0;
  --selected-border: var(--orange);
  --radius:     10px;
  --header-h:   48px;
  --font:       'DM Sans', sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--dark);
  background: var(--bg);
  overflow: hidden;
}

.app-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.brand-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.main-row {
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

.sidebar {
  height: 100%;
  overflow-y: auto;
  background: var(--white);
}
.sidebar-inner { padding-bottom: 24px; }

.filter-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey);
}
.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 6px;
}
.filter-section { margin-bottom: 16px; }

.form-check { margin-bottom: 4px; }
.form-check-label { font-size: 13px; cursor: pointer; }
.form-check-input:checked { background-color: var(--orange); border-color: var(--orange); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--orange-lt); }

.product-panel {
  height: 100%;
  overflow: hidden;
  background: var(--white);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding: 8px;
  height: 100%;
}

.product-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 3/4;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.product-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.product-card:hover img { transform: scale(1.04); }
.product-card.selected {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange);
}
.product-card .card-check {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: var(--white);
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  color: var(--orange);
  font-size: 15px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.product-card.selected .card-check { display: flex; }

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--grey);
  font-size: 13px;
}

.gender-pill, .cat-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--mid);
  transition: all 0.15s;
  user-select: none;
}
.gender-pill.active, .cat-pill.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.tryon-panel {
  height: 100%;
  overflow-y: auto;
  background: var(--white);
}
.tryon-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}

.upload-btn {
  width: 54px; height: 54px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--dark);
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.upload-btn:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-lt); }

/* Uploaded thumbnail */
.uploaded-thumb {
  position: relative;
  width: 54px; height: 54px;
  border-radius: var(--radius);
  border: 2px solid var(--orange);
  overflow: visible;
  flex-shrink: 0;
}
.uploaded-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  display: block;
}
.thumb-check {
  position: absolute; top: -8px; right: -8px;
  background: var(--white);
  border-radius: 50%;
  color: var(--orange);
  font-size: 16px;
  line-height: 1;
}

/* See Your Look button */
.see-look-btn {
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--dark);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.see-look-btn:hover, .see-look-btn.ready {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.preview-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-placeholder { padding: 32px 16px; }
.preview-img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
  transition: opacity 0.3s;
}
.preview-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(249,249,249,0.85);
}

.preview-toolbar {
  position: absolute;
  bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.tool-btn {
  border: none; background: none;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--mid);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tool-btn:hover { background: var(--orange-lt); color: var(--orange); }

.history-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}
.history-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.history-item {
  position: relative;
  width: 64px; height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.history-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.history-item:hover { border-color: var(--orange); transform: translateY(-2px); }
.history-item .hist-remove {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px;
  opacity: 0; transition: opacity 0.15s;
  border: none; cursor: pointer;
}
.history-item:hover .hist-remove { opacity: 1; }

.capture-modal-content {
  border-radius: 14px;
  border: none;
  box-shadow: 0 16px 48px rgba(0,0,0,0.14);
}
.capture-area {
  width: 100%;
  min-height: 260px;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.capture-placeholder { padding: 40px 24px; text-align: center; }
#capturedPreview, #cameraStream { max-height: 340px; }

.capture-icon-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--dark);
  transition: all 0.15s;
}
.capture-icon-btn:hover {
  background: var(--orange-lt);
  border-color: var(--orange);
  color: var(--orange);
}
.upload-continue-btn {
  padding: 10px 32px;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.upload-continue-btn:hover { background: var(--orange); }

/* apply filter btn (offcanvas) */
.apply-filter-btn {
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
}
.apply-filter-btn:hover { background: #b5561a; color: var(--white); }

.product-grid::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.tryon-panel::-webkit-scrollbar { width: 4px; }
.product-grid::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.tryon-panel::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 4px;
}

.fade-in { animation: fadeIn 0.3s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 767px) {
  html, body { overflow: auto; }
  .main-row { height: auto; overflow: visible; }
  .product-panel, .tryon-panel { height: auto; overflow: visible; }
  .product-grid { height: auto; max-height: none; }
  .preview-box { min-height: 280px; }
}