/* ========================================
   STYLE FINDER - Shared Component Styles
   Society Arts
   ======================================== */

/* ========================================
   STYLE PICKER MODAL - Base
   ======================================== */

.style-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(62, 35, 24, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.style-picker-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(62, 35, 24, 0.3);
}

.style-finder-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.style-finder-page .style-picker-modal {
  max-width: none;
  max-height: none;
  height: 100%;
  flex: 1;
  border-radius: 0;
  box-shadow: none;
}

/* ========================================
   MODAL HEADER
   ======================================== */

.style-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-light);
  background: #3E2318;
  color: #FAF8F5;
}

.style-picker-title {
  font-family: 'Domine', var(--font-serif);
  font-size: 20px;
  font-weight: 500;
}

.style-picker-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.style-picker-close,
.sp-maximize-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #FAF8F5;
  transition: background 0.15s;
}

.style-picker-close:hover,
.sp-maximize-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* ========================================
   MAXIMIZE MODE
   ======================================== */

.style-picker-modal.maximized {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  width: calc(100vw - 32px);
  height: calc(100vh - 32px);
  border-radius: 8px;
}

/* ========================================
   TABS ROW / FILTER BAR
   ======================================== */

.style-picker-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-tan-10);
  flex-wrap: wrap;
}

/* Sidebar selection label - brown with white text */
.sp-selection-label {
  padding: 10px 20px;
  background: #3E2318;
  color: #FAF8F5;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
}

/* Clear filters button - positioned on the right */
.sp-clear-filters-btn {
  margin-left: auto;
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #C73314;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.sp-clear-filters-btn:hover {
  text-decoration: underline;
}

/* ========================================
   FILTER DROPDOWNS (Medium, Technique, Color)
   ======================================== */

.sp-filter-dropdowns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-filter-dropdown {
  position: relative;
}

.sp-filter-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 120px;
}

.sp-filter-dropdown-btn:hover:not(:disabled) {
  border-color: #aaa;
  background: #eee;
  color: #666;
}

.sp-filter-dropdown-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Selected state - brown background with white text */
.sp-filter-dropdown.has-value .sp-filter-dropdown-btn {
  border-color: #3E2318;
  background: #3E2318;
  color: #FAF8F5;
}

.sp-filter-dropdown.has-value .sp-filter-dropdown-btn:hover:not(:disabled) {
  background: #5a3a2d;
  border-color: #5a3a2d;
}

.sp-filter-dropdown.has-value .sp-filter-dropdown-btn svg {
  stroke: #FAF8F5;
}

.sp-filter-dropdown-btn svg {
  width: 14px;
  height: 14px;
  margin-left: auto;
  transition: transform 0.2s;
  stroke: #888;
}

.sp-filter-dropdown.open .sp-filter-dropdown-btn svg {
  transform: rotate(180deg);
}

.sp-filter-dropdown-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* Dropdown Menu */
.sp-filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-width: 300px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(62, 35, 24, 0.15);
  z-index: 100;
  animation: dropdownFadeIn 0.15s ease-out;
  overflow: hidden;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sp-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sp-dropdown-header button {
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: #C73314;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

.sp-dropdown-header button:hover {
  text-decoration: underline;
}

.sp-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
}

.sp-dropdown-list::-webkit-scrollbar {
  width: 6px;
}

.sp-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}

.sp-dropdown-list::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.sp-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 14px;
  color: #444;
}

.sp-dropdown-item:hover {
  background: #f5f5f5;
}

.sp-dropdown-item.selected {
  background: #fef7f6;
  color: #C73314;
  font-weight: 500;
}

.sp-dropdown-item span:first-child {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.sp-dropdown-count {
  font-size: 12px;
  color: #999;
  font-weight: 500;
  flex-shrink: 0;
}

.sp-dropdown-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  color: #888;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
}

.sp-dropdown-back:hover {
  background: #f5f5f5;
  color: #666;
}

.sp-dropdown-back svg {
  width: 14px;
  height: 14px;
}

