/* ============================================================
   Frame Gallery - Design System
   Mobile-first, PWA-ready, fits in Facebook/Instagram in-app browser
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
  /* Brand palette — earthy gallery feel, not generic SaaS blue */
  --c-ink: #1a1a1a;
  --c-ink-soft: #4a4a4a;
  --c-ink-faint: #8a8a85;
  --c-paper: #faf8f3;
  --c-paper-warm: #f4ede0;
  --c-card: #ffffff;
  --c-line: rgba(26, 26, 26, 0.08);
  --c-line-strong: rgba(26, 26, 26, 0.18);

  --c-accent: #1a3329;       /* deep forest — gallery wall */
  --c-accent-soft: #2d4a3e;
  --c-accent-light: #d8e0d2;
  --c-gold: #b8924a;
  --c-warm: #c97b5b;

  --c-success: #2d7a4f;
  --c-success-bg: #e6f0e6;
  --c-error: #b8344c;
  --c-error-bg: #fbe9ec;
  --c-info-bg: #eef2ed;

  --c-bkash: #e2136e;
  --c-nagad: #ed1c24;
  --c-whatsapp: #25d366;

  /* Typography */
  --f-display: 'Fraunces', Georgia, serif;
  --f-body: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, sans-serif;
  --f-bn: 'Hind Siliguri', 'Plus Jakarta Sans', sans-serif;

  /* Layout */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --shadow-soft: 0 1px 2px rgba(26, 26, 26, 0.04), 0 4px 12px rgba(26, 26, 26, 0.04);
  --shadow-lift: 0 4px 16px rgba(26, 26, 26, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
}

body[lang="bn"] {
  font-family: var(--f-bn);
}

/* App container - mobile-first, max width on desktop */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--c-paper);
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  body {
    background: linear-gradient(135deg, #2d4a3e 0%, #1a3329 100%);
    min-height: 100vh;
  }
  .app-shell {
    margin: 24px auto;
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-height: calc(100vh - 48px);
  }
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  color: var(--c-ink);
  cursor: pointer;
  text-decoration: none;
}

.topbar-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.lang-switch {
  display: inline-flex;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 100px;
  padding: 3px;
  font-size: 12px;
}

.lang-switch a {
  padding: 4px 10px;
  border-radius: 100px;
  color: var(--c-ink-soft);
  text-decoration: none;
  font-weight: 500;
}

.lang-switch a.active {
  background: var(--c-ink);
  color: var(--c-paper);
}

/* Main content area */
.content {
  flex: 1;
  padding: 16px 18px 100px;
}

/* Hero / brand block */
.hero {
  background: var(--c-accent);
  color: #fff;
  padding: 22px 22px 26px;
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  border: 18px solid rgba(184, 146, 74, 0.25);
  border-radius: 8px;
  transform: rotate(15deg);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin: 0 0 8px;
}

.hero-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.015em;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-paper);
  color: var(--c-accent);
  padding: 10px 18px;
  border-radius: 100px;
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  border: none;
  cursor: pointer;
}

/* Section titles */
.section-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 24px 0 12px;
}

/* Categories grid */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cat-card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 18px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--c-ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cat-card:active {
  transform: scale(0.97);
}

.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-paper-warm);
  color: var(--c-accent);
  font-size: 22px;
  margin-bottom: 8px;
}

.cat-name {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}

/* Generic card */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--c-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--c-accent-soft);
}

.btn-secondary {
  background: var(--c-card);
  color: var(--c-ink);
  border: 1px solid var(--c-line-strong);
}

.btn-block {
  width: 100%;
}

.btn-bkash {
  background: var(--c-bkash);
  color: #fff;
}

.btn-whatsapp {
  background: var(--c-whatsapp);
  color: #fff;
}

/* Sticky bottom action */
.sticky-action {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--c-paper) 60%, transparent);
  z-index: 40;
}

@media (min-width: 768px) {
  .sticky-action {
    position: sticky;
    background: transparent;
  }
}

/* Form elements */
.field {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  color: var(--c-ink);
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(26, 51, 41, 0.08);
}

.textarea {
  min-height: 80px;
  resize: vertical;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--c-line-strong);
  border-radius: var(--r-md);
  padding: 36px 20px;
  text-align: center;
  background: var(--c-card);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--c-accent);
  background: var(--c-info-bg);
}

.upload-zone-icon {
  font-size: 42px;
  color: var(--c-ink-faint);
  margin-bottom: 8px;
}

.upload-zone-text {
  font-weight: 500;
  margin: 0 0 4px;
}

.upload-zone-hint {
  font-size: 12px;
  color: var(--c-ink-faint);
  margin: 0;
}

