/**
 * Carpet & Floor Visualizer — Premium Studio App Interface
 * Ultra-clean, modern interior design visualizer optimized for Desktop, Laptop, Tablet, and Mobile.
 */

:root {
  /* Brand / Luxury Interior Palette */
  --cfv-navy: #092c48;
  --cfv-navy-dark: #051a2c;
  --cfv-navy-light: #164264;
  --cfv-gold: #c5a880;
  --cfv-gold-hover: #b08d5c;
  --cfv-gold-light: #f7f3ec;
  --cfv-gold-glow: rgba(197, 168, 128, 0.35);

  /* Clean Studio Surfaces */
  --cfv-bg: #f8fafc;
  --cfv-surface: #ffffff;
  --cfv-surface-alt: #f1f5f9;
  --cfv-surface-muted: #e2e8f0;
  --cfv-stage-bg: #f5f6f8;

  /* Typography Colors */
  --cfv-text: #092c48;
  --cfv-text-muted: #537086;
  --cfv-text-light: #8da4b5;
  --cfv-text-white: #ffffff;

  /* Borders & Shadows */
  --cfv-border: rgba(9, 44, 72, 0.08);
  --cfv-border-light: rgba(9, 44, 72, 0.04);
  --cfv-border-active: var(--cfv-gold);
  --cfv-shadow-sm: 0 2px 8px rgba(9, 44, 72, 0.05);
  --cfv-shadow-md: 0 6px 20px rgba(9, 44, 72, 0.08);
  --cfv-shadow-lg: 0 16px 40px rgba(9, 44, 72, 0.12);

  /* Geometry */
  --cfv-radius-sm: 8px;
  --cfv-radius-md: 12px;
  --cfv-radius-lg: 18px;
  --cfv-radius-pill: 9999px;
  --cfv-transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --cfv-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Layout dimensions */
  --cfv-sidebar-width: 380px;
}

/* ─── Outer Container & WordPress Breakout Integration ───────────────── */
.cfv-container-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 1. Prevent WordPress block themes (:where(.is-layout-constrained) > *) from clamping width */
:where(.is-layout-constrained) > #cfv-root,
:where(.is-layout-constrained) > .cfv-app,
:where(.is-layout-constrained) > .yeti_room_visualizer,
:where(.is-layout-constrained) > .cfv-container-wrap,
.entry-content > #cfv-root,
.entry-content > .cfv-app,
.entry-content > .yeti_room_visualizer,
.wp-block-post-content > #cfv-root,
.wp-block-post-content > .cfv-app,
.wp-block-post-content > .yeti_room_visualizer {
  max-width: unset !important;
}

/* 2. Main App Shell Base */
.cfv-app,
#cfv-root {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  position: relative;
  width: 100%;
  height: var(--cfv-app-height, clamp(620px, 86vh, 900px));
  background: var(--cfv-surface);
  color: var(--cfv-text);
  font-family: var(--cfv-font);
  border: 1px solid var(--cfv-border);
  border-radius: var(--cfv-radius-lg);
  box-shadow: var(--cfv-shadow-lg);
  overflow: hidden;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* 3. PC & Desktop Studio Expansive Layout (≥ 960px) */
/* Breaks out of narrow theme columns into a gorgeous 1560px luxury studio */
@media (min-width: 960px) {
  .cfv-app.cfv-wide-studio,
  #cfv-root.cfv-wide-studio,
  .yeti_room_visualizer.cfv-wide-studio,
  .cfv-app.alignfull,
  #cfv-root.alignfull,
  .cfv-app.alignwide,
  #cfv-root.alignwide {
    width: min(96vw, 1560px) !important;
    max-width: min(96vw, 1560px) !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 16px !important;
    margin-bottom: 32px !important;
    height: var(--cfv-app-height, clamp(650px, 86vh, 920px));
  }
}

/* 4. Large Screens & 2K / 4K Monitors (≥ 1600px) */
@media (min-width: 1600px) {
  .cfv-app.cfv-wide-studio,
  #cfv-root.cfv-wide-studio,
  .yeti_room_visualizer.cfv-wide-studio,
  .cfv-app.alignfull,
  #cfv-root.alignfull,
  .cfv-app.alignwide,
  #cfv-root.alignwide {
    width: min(94vw, 1680px) !important;
    max-width: min(94vw, 1680px) !important;
    height: var(--cfv-app-height, clamp(700px, 88vh, 960px));
  }
}

/* 6. Opt-out constraint support [carpet_floor_visualizer full_width="false"] */
.cfv-app.cfv-contained,
#cfv-root.cfv-contained {
  width: 100% !important;
  max-width: 100% !important;
  left: auto !important;
  transform: none !important;
  margin: 16px auto !important;
}