/* ========================================
   MODAL BODY LAYOUT
   ======================================== */

.style-picker-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ========================================
   SIDEBAR
   ======================================== */

.style-picker-sidebar {
  width: 260px;
  min-width: 260px;
  border-right: 1px solid var(--color-border-light);
  overflow-y: auto;
  flex-shrink: 0;
  background: #fafafa;
}

.style-picker-sidebar::-webkit-scrollbar {
  width: 6px;
}

.style-picker-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.style-picker-sidebar::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

/* Search */
.sp-search {
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.sp-search-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 10px 14px;
  width: 100%;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.sp-search-input:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(62, 35, 24, 0.2);
}

.sp-search-input svg {
  width: 16px;
  height: 16px;
  color: #999;
  flex-shrink: 0;
}

.sp-search-input input {
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  width: 100%;
  color: #333;
}

.sp-search-input input::placeholder {
  color: #999;
}

/* Facets Container */
.sp-facets {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

/* ========================================
   TOP-LEVEL NAV ITEMS
   ======================================== */

.sp-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 14px 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
  border-left: 3px solid transparent;
}

.sp-nav-item:hover {
  background-color: rgba(62, 35, 24, 0.04);
}

.sp-nav-item.active {
  background-color: rgba(62, 35, 24, 0.06);
  border-left-color: #C73314;
}

.sp-nav-item-label {
  font-size: 15px;
  font-weight: 500;
  color: #444;
  transition: color 0.15s ease;
}

.sp-nav-item.active .sp-nav-item-label {
  color: #3E2318;
  font-weight: 600;
}

.sp-nav-item-count {
  font-size: 13px;
  color: #999;
  font-weight: 500;
}

.sp-nav-item.active .sp-nav-item-count {
  color: #3E2318;
}

/* ========================================
   EXPLORE CATEGORIES
   ======================================== */

.sp-category-divider {
  height: 1px;
  background: #e5e5e5;
  margin: 8px 16px;
}

.sp-category {
  border-bottom: none;
}

.sp-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px 20px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
  position: relative;
}

.sp-category-header:hover {
  background-color: rgba(62, 35, 24, 0.04);
}

/* Active category header - has red accent bar */
.sp-category-header.active {
  background-color: rgba(62, 35, 24, 0.08);
}

.sp-category-header.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #C73314;
  border-radius: 0 2px 2px 0;
}

.sp-category-header.active h4 {
  color: #3E2318;
  font-weight: 600;
}

.sp-category-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sp-category-header-left svg {
  width: 14px;
  height: 14px;
  min-width: 14px;
  stroke: #8a7a6d;
  transition: transform 0.2s ease;
}

.sp-category-header-left svg.sp-category-chevron {
  cursor: pointer;
  border-radius: 4px;
}

.sp-category-header-left svg.sp-category-chevron:hover {
  background: rgba(62, 35, 24, 0.1);
}

.sp-category.open .sp-category-header-left svg {
  transform: rotate(90deg);
}

.sp-category-header-left h4 {
  font-size: 14px;
  font-weight: 500;
  color: #555;
  margin: 0;
  white-space: nowrap;
  cursor: pointer;
}

.sp-category-header-left h4:hover {
  color: #3E2318;
}

.sp-category-header .sp-category-count {
  font-size: 12px;
  font-weight: 500;
  color: #aaa;
  margin-left: 12px;
  flex-shrink: 0;
  cursor: pointer;
}

.sp-category-header .sp-category-count:hover {
  color: #3E2318;
}

.sp-category-items {
  display: none;
  padding: 0 0 4px 0;
}

.sp-category.open .sp-category-items {
  display: block;
}

/* Nested nav items (art mediums inside categories) */
.sp-nav-item-nested {
  padding: 10px 16px 10px 44px;
}

.sp-nav-item-nested .sp-nav-item-label {
  font-size: 13px;
}

.sp-nav-item-nested .sp-nav-item-count {
  font-size: 12px;
}

/* ========================================
   GRID AREA
   ======================================== */