/* Size rows */
.size-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.size-row.selected {
  border: 2px solid var(--c-accent);
  padding: 13px 15px;
  background: var(--c-info-bg);
}

.size-name {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}

.size-tag {
  font-size: 11px;
  background: var(--c-paper-warm);
  color: var(--c-gold);
  padding: 2px 8px;
  border-radius: 100px;
  display: inline-block;
  margin-top: 2px;
  font-weight: 500;
}

.size-price {
  font-weight: 600;
  font-family: var(--f-display);
}

/* Frame style cards */
.frame-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.frame-card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.frame-card:active {
  transform: scale(0.97);
}

.frame-card.selected {
  border: 2px solid var(--c-accent);
  padding: 9px;
}

.frame-card-preview {
  aspect-ratio: 1;
  margin-bottom: 8px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.frame-card-name {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.frame-card-price {
  font-size: 12px;
  color: var(--c-ink-faint);
  margin: 2px 0 0;
}

/* Color swatches */
.color-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  transition: transform 0.15s ease;
}

.color-swatch.selected {
  border-color: var(--c-accent);
  transform: scale(1.1);
}

.color-swatch::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
}

/* Wall preview */
.wall-canvas {
  aspect-ratio: 4/3;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #e8dccc 0%, #d4c4a8 60%, #8b7355 60%, #6b5a45 100%);
  margin-bottom: 14px;
}

.wall-room-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.wall-room {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
}

.wall-room.selected {
  border-color: var(--c-accent);
}

.wall-room-label {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

/* Cart line */
.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  margin-bottom: 12px;
}

.cart-item-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  padding: 5px;
  background: #8b5e3c;
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-summary {
  background: var(--c-paper-warm);
  padding: 14px;
  border-radius: var(--r-md);
  margin-bottom: 14px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}

.cart-summary-row.total {
  font-size: 16px;
  font-weight: 600;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--c-line);
}

/* Payment method rows */
.pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  cursor: pointer;
}

.pay-row.selected {
  border: 2px solid var(--c-accent);
  padding: 13px;
  background: var(--c-info-bg);
}

.pay-row.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pay-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.pay-name {
  font-weight: 600;
  margin: 0;
}

.pay-desc {
  font-size: 12px;
  color: var(--c-ink-faint);
  margin: 2px 0 0;
}

/* Tracking timeline */
.timeline {
  position: relative;
  padding-left: 12px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--c-line);
}

.timeline-step {
  position: relative;
  padding: 0 0 18px 28px;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-card);
  border: 2px solid var(--c-line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--c-ink-faint);
  z-index: 1;
}

.timeline-dot.done {
  background: var(--c-success-bg);
  border-color: var(--c-success);
  color: var(--c-success);
}

.timeline-dot.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 51, 41, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(26, 51, 41, 0); }
}

.timeline-label {
  font-weight: 500;
  font-size: 14px;
  margin: 0;
}

.timeline-time {
  font-size: 12px;
  color: var(--c-ink-faint);
  margin: 2px 0 0;
}

.timeline-step.muted .timeline-label {
  color: var(--c-ink-faint);
  font-weight: 400;
}

/* Banners / alerts */
.alert {
  padding: 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
}

.alert-info {
  background: var(--c-info-bg);
  color: var(--c-accent);
}

.alert-success {
  background: var(--c-success-bg);
  color: var(--c-success);
}

.alert-error {
  background: var(--c-error-bg);
  color: var(--c-error);
}

/* Bottom nav (only on home) */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--c-card);
  border-top: 1px solid var(--c-line);
  position: sticky;
  bottom: 0;
  z-index: 30;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  color: var(--c-ink-faint);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
}

.nav-item.active {
  color: var(--c-accent);
}

.nav-item i {
  font-size: 22px;
}

/* Live preview frame (used in customize step) */
.preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 16px;
  transition: padding 0.2s ease, background 0.2s ease;
  background: #8b5e3c;
}

.preview-frame.with-mat {
  padding: 36px;
}

.preview-frame img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 240px;
  object-fit: contain;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--c-line-strong);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle.on {
  background: var(--c-accent);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.2s ease;
}

.toggle.on::after {
  left: 20px;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--c-line);
  border-radius: 100px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--c-accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--c-paper);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--c-accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--c-paper);
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--c-ink-faint); }
.text-small { font-size: 12px; }
.spacer { height: 16px; }
.flex-row { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Tabler icons base */
[class^="ti-"], [class*=" ti-"] {
  font-family: 'tabler-icons' !important;
  font-style: normal;
}