/* Loading Shell for zero-CLS before JS boots */
.yeti_room_visualizer-loader-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 560px;
  height: 100%;
  background: var(--cfv-stage-bg, #f5f6f8);
  border-radius: var(--cfv-radius-lg, 18px);
  color: var(--cfv-navy);
  gap: 16px;
}

.yeti_room_visualizer-loader-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(9, 44, 72, 0.12);
  border-top-color: var(--cfv-gold, #c5a880);
  border-radius: 50%;
  animation: cfvSpin 0.7s linear infinite;
}

.yeti_room_visualizer-loader-text {
  font-family: var(--cfv-font, sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--cfv-text-muted);
  letter-spacing: 0.2px;
}

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

.cfv-app button {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.cfv-app button:focus,
.cfv-app button:focus-visible,
.cfv-app button:active {
  outline: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   DESKTOP / LAPTOP LAYOUT: Side Studio Panel + Main Room Stage
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── 1. Left Sidebar (Horizontal Top Rail + Catalog Flyout) ─────────────── */
.cfv-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  width: var(--cfv-sidebar-width, 380px);
  background: var(--cfv-surface);
  border-right: 1px solid var(--cfv-border);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  transition: width var(--cfv-transition);
}

.cfv-sidebar.is-open {
  width: var(--cfv-sidebar-width, 380px);
}

.cfv-sidebar.is-collapsed {
  width: 0 !important;
  min-width: 0 !important;
  border-right: none !important;
}

.cfv-sidebar.is-collapsed .cfv-rail,
.cfv-sidebar.is-collapsed .cfv-panel {
  display: none !important;
}

.cfv-sidebar.is-collapsed .cfv-sidebar-toggle {
  right: auto !important;
  left: 14px !important;
}

/* Horizontal Top Navigation Rail */
.cfv-rail {
  width: 100%;
  height: 52px;
  background: #ffffff;
  border-right: none;
  border-bottom: 1px solid var(--cfv-border-light);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  flex-shrink: 0;
  z-index: 5;
  box-sizing: border-box;
}

.cfv-rail-tabs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  background: var(--cfv-surface-alt);
  padding: 3px;
  border-radius: var(--cfv-radius-pill);
  border: 1px solid var(--cfv-border-light);
}

.cfv-rail-tab {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  height: 32px;
  padding: 0 16px;
  background: transparent;
  border: none;
  border-radius: var(--cfv-radius-pill);
  color: var(--cfv-text-muted);
  cursor: pointer;
  font-family: var(--cfv-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: all var(--cfv-transition);
  position: relative;
  white-space: nowrap;
}

.cfv-rail-tab:hover {
  color: var(--cfv-navy);
}

.cfv-rail-tab.is-active {
  color: var(--cfv-navy);
  background: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(9, 44, 72, 0.08);
}

.cfv-rail-tab.is-active::before {
  display: none;
}

.cfv-rail-tab svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cfv-rail-bottom {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
}

#cfv-rail-download {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: var(--cfv-surface-alt);
  border: 1px solid var(--cfv-border-light);
  color: var(--cfv-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--cfv-transition);
}

#cfv-rail-download:hover {
  background: var(--cfv-navy);
  color: #ffffff;
  border-color: var(--cfv-navy);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(9, 44, 72, 0.15);
}

#cfv-rail-download svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