.style-picker-grid-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--color-surface);
}

.sp-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sp-results-count {
  font-size: 14px;
  color: var(--color-text-muted);
}

.sp-grid-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sp-reset-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.sp-reset-btn:hover {
  color: var(--color-text-primary);
}

/* ========================================
   GRID DENSITY SLIDER
   ======================================== */

.sp-density-slider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--color-tan-10);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}

.sp-density-slider svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.sp-density-slider input[type="range"] {
  width: 80px;
  height: 4px;
  cursor: pointer;
  accent-color: var(--color-brown);
}

/* Add density-5 class for 5-column grid */
.sp-grid.density-5 { grid-template-columns: repeat(5, 1fr); gap: 8px; }


/* ========================================
   GRID DENSITY SELECTOR
   ======================================== */

.sp-density-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-tan-10);
  padding: 4px;
  border-radius: 8px;
}

.sp-density-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.sp-density-btn:hover {
  background: var(--color-tan-20);
}

.sp-density-btn.active {
  background: #3E2318;
}

.sp-density-btn .density-dot {
  width: 6px;
  height: 6px;
  background: var(--color-text-muted);
  border-radius: 2px;
}

.sp-density-btn.active .density-dot {
  background: #FAF8F5;
}

/* ========================================
   STYLE GRID
   ======================================== */

.sp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  overflow: hidden;            /* iOS: prevent children from bleeding outside grid */
}

.sp-grid.density-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.sp-grid.density-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sp-grid.density-4 { grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sp-grid.density-5 { grid-template-columns: repeat(5, 1fr); gap: 12px; }
.sp-grid.density-6 { grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sp-grid.density-7 { grid-template-columns: repeat(7, 1fr); gap: 8px; }
.sp-grid.density-8 { grid-template-columns: repeat(8, 1fr); gap: 6px; }
.sp-grid.density-9 { grid-template-columns: repeat(9, 1fr); gap: 6px; }

/* ========================================
   STYLE CARD
   ======================================== */

.sp-card {
  position: relative;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;              /* iOS Safari: prevent grid children from overflowing tracks */
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(62, 35, 24, 0.08);
}

.sp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(62, 35, 24, 0.15);
}

/* Image wrapper - takes over the aspect-ratio + overflow from the old .sp-card */
.sp-card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.sp-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;             /* iOS: prevent inline image spacing issues */
  z-index: 1;
}

.sp-card.selected {
  box-shadow: 0 0 0 3px var(--color-accent);
}

/* Style name label below the image */
.sp-card-name {
  font-family: var(--font-serif, 'Libre Baskerville', serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary, #3E2318);
  padding: 10px 10px 8px 10px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Hide names at high densities where cards are too small */
.sp-grid.density-6 .sp-card-name,
.sp-grid.density-7 .sp-card-name,
.sp-grid.density-8 .sp-card-name,
.sp-grid.density-9 .sp-card-name {
  display: none;
}

/* Strip card chrome at high densities - back to image-only tiles */
.sp-grid.density-6 .sp-card,
.sp-grid.density-7 .sp-card,
.sp-grid.density-8 .sp-card,
.sp-grid.density-9 .sp-card {
  background: none;
  box-shadow: none;
  border-radius: 8px;
}

.sp-grid.density-6 .sp-card-img-wrap,
.sp-grid.density-7 .sp-card-img-wrap,
.sp-grid.density-8 .sp-card-img-wrap,
.sp-grid.density-9 .sp-card-img-wrap {
  border-radius: 8px;
}
/* Scale down name text at density 5 */
.sp-grid.density-5 .sp-card-name {
  font-size: 12px;
  padding: 6px 6px 4px 6px;
  -webkit-line-clamp: 2;
}

/* ========================================
   CARD OVERLAY CONTROLS
   ======================================== */

.sp-card-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.9);
  border: 2px solid var(--color-tan-40);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s;
  opacity: 0;
}

.sp-card:hover .sp-card-checkbox,
.sp-card.selected .sp-card-checkbox {
  opacity: 1;
}

.sp-card-checkbox:hover {
  background: white;
  border-color: var(--color-accent);
}

.sp-card-checkbox.checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.sp-card-checkbox svg {
  width: 14px;
  height: 14px;
  color: white;
  opacity: 0;
}

.sp-card-checkbox.checked svg {
  opacity: 1;
}

.sp-card-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s;
  opacity: 0;
}

.sp-card:hover .sp-card-heart,
.sp-card-heart.favorited {
  opacity: 1;
}

.sp-card-heart:hover {
  background: white;
  transform: scale(1.1);
}

.sp-card-heart svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  transition: all 0.15s;
}

.sp-card-heart:hover svg {
  color: #E53E3E;
}

.sp-card-heart.favorited svg {
  color: #E53E3E;
  fill: #E53E3E;
}

.sp-card-kebab {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s;
  opacity: 0;
}

.sp-card:hover .sp-card-kebab {
  opacity: 1;
}

.sp-card-kebab:hover {
  background: white;
}

.sp-card-kebab svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
}

/* ========================================
   KEBAB DROPDOWN MENU
   ======================================== */

.sp-kebab-menu {
  position: fixed;
  width: 200px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(62, 35, 24, 0.2);
  z-index: 1050;
  overflow: hidden;
  animation: menuFadeIn 0.15s ease-out;
}
@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.sp-kebab-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-kebab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sp-kebab-menu-item:hover {
  background: var(--color-tan-10);
  color: var(--color-text-primary);
}

.sp-kebab-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sp-kebab-menu-item.danger {
  color: #C53030;
}

.sp-kebab-menu-item.danger:hover {
  background: #FFF5F5;
}

.sp-kebab-menu-divider {
  height: 1px;
  background: var(--color-border-light);
  margin: 4px 0;
}

/* ========================================
   STYLE DETAIL OVERLAY
   ======================================== */

.style-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(62, 35, 24, 0.7);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlayFadeIn 0.2s ease-out;
}

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

.style-detail-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(62, 35, 24, 0.3);
  animation: modalSlideIn 0.25s ease-out;
  display: flex;
  flex-direction: column;
  position: relative;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.style-detail-floating-btns {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.style-detail-floating-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(62, 35, 24, 0.15);
}

.style-detail-floating-btn:hover {
  background: var(--color-tan-10);
  transform: scale(1.05);
}

.style-detail-floating-btn svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary);
}

.style-detail-floating-btn.heart svg {
  color: var(--color-text-muted);
}

.style-detail-floating-btn.heart:hover svg {
  color: #E53E3E;
}

.style-detail-floating-btn.heart.favorited svg {
  color: #E53E3E;
  fill: #E53E3E;
}

.style-detail-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.style-detail-info {
  width: 280px;
  min-width: 280px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border-light);
  overflow-y: auto;
}

.style-detail-images {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--color-tan-10);
  display: flex;
  flex-direction: column;
}

.style-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  flex: 1;
}

.style-detail-grid-id {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 16px;
  letter-spacing: 0.5px;
}

.style-detail-grid-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
}

.style-detail-grid-item:hover {
  transform: scale(1.03);
}

.style-detail-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-detail-name {
  font-family: 'Domine', var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: #C53D2E;
  margin-bottom: 20px;
  line-height: 1.25;
}

.style-detail-description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  flex: 1;
}

.style-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

.style-detail-btn-primary {
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: #C53D2E;
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.15s;
}

.style-detail-btn-primary:hover {
  background: #A82A10;
}

.style-detail-btn-primary.remove {
  background: #C53030;
}

.style-detail-btn-secondary {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--color-border-medium);
  background: white;
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.15s;
}

.style-detail-btn-secondary:hover {
  background: var(--color-tan-10);
}