/* Sidebar Catalog Panel */
.cfv-panel {
  width: 100%;
  flex: 1 1 0%;
  height: auto;
  display: flex;
  flex-direction: column;
  background: var(--cfv-surface);
  overflow: hidden;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.cfv-sidebar.is-collapsed .cfv-panel {
  display: none;
}

.cfv-panel-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--cfv-border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.cfv-panel-title-row {
  display: none !important;
}

/* Category Filter Chips */
.cfv-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 4px 6px 2px; /* Generous vertical padding prevents clipping of pills and borders */
  margin: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cfv-filter-chips::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.cfv-filter-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  height: 28px;
  line-height: 1;
  background: var(--cfv-surface-alt);
  border: 1px solid var(--cfv-border-light);
  border-radius: var(--cfv-radius-pill);
  color: var(--cfv-text-muted);
  font-family: var(--cfv-font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
  margin: 0 !important;
  vertical-align: middle;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.cfv-filter-chip:hover {
  color: var(--cfv-navy);
  border-color: var(--cfv-border);
  background: #ffffff;
}

.cfv-filter-chip.is-active {
  background: var(--cfv-navy);
  color: #ffffff;
  border-color: var(--cfv-navy);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(9, 44, 72, 0.2);
}

/* ─── Custom Luxury Studio Category Dropdown ───────────────── */
.cfv-custom-select-wrap {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.cfv-custom-select-trigger {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid var(--cfv-border-light, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  color: var(--cfv-navy, #092c48);
  font-family: var(--cfv-font, inherit);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-appearance: none;
  appearance: none;
  user-select: none;
}

.cfv-custom-select-trigger:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.cfv-custom-select-wrap.is-open .cfv-custom-select-trigger,
.cfv-custom-select-trigger:focus-visible {
  background: #ffffff;
  border-color: var(--cfv-navy, #092c48);
  box-shadow: 0 0 0 3px rgba(9, 44, 72, 0.12);
}

.cfv-custom-select-trigger-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.cfv-custom-select-icon {
  width: 15px;
  height: 15px;
  stroke: var(--cfv-gold-hover, #b45309);
  fill: none;
  stroke-width: 2.2;
  flex-shrink: 0;
}

.cfv-custom-select-current {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 700;
  color: var(--cfv-navy, #092c48);
}

.cfv-custom-select-arrow {
  width: 14px;
  height: 14px;
  stroke: #64748b;
  fill: none;
  stroke-width: 2.2;
  flex-shrink: 0;
  margin-left: 8px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease;
}

.cfv-custom-select-wrap.is-open .cfv-custom-select-arrow {
  transform: rotate(180deg);
  stroke: var(--cfv-navy, #092c48);
}

/* Floating Menu Popover */
.cfv-custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 999999;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  animation: cfvDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.cfv-custom-select-menu::-webkit-scrollbar {
  width: 5px;
}
.cfv-custom-select-menu::-webkit-scrollbar-track {
  background: transparent;
}
.cfv-custom-select-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

@keyframes cfvDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Individual Option Item */
.cfv-custom-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 12px;
  margin: 2px 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
}

.cfv-custom-select-item:hover {
  background: #f1f5f9;
  color: #092c48;
}

.cfv-custom-select-item.is-selected {
  background: rgba(9, 44, 72, 0.08);
  color: #092c48;
  font-weight: 700;
}

.cfv-custom-select-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfv-custom-select-item-right,
.cfv-custom-select-item-badge {
  display: none !important;
}

.cfv-custom-select-check {
  width: 15px;
  height: 15px;
  stroke: #092c48;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hierarchical Category Dropdown Items */
.cfv-custom-select-parent {
  font-weight: 700;
  color: #0f172a;
}

.cfv-custom-select-parent-text {
  font-weight: 700;
}

.cfv-custom-select-child {
  padding-left: 28px !important;
  font-weight: 500;
  color: #475569;
  background: #fafbfc;
}

.cfv-custom-select-child:hover {
  background: #f1f5f9 !important;
  color: #092c48 !important;
}

.cfv-custom-select-child.is-selected {
  background: #edf5fd !important;
  color: #092c48 !important;
  font-weight: 600;
}

.cfv-custom-select-child-text {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cfv-select-tree-branch {
  color: #94a3b8;
  font-family: monospace;
  font-size: 11px;
  user-select: none;
}

/* Quick Sub-Category Pills Strip */
.cfv-subcat-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 2px 0;
  margin-top: -2px;
  margin-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cfv-subcat-strip::-webkit-scrollbar {
  display: none;
}

.cfv-subcat-pill {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  outline: none;
  font-family: inherit;
}

.cfv-subcat-pill:hover {
  background: #e2e8f0;
  color: #092c48;
  border-color: #cbd5e1;
}

.cfv-subcat-pill.is-active {
  background: #092c48;
  color: #ffffff;
  border-color: #092c48;
  box-shadow: 0 2px 6px rgba(9, 44, 72, 0.25);
}

/* Search Box */
.cfv-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.cfv-search svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  stroke: var(--cfv-text-light);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.cfv-search-input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 34px;
  background: var(--cfv-surface-alt);
  border: 1px solid var(--cfv-border-light);
  border-radius: var(--cfv-radius-pill);
  color: var(--cfv-text);
  font-family: var(--cfv-font);
  font-size: 12px;
  outline: none;
  transition: all 0.2s ease;
}

.cfv-search-input:focus {
  background: #ffffff;
  border-color: var(--cfv-navy);
  box-shadow: 0 0 0 3px rgba(9, 44, 72, 0.08);
}

.cfv-search-clear {
  position: absolute;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(9, 44, 72, 0.1);
  border: none;
  color: var(--cfv-navy);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Panel Scroll Content */
.cfv-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  overscroll-behavior: contain;
}

.cfv-panel-content::-webkit-scrollbar {
  width: 5px;
}

.cfv-panel-content::-webkit-scrollbar-thumb {
  background: rgba(9, 44, 72, 0.15);
  border-radius: var(--cfv-radius-pill);
}

/* Cards Grid */
.cfv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Card */
.cfv-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(9, 44, 72, 0.08);
  border-radius: var(--cfv-radius-md);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: all var(--cfv-transition);
  text-align: left;
  box-shadow: var(--cfv-shadow-sm);
}

.cfv-card:hover {
  transform: translateY(-2px);
  border-color: var(--cfv-navy);
  box-shadow: var(--cfv-shadow-md);
}

.cfv-card.is-selected {
  border-color: var(--cfv-gold);
  box-shadow: 0 0 0 2px var(--cfv-gold), 0 4px 14px rgba(197, 168, 128, 0.3);
}

.cfv-card.is-selected .cfv-card-info {
  background: #fdfbf8;
}

.cfv-card.is-selected .cfv-card-name {
  color: var(--cfv-navy);
  font-weight: 800;
}

.cfv-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #edf2f7;
}

.cfv-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cfv-card:hover .cfv-card-thumb {
  transform: scale(1.05);
}

.cfv-card-tag {
  display: none !important;
}

.cfv-card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8bc93 0%, #b08d5c 100%);
  border: 1.5px solid #ffffff;
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(176, 141, 92, 0.45);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cfv-card.is-selected .cfv-card-check {
  display: flex;
  animation: cfvBadgePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cfvBadgePop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.cfv-card-check svg {
  width: 12px;
  height: 12px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cfv-card-info {
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cfv-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--cfv-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfv-card-spec {
  display: none !important;
}

/* Upload Card in Room Grid */
.cfv-card-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 130px;
  background: var(--cfv-gold-light);
  border: 2px dashed rgba(197, 168, 128, 0.6);
  border-radius: var(--cfv-radius-md);
  color: var(--cfv-navy);
  cursor: pointer;
  transition: all var(--cfv-transition);
  text-align: center;
  padding: 12px;
}

.cfv-card-upload:hover {
  background: #ffffff;
  border-color: var(--cfv-gold);
  transform: translateY(-2px);
  box-shadow: var(--cfv-shadow-md);
}

.cfv-card-upload svg {
  width: 24px;
  height: 24px;
  stroke: var(--cfv-gold-hover);
  fill: none;
  stroke-width: 2;
}

.cfv-card-upload-text {
  font-size: 12px;
  font-weight: 700;
}

.cfv-card-upload-sub {
  font-size: 10px;
  color: var(--cfv-text-muted);
}

/* Sidebar Toggle Chevron on Edge */
.cfv-sidebar-toggle {
  position: absolute;
  top: 50%;
  right: -18px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid rgba(9, 44, 72, 0.12);
  color: var(--cfv-navy, #092c48);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 45;
  box-shadow: 0 4px 14px rgba(9, 44, 72, 0.14), 0 1px 3px rgba(9, 44, 72, 0.08);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.cfv-sidebar-toggle:hover {
  background: var(--cfv-navy, #092c48);
  color: #ffffff;
  border-color: var(--cfv-navy, #092c48);
  box-shadow: 0 6px 20px rgba(9, 44, 72, 0.25);
  transform: translateY(-50%) scale(1.08);
}

.cfv-sidebar-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

.cfv-sidebar-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.cfv-sidebar.is-collapsed .cfv-sidebar-toggle {
  right: auto !important;
  left: 14px !important;
  box-shadow: 0 6px 22px rgba(9, 44, 72, 0.18), 0 2px 6px rgba(9, 44, 72, 0.1) !important;
  border-color: var(--cfv-gold, #c5a880) !important;
  background: #ffffff !important;
  color: var(--cfv-navy, #092c48) !important;
}

.cfv-sidebar.is-collapsed .cfv-sidebar-toggle:hover {
  background: var(--cfv-navy, #092c48) !important;
  color: #ffffff !important;
  border-color: var(--cfv-navy, #092c48) !important;
  box-shadow: 0 8px 24px rgba(9, 44, 72, 0.3) !important;
  transform: translateY(-50%) scale(1.1) !important;
}

.cfv-sidebar.is-collapsed .cfv-sidebar-toggle svg {
  transform: rotate(180deg);
}

/* ─── 2. Main Room Stage (Right Area on Desktop) ───────────────────────── */
.cfv-stage {
  flex: 1;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--cfv-stage-bg, #f5f6f8);
  overflow: hidden;
}

/* Stage Dedicated Top Header Toolbar (Cleanly sits ABOVE the image so nothing overlaps the photo) */
.cfv-stage-hud {
  position: relative;
  width: 100%;
  height: 52px;
  min-height: 52px;
  background: #ffffff;
  border-bottom: 1px solid var(--cfv-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 25;
}

.cfv-stage-hud-left {
  position: static;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cfv-stage-hud-right {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfv-canvas-host {
  flex: 1 1 0%;
  min-height: 0;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cfv-canvas {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain; /* NEVER CROP OR STRETCH THE ROOM! */
  display: block;
}

/* Clean White Pill Button */
.cfv-pill-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(9, 44, 72, 0.12);
  border-radius: var(--cfv-radius-pill);
  color: var(--cfv-navy);
  font-family: var(--cfv-font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(9, 44, 72, 0.08);
  transition: all var(--cfv-transition);
}

.cfv-pill-btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(9, 44, 72, 0.14);
}

.cfv-pill-btn.is-active {
  background: var(--cfv-navy);
  color: #ffffff;
  border-color: var(--cfv-navy);
}

.cfv-pill-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cfv-pill-btn-icon {
  width: 38px;
  padding: 0;
  justify-content: center;
}

/* Active Carpet Info Capsule (Polished Luxury Badge in Top Bar) */
.cfv-carpet-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 3px 14px 3px 5px;
  background: var(--cfv-surface-alt, #f1f5f9);
  border: 1px solid var(--cfv-border);
  border-radius: var(--cfv-radius-pill);
  box-shadow: 0 1px 3px rgba(9, 44, 72, 0.05);
  pointer-events: auto;
  transition: all var(--cfv-transition);
  max-width: 320px;
  user-select: none;
}

.cfv-carpet-capsule.has-link {
  cursor: pointer;
}

.cfv-carpet-capsule.has-link:hover {
  background: #ffffff;
  border-color: var(--cfv-gold, #c5a880);
  box-shadow: 0 3px 12px rgba(197, 168, 128, 0.28);
  transform: translateY(-1px);
}

.cfv-carpet-capsule.has-link:active {
  transform: translateY(0) scale(0.98);
}

.cfv-carpet-capsule-arrow {
  display: none;
  width: 14px;
  height: 14px;
  stroke: var(--cfv-gold-hover, #b08d5c);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-left: 2px;
  flex-shrink: 0;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.cfv-carpet-capsule.has-link .cfv-carpet-capsule-arrow {
  display: block;
}

.cfv-carpet-capsule.has-link:hover .cfv-carpet-capsule-arrow {
  transform: translate(1.5px, -1.5px);
  stroke: var(--cfv-gold, #c5a880);
}

.cfv-carpet-capsule-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid var(--cfv-gold, #c5a880);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.cfv-carpet-capsule-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--cfv-navy, #092c48);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.cfv-carpet-capsule-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--cfv-gold-hover, #b08d5c);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

/* Fullscreen Button — Simple, Modern & Clean Icon Button at Top Right */
#cfv-btn-fullscreen {
  width: 36px;
  height: 36px;
  border-radius: var(--cfv-radius-sm, 8px);
  background: var(--cfv-surface-alt, #f1f5f9);
  border: 1px solid var(--cfv-border);
  color: var(--cfv-navy, #092c48);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 3px rgba(9, 44, 72, 0.06);
  transition: all 0.2s ease;
  outline: none;
}

#cfv-btn-fullscreen:hover {
  background: #ffffff;
  border-color: rgba(9, 44, 72, 0.22);
  color: var(--cfv-navy-dark, #051a2c);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(9, 44, 72, 0.1);
}

#cfv-btn-fullscreen:active {
  transform: translateY(0) scale(0.96);
}

#cfv-btn-fullscreen svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Interactive Split Before/After Divider */
.cfv-split-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 22;
  cursor: ew-resize;
  transform: translateX(-50%);
}

.cfv-split-handle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--cfv-navy);
  color: var(--cfv-navy);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cfv-split-handle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.cfv-split-tag {
  position: absolute;
  top: 60px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border-radius: var(--cfv-radius-pill);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.cfv-split-tag-left {
  right: 14px;
}

.cfv-split-tag-right {
  left: 14px;
  color: var(--cfv-gold);
}

/* Busy Spinner */
.cfv-busy-screen {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 30;
}

.cfv-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--cfv-gold);
  animation: cfvSpin 0.7s linear infinite;
}

.cfv-busy-text {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

@keyframes cfvSpin {
  100% { transform: rotate(360deg); }
}

/* AI error overlay */
.cfv-error-screen {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 31;
}

.cfv-error-card {
  max-width: 380px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  padding: 20px 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cfv-error-title {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

.cfv-error-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

.cfv-error-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cfv-error-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cfv-error-btn.cfv-error-retry {
  background: var(--cfv-gold);
  border-color: var(--cfv-gold);
  color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE & TABLET BOTTOM BAR & TOUCH DRAWER (≤ 840px)
   ══════════════════════════════════════════════════════════════════════════ */

/* Mobile Bottom Tab Bar */
.cfv-mobile-bar {
  display: none;
}

/* Mobile Quick Swatch Horizontal Carousel */
.cfv-mobile-swatches {
  display: none;
}

/* Mobile Slide-Up Bottom Sheet */
.cfv-mobile-sheet {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE & TABLET APP INTERFACE (≤ 959px)
   Immersive, responsive studio with top room stage, quick swatches, & touch dock
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 959px) {
  /* 1. Mobile & Tablet Container: Break out of WordPress global padding to leave only little gaps */
  .cfv-app,
  #cfv-root,
  .yeti_room_visualizer {
    display: flex !important;
    flex-direction: column !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 6px 0 20px 0 !important;
    height: clamp(520px, 80vh, 680px) !important;
    max-height: calc(100dvh - 70px) !important;
    border-radius: 16px !important;
    border: none !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-shadow: 0 8px 30px rgba(9, 44, 72, 0.08) !important;
  }

  /* 2. Hide Desktop Multi-column Sidebar */
  .cfv-sidebar {
    display: none !important;
  }

  /* 3. Room Canvas Stage: Always Fills Primary Area */
  .cfv-stage {
    flex: 1 1 0% !important;
    min-height: 280px !important;
    width: 100% !important;
    height: auto !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    background: var(--cfv-stage-bg, #f5f6f8) !important;
    overflow: hidden !important;
  }

  /* 4. Stage Top Header Bar on Mobile (Clean bar sitting ABOVE the image, no overlapping!) */
  .cfv-stage-hud {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    background: #ffffff !important;
    border-bottom: 1px solid var(--cfv-border-light) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    z-index: 25 !important;
    pointer-events: auto !important;
  }

  .cfv-stage-hud-left {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    pointer-events: auto !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .cfv-stage-hud-right {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    pointer-events: auto !important;
    flex-shrink: 0 !important;
  }

  .cfv-carpet-capsule {
    height: 34px !important;
    padding: 2px 10px 2px 4px !important;
    background: var(--cfv-surface-alt, #f1f5f9) !important;
    border: 1px solid var(--cfv-border) !important;
    border-radius: var(--cfv-radius-pill) !important;
    box-shadow: 0 1px 3px rgba(9, 44, 72, 0.05) !important;
    max-width: calc(100% - 46px) !important;
  }

  .cfv-carpet-capsule-swatch {
    width: 24px !important;
    height: 24px !important;
    border: 1.5px solid var(--cfv-gold, #c5a880) !important;
  }

  .cfv-carpet-capsule-name {
    font-size: 12px !important;
    font-weight: 700 !important;
    max-width: 140px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .cfv-carpet-capsule-sub {
    font-size: 9px !important;
    display: block !important;
    line-height: 1 !important;
    font-weight: 600 !important;
  }

  .cfv-carpet-capsule-arrow {
    width: 12px !important;
    height: 12px !important;
    margin-left: 2px !important;
  }

  #cfv-btn-fullscreen {
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    background: var(--cfv-surface-alt, #f1f5f9) !important;
    border: 1px solid var(--cfv-border) !important;
    color: var(--cfv-navy, #092c48) !important;
    box-shadow: 0 1px 3px rgba(9, 44, 72, 0.06) !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #cfv-btn-fullscreen svg {
    width: 16px !important;
    height: 16px !important;
    stroke-width: 2.2 !important;
  }

  .cfv-canvas-host {
    position: relative !important;
    inset: auto !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .cfv-canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* 5. Swipeable Quick Swatch Strip directly under Stage (Zero Grey Lines) */
  .cfv-mobile-swatches {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 12px !important;
    background: #ffffff !important;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: 0 2px 8px rgba(9, 44, 72, 0.03) !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
  }

  .cfv-mobile-swatches::-webkit-scrollbar {
    display: none !important;
  }

  .cfv-mini-swatch {
    flex-shrink: 0 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 8px !important;
    border: 2px solid transparent !important;
    background-size: cover !important;
    background-position: center !important;
    cursor: pointer !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
  }

  .cfv-mini-swatch.is-active {
    border-color: var(--cfv-gold) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 3px 10px rgba(197, 168, 128, 0.4) !important;
  }

  /* 6. Mobile Bottom App Navigation Dock — Clean, Elevated, Zero Grey Lines */
  .cfv-mobile-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    height: 60px !important;
    background: #ffffff !important;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: 0 -4px 18px rgba(9, 44, 72, 0.04) !important;
    flex-shrink: 0 !important;
    z-index: 20 !important;
    padding: 6px 12px !important;
    box-sizing: border-box !important;
  }

  .cfv-mobile-bar-btn {
    flex: 1 !important;
    max-width: 120px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    height: 48px !important;
    padding: 4px 10px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 12px !important;
    color: var(--cfv-text-muted) !important;
    font-family: var(--cfv-font) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative !important;
  }

  .cfv-mobile-bar-btn:focus,
  .cfv-mobile-bar-btn:focus-visible,
  .cfv-mobile-bar-btn:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  .cfv-mobile-bar-btn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2.1 !important;
    transition: transform 0.2s ease, stroke 0.2s ease !important;
  }

  /* Polished Active Tab Pill (Clean Gold-Tinted Container, Zero Outlines) */
  .cfv-mobile-bar-btn.is-active {
    background: var(--cfv-gold-light, #f7f3ec) !important;
    color: var(--cfv-navy, #092c48) !important;
    outline: none !important;
    border: none !important;
  }

  .cfv-mobile-bar-btn.is-active svg {
    stroke: var(--cfv-gold-hover, #b08d5c) !important;
    transform: scale(1.08) !important;
  }

  .cfv-mobile-bar-btn.is-active span {
    color: var(--cfv-navy, #092c48) !important;
    font-weight: 800 !important;
  }

  /* 7. Mobile Slide-Up Touch Drawer Sheet — Zero Grey Lines, Seamless Luxury */
  .cfv-mobile-sheet {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    bottom: 60px !important;
    left: 0 !important;
    right: 0 !important;
    height: 72% !important;
    max-height: 85% !important;
    background: #ffffff !important;
    border: none !important;
    border-top: none !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -12px 40px rgba(9, 44, 72, 0.14) !important;
    z-index: 35 !important;
    transform: translateY(115%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
  }

  .cfv-mobile-sheet.is-open {
    transform: translateY(0) !important;
  }

  .cfv-sheet-handle {
    width: 100% !important;
    padding: 8px 0 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  .cfv-sheet-handle-pill {
    width: 40px !important;
    height: 4px !important;
    border-radius: var(--cfv-radius-pill) !important;
    background: rgba(9, 44, 72, 0.2) !important;
  }

  .cfv-mobile-sheet-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 16px 8px !important;
    border-bottom: 1px solid rgba(9, 44, 72, 0.05) !important;
    flex-shrink: 0 !important;
  }

  .cfv-mobile-sheet-title {
    font-size: 14.5px !important;
    font-weight: 800 !important;
    color: var(--cfv-navy) !important;
    letter-spacing: -0.01em !important;
  }

  .cfv-mobile-sheet-close {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: var(--cfv-surface-alt) !important;
    border: none !important;
    color: var(--cfv-navy) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    cursor: pointer !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: background 0.2s ease !important;
  }

  .cfv-mobile-sheet-close:hover {
    background: rgba(9, 44, 72, 0.08) !important;
  }

  .cfv-mobile-sheet-controls {
    padding: 6px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .cfv-mobile-sheet .cfv-custom-select-wrap {
    margin-bottom: 4px !important;
  }

  .cfv-mobile-sheet .cfv-custom-select-trigger {
    height: 42px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    background: #ffffff !important;
  }

  .cfv-mobile-sheet .cfv-custom-select-menu {
    max-height: 240px !important;
    z-index: 999999 !important;
  }

  .cfv-mobile-sheet .cfv-custom-select-item {
    height: 42px !important;
    font-size: 13.5px !important;
    padding: 0 14px !important;
  }

  .cfv-mobile-sheet .cfv-search-input {
    height: 32px !important;
    font-size: 11.5px !important;
    padding: 0 28px 0 30px !important;
  }

  .cfv-mobile-sheet .cfv-search svg {
    left: 10px !important;
    width: 13px !important;
    height: 13px !important;
  }

  .cfv-mobile-sheet-body {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    padding: 8px 12px 20px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .cfv-mobile-sheet .cfv-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  /* Compact Cards in Mobile Sheet — Clean Luxury, No Grey Lines */
  .cfv-mobile-sheet .cfv-card {
    border-radius: 12px !important;
    border: 1px solid rgba(9, 44, 72, 0.08) !important;
    box-shadow: 0 2px 8px rgba(9, 44, 72, 0.04) !important;
    background: #ffffff !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .cfv-mobile-sheet .cfv-card.is-selected {
    border-color: var(--cfv-gold, #c5a880) !important;
    box-shadow: 0 0 0 2px var(--cfv-gold, #c5a880), 0 4px 14px rgba(197, 168, 128, 0.25) !important;
  }

  .cfv-mobile-sheet .cfv-card.is-selected .cfv-card-info {
    background: #faf8f5 !important;
  }

  .cfv-mobile-sheet .cfv-card-thumb-wrap {
    aspect-ratio: 4 / 3 !important;
    border-radius: 11px 11px 0 0 !important;
  }

  .cfv-mobile-sheet .cfv-card-tag {
    display: none !important;
  }

  .cfv-mobile-sheet .cfv-card-check {
    top: 3px !important;
    right: 3px !important;
    width: 17px !important;
    height: 17px !important;
    background: linear-gradient(135deg, #d8bc93 0%, #b08d5c 100%) !important;
    border: 1.5px solid #ffffff !important;
    box-shadow: 0 2px 6px rgba(176, 141, 92, 0.4) !important;
  }

  .cfv-mobile-sheet .cfv-card-check svg {
    width: 9px !important;
    height: 9px !important;
    stroke: #ffffff !important;
  }

  .cfv-mobile-sheet .cfv-card-info {
    padding: 6px 6px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .cfv-mobile-sheet .cfv-card-name {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
  }

  .cfv-mobile-sheet .cfv-card-spec {
    display: none !important;
  }

  /* Compact Upload Card in Mobile Sheet — Warm Gold Accent, No Grey Lines */
  .cfv-mobile-sheet .cfv-card-upload {
    min-height: 100px !important;
    height: 100% !important;
    border-radius: 12px !important;
    padding: 8px 4px !important;
    gap: 3px !important;
    border: 2px dashed rgba(197, 168, 128, 0.45) !important;
    background: #faf8f5 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .cfv-mobile-sheet .cfv-card-upload svg {
    width: 20px !important;
    height: 20px !important;
  }

  .cfv-mobile-sheet .cfv-card-upload-text {
    font-size: 10.5px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }

  .cfv-mobile-sheet .cfv-card-upload-sub {
    font-size: 8px !important;
    line-height: 1.1 !important;
    text-align: center !important;
  }
}

/* Tablet (600px - 959px): 4-column compact gallery */
@media (min-width: 600px) and (max-width: 959px) {
  .cfv-mobile-sheet .cfv-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

/* Small mobile (≤ 480px) adjustments */
@media (max-width: 480px) {
  .cfv-app,
  #cfv-root,
  .yeti_room_visualizer {
    width: calc(100vw - 10px) !important;
    max-width: calc(100vw - 10px) !important;
    margin: 4px 0 16px 0 !important;
    border-radius: 12px !important;
  }

  .cfv-pill-btn .cfv-btn-text {
    display: none !important;
  }

  .cfv-carpet-capsule {
    max-width: 140px !important;
  }

  .cfv-carpet-capsule-name {
    font-size: 11px !important;
  }

  .cfv-mini-swatch {
    width: 40px !important;
    height: 40px !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   MODALS (Download Lead Capture & Fullscreen Lightbox)
   ══════════════════════════════════════════════════════════════════════════ */
.cfv-modal {
  position: absolute;
  inset: 0;
  background: rgba(5, 26, 44, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cfv-modal-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: var(--cfv-radius-lg);
  box-shadow: var(--cfv-shadow-lg);
  overflow: hidden;
  padding: 24px;
}

.cfv-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cfv-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--cfv-navy);
}

.cfv-modal-sub {
  font-size: 13px;
  color: var(--cfv-text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.cfv-modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--cfv-surface-alt);
  color: var(--cfv-navy);
  font-size: 18px;
  cursor: pointer;
}

.cfv-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.cfv-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--cfv-navy);
}

.cfv-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--cfv-border);
  border-radius: var(--cfv-radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.cfv-field input:focus {
  border-color: var(--cfv-navy);
  box-shadow: 0 0 0 3px rgba(9, 44, 72, 0.08);
}

.cfv-submit-btn {
  width: 100%;
  height: 44px;
  margin-top: 8px;
  border: none;
  border-radius: var(--cfv-radius-pill);
  background: linear-gradient(135deg, #164264 0%, #092c48 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--cfv-shadow-md);
  transition: all 0.2s ease;
}

.cfv-submit-btn:hover {
  background: #051a2c;
  transform: translateY(-1px);
}

/* Fullscreen Lightbox — Clean Luxury Studio Gallery View */
.cfv-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(246, 248, 250, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  box-sizing: border-box;
  animation: cfvFadeIn 0.25s ease;
  cursor: zoom-out;
}

@keyframes cfvFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cfv-lightbox-wrap {
  position: relative;
  max-width: 94vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.cfv-lightbox img {
  max-width: min(94vw, 1680px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(9, 44, 72, 0.08);
  box-shadow: 0 24px 70px rgba(9, 44, 72, 0.16), 0 4px 20px rgba(9, 44, 72, 0.08);
  display: block;
}

.cfv-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(9, 44, 72, 0.12);
  color: var(--cfv-navy, #092c48);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(9, 44, 72, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.cfv-lightbox-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cfv-lightbox-close:hover {
  background: var(--cfv-navy, #092c48);
  color: #ffffff;
  border-color: var(--cfv-navy, #092c48);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(9, 44, 72, 0.22);
}

.cfv-lightbox-close:active {
  transform: scale(0.96);
}