.style-detail-admin {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

.style-detail-admin-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.style-detail-admin-btn {
  padding: 10px 16px;
  border: 1px solid var(--color-border-medium);
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.style-detail-admin-btn:hover {
  background: var(--color-tan-10);
}

.style-detail-admin-btn.danger {
  border-color: #FEB2B2;
  color: #C53030;
}

.style-detail-admin-btn.danger:hover {
  background: #FFF5F5;
}

.style-detail-admin-btn.featured {
  border-color: #F6AD55;
  background: #FFFAF0;
  color: #C05621;
}

.style-detail-admin-btn.featured:hover {
  background: #FFF5E6;
}

/* ========================================
   IMAGE VIEWER LIGHTBOX
   ======================================== */

.image-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: overlayFadeIn 0.2s ease-out;
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 10;
}

.image-viewer-close:hover {
  background: rgba(255,255,255,0.2);
}

.image-viewer-close svg {
  width: 24px;
  height: 24px;
  color: white;
}

.image-viewer-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 60px 80px;
  position: relative;
}

.image-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 10;
}

.image-viewer-nav:hover {
  background: rgba(255,255,255,0.2);
}

.image-viewer-nav svg {
  width: 24px;
  height: 24px;
  color: white;
}

.image-viewer-nav.prev { left: 20px; }
.image-viewer-nav.next { right: 20px; }

.image-viewer-container {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-viewer-container img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.image-viewer-footer {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.image-viewer-dots {
  display: flex;
  gap: 8px;
}

.image-viewer-dot {
  width: 10px;
  height: 10px;
  border: none;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
}

.image-viewer-dot:hover {
  background: rgba(255,255,255,0.5);
}

.image-viewer-dot.active {
  background: white;
}

.image-viewer-counter {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

/* ========================================
   MODAL FOOTER
   ======================================== */

.style-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
  background: white;
}

.sp-selection-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sp-selection-count {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.sp-selection-count strong {
  color: var(--color-accent);
}

.sp-selected-previews {
  display: flex;
  gap: 4px;
}

.sp-selected-preview {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid var(--color-accent);
}

.sp-selected-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-footer-actions {
  display: flex;
  gap: 12px;
}

.sp-cancel-btn {
  padding: 10px 24px;
  border: 1px solid var(--color-border-medium);
  background: white;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.sp-cancel-btn:hover {
  background: var(--color-tan-10);
}

.sp-done-btn {
  padding: 10px 24px;
  border: none;
  background: var(--color-accent);
  font-size: 14px;
  font-weight: 500;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.sp-done-btn:hover {
  background: var(--color-accent-hover, #A82A10);
}

/* ========================================
   LOAD MORE BUTTON
   ======================================== */

.sp-load-more {
  display: flex;
  justify-content: center;
  padding: 24px 0 16px;
}

.sp-load-more-btn {
  padding: 12px 32px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}

.sp-load-more-btn:hover {
  border-color: #3E2318;
  background: #faf8f5;
  color: #3E2318;
}

/* ========================================
   LOADING & ERROR STATES
   ======================================== */

.sp-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.sp-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-tan-20);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.sp-error {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  text-align: center;
}

.sp-error p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.sp-error button {
  padding: 10px 20px;
  border: 1px solid var(--color-border-medium);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1100px) {
  .sp-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .sp-grid { grid-template-columns: repeat(3, 1fr); }
  .style-picker-sidebar { display: none; }
  .sp-density-selector { display: none; }
  .sp-maximize-btn { display: none; }
  .sp-filter-dropdowns { display: none; }
  
  .style-detail-content { flex-direction: column; }
  .style-detail-info {
    width: 100%;
    min-width: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
    padding: 24px 20px;
  }
}

@media (max-width: 600px) {
  .style-picker-header { padding: 16px 20px; }
  .style-picker-tabs { padding: 12px 16px; overflow-x: auto; }
  .style-picker-tab { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
  .style-picker-grid-area { padding: 16px; }
  .sp-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .style-picker-footer { flex-direction: column; gap: 12px; padding: 16px; }
  .sp-footer-actions { width: 100%; }
  .sp-cancel-btn, .sp-done-btn { flex: 1; }
}
