/* ============================================================
   Catalog — Quiet Luxury Light Theme (fixed contrast)
   ============================================================ */
#dl-root {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1a1a1f;
  background: #fdfbf8;
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 40px;
  overflow-x: hidden;
}
#dl-root * { box-sizing: border-box; max-width: 100%; }

.dl-header { text-align: center; margin-bottom: 24px; padding-top: 20px; }
.dl-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 40px; font-weight: 400; font-style: italic;
  color: #1a1a1f; margin-bottom: 8px;
}
.dl-subtitle { font-size: 12px; color: #666; letter-spacing: 1px; text-transform: uppercase; }

.dl-layout { display: flex; gap: 40px; align-items: flex-start; }
.dl-sidebar {
  flex: 0 0 230px; position: sticky; top: 80px;
  background: #fff; border: 1px solid #e5e2dc;
}
.dl-sidebar-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px; font-weight: 400; padding: 18px 20px;
  border-bottom: 1px solid #e5e2dc; color: #1a1a1f;
}
.dl-content { flex: 1; min-width: 0; }

.dl-filter-group { padding: 16px 20px; border-bottom: 1px solid #eee; }
.dl-filter-label {
  display: block; font-size: 10px; color: #666;
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}

.dl-filter-input, .dl-price-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid #d5d0c8; background: #fff;
  font-size: 13px; color: #1a1a1f; outline: none;
  transition: border-color 0.3s;
}
.dl-filter-input:focus, .dl-price-input:focus { border-color: rgb(220,170,210); }
.dl-filter-input::placeholder, .dl-price-input::placeholder { color: #999; }
.dl-price-inputs { display: flex; gap: 8px; margin-bottom: 12px; }
.dl-price-input { flex: 1; text-align: center; }

/* Custom Select */
.dl-custom-select { position: relative; width: 100%; }
.dl-custom-select-trigger {
  width: 100%; padding: 10px 32px 10px 14px;
  border: 1px solid #d5d0c8; background: #fff;
  font-size: 13px; color: #1a1a1f; cursor: pointer;
  transition: border-color 0.3s; user-select: none; position: relative;
}
.dl-custom-select-trigger::after {
  content: ''; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid #666; transition: transform 0.3s;
}
.dl-custom-select.open .dl-custom-select-trigger::after { transform: translateY(-50%) rotate(180deg); }
.dl-custom-select.open .dl-custom-select-trigger { border-color: rgb(220,170,210); }
.dl-custom-select-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid #d5d0c8; border-top: none;
  max-height: 200px; overflow-y: auto; z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.dl-custom-select.open .dl-custom-select-dropdown { display: block; }
.dl-custom-select-option { padding: 10px 14px; font-size: 13px; color: #444; cursor: pointer; transition: background 0.2s; }
.dl-custom-select-option:hover { background: rgba(255,209,245,0.2); color: #1a1a1f; }
.dl-custom-select-option.active { background: rgba(255,209,245,0.25); color: #1a1a1f; font-weight: 500; }
.dl-custom-select-dropdown::-webkit-scrollbar { width: 3px; }
.dl-custom-select-dropdown::-webkit-scrollbar-thumb { background: #ccc; }

/* Toggle */
.dl-filter-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid #d5d0c8;
  background: #fff; cursor: pointer; transition: all 0.3s;
  user-select: none; margin-bottom: 10px;
}
.dl-filter-toggle:last-child { margin-bottom: 0; }
.dl-filter-toggle:hover { border-color: rgb(220,170,210); }
.dl-filter-toggle.active { border-color: rgb(220,170,210); background: rgba(255,209,245,0.15); }
.dl-toggle-switch {
  width: 38px; height: 20px; border-radius: 10px;
  background: #ccc; position: relative; transition: all 0.3s; flex-shrink: 0;
}
.dl-toggle-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: all 0.3s;
}
.dl-filter-toggle.active .dl-toggle-switch { background: rgb(255,209,245); }
.dl-filter-toggle.active .dl-toggle-switch::after { left: 20px; }
.dl-toggle-label { font-size: 13px; color: #444; }

/* Slider */
#dl-price-slider { margin: 16px 8px; }
.noUi-connect { background: rgb(255,209,245) !important; }
.noUi-horizontal .noUi-handle { width: 18px; height: 28px; right: -9px; top: -6px; }
.noUi-handle { border: 1px solid #d5d0c8; border-radius: 0; background: #fff; cursor: default; box-shadow: none; }
.noUi-target { background: #e8e5e0; border: none; border-radius: 0; }

/* Reset */
.dl-btn-reset {
  width: 100%; padding: 12px 16px;
  border: 1px solid #d5d0c8; background: #fff;
  cursor: pointer; font-size: 11px; color: #666;
  letter-spacing: 1px; text-transform: uppercase; font-weight: 500;
  transition: all 0.3s; margin: 16px 0;
}
.dl-btn-reset:hover { border-color: #1a1a1f; color: #1a1a1f; }

/* Grid */
.dl-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; margin-bottom: 40px; }
@media (max-width:1200px) { .dl-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width:900px) { .dl-layout { flex-direction: column; } .dl-sidebar { position: static; width: 100%; } .dl-grid { grid-template-columns: repeat(2,1fr); } .dl-layout { overflow-x: hidden; } }
@media (max-width:600px) { 
  .dl-grid { grid-template-columns: 1fr; } 
  #dl-root { padding: 0 16px; }
  .dl-card { max-width: 100%; width: 100%; }
}

/* Card */
.dl-card {
  position: relative; background: #fff; overflow: hidden;
  display: flex; flex-direction: column; transition: all 0.4s;
  max-width: 100%;
}
.dl-card-media {
  position: relative; width: 100%; height: 360px;
  background: #ffffff; overflow: hidden; flex-shrink: 0;
}
.dl-card-media img, .dl-card-media video { transition: transform 0.8s cubic-bezier(0.25,0.1,0.25,1); max-width: 100%; }
.dl-card:hover .dl-card-media img, .dl-card:hover .dl-card-media video { transform: scale(1.05); }

.dl-media-slider { display: flex; height: 100%; }
.dl-media-item { flex: 0 0 100%; width: 100%; height: 100%; }
.dl-media-img { width: 100%; height: 100%; object-fit: contain; max-width: 100%; }
.dl-media-video { width: 100%; height: 100%; object-fit: cover; max-width: 100%; }

.dl-media-nav { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 9; }
.dl-media-dot { width: 6px; height: 6px; border-radius: 50%; background: #ccc; cursor: pointer; }
.dl-media-dot.active { background: #1a1a1f; }

.dl-media-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.9); border: none; width: 32px; height: 32px;
  display: none; align-items: center; justify-content: center; cursor: pointer;
  z-index: 10; color: #1a1a1f; font-size: 12px;
}
.dl-card:hover .dl-media-arrow { display: flex; }
.dl-media-arrow.prev { left: 8px; } .dl-media-arrow.next { right: 8px; }

/* Favorite */
.dl-fav-btn {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border: none;
  background: rgba(255,255,255,0.9);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: all 0.3s; opacity: 0;
}
.dl-card:hover .dl-fav-btn, .dl-fav-btn.active { opacity: 1; }
.dl-fav-btn:hover { background: #fff; }
.dl-fav-btn svg { width: 16px; height: 16px; }

.dl-card-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; opacity: 0;
  transition: opacity 0.4s; pointer-events: none; z-index: 10;
}
.dl-card:hover .dl-card-overlay { opacity: 1; pointer-events: all; }
.dl-btn-add-cart {
  width: 100%; padding: 12px 20px;
  background: #1a1a1f; color: #fff; border: none;
  cursor: pointer; font-size: 10px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
}
.dl-btn-add-cart:hover { background: #333; }

.dl-card-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 4px; z-index: 6; }
.dl-badge { padding: 4px 10px; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #fff; display: inline-block; }

.dl-card-body { padding: 20px 18px 18px; display: flex; flex-direction: column; }
.dl-card-name {
  font-size: 13px; color: #1a1a1f; margin-bottom: 6px; min-height: 40px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.5;
}
.dl-card-article { font-size: 11px; color: #999; margin-bottom: 10px; letter-spacing: 0.5px; }
.dl-card-price { font-size: 16px; font-weight: 600; color: #1a1a1f; }

/* Pagination */
.dl-pagination { display: flex; justify-content: center; gap: 4px; margin: 32px 0 0; }
.dl-page-btn {
  padding: 10px 16px; border: 1px solid #d5d0c8; background: #fff;
  cursor: pointer; font-size: 12px; color: #666; font-weight: 500; transition: all 0.3s;
}
.dl-page-btn:hover { border-color: #1a1a1f; color: #1a1a1f; }
.dl-page-btn.active { background: #1a1a1f; color: #fff; border-color: #1a1a1f; }
.dl-page-btn:disabled { opacity: 0.3; cursor: default; }

.dl-state { text-align: center; padding: 80px 40px; color: #666; background: #f5f3ef; border: 1px solid #e5e2dc; }

/* ===== MODAL ===== */
.dl-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 99999; overflow-x: hidden; }
.dl-modal.active { display: flex; align-items: center; justify-content: center; animation: modalFade 0.3s; }
.dl-modal-content { background: #fff; width: 100%; height: 100%; position: relative; display: flex; flex-direction: column; }
.dl-modal-close { position: fixed; top: 20px; right: 24px; width: 40px; height: 40px; border: none; background: transparent; font-size: 28px; color: #666; z-index: 100000; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.dl-modal-close:hover { color: #1a1a1f; }
.dl-modal-body { display: flex; height: 100%; overflow: hidden; }
.dl-modal-media { flex: 1; display: flex; align-items: center; justify-content: center; /* background: #f5f3ef; */ position: relative; padding: 60px 40px 40px; }
.dl-modal-media-main { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.dl-modal-media-main img, .dl-modal-media-main video { max-width: 100%; max-height: 100%; object-fit: contain; }
.dl-modal-media-thumbs { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; padding: 10px 14px; background: rgba(255,255,255,0.95); max-width: 90%; overflow-x: auto; border: 1px solid #e5e2dc; }
.dl-modal-thumb { flex: 0 0 56px; height: 56px; border: 1px solid #ddd; overflow: hidden; cursor: pointer; }
.dl-modal-thumb:hover { border-color: #999; }
.dl-modal-thumb.active { border-color: rgb(220,170,210); box-shadow: 0 0 0 1px rgb(220,170,210); }
.dl-modal-thumb img, .dl-modal-thumb video { width: 100%; height: 100%; object-fit: cover; }
.dl-modal-info { flex: 0 0 440px; background: #fff; overflow-y: auto; padding: 60px 40px 40px; display: flex; flex-direction: column; border-left: 1px solid #eee; }
.dl-modal-title { font-family: 'Playfair Display', Georgia, serif; font-size: 26px; font-weight: 400; font-style: italic; color: #1a1a1f; margin-bottom: 10px; }
.dl-modal-article { font-size: 12px; color: #999; margin-bottom: 28px; letter-spacing: 1px; }
.dl-modal-price { font-size: 28px; font-weight: 600; color: #1a1a1f; margin-bottom: 32px; }
.dl-modal-specs { border-top: 1px solid #eee; padding-top: 24px; margin-bottom: 32px; flex: 1; }
.dl-modal-spec-row { display: flex; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.dl-modal-spec-row:last-child { border-bottom: none; }
.dl-modal-spec-label { flex: 0 0 120px; font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.dl-modal-spec-value { flex: 1; font-size: 14px; color: #1a1a1f; font-weight: 500; }
.dl-modal-actions { display: flex; flex-direction: column; gap: 12px; position: sticky; bottom: 0; background: #fff; padding-top: 20px; border-top: 1px solid #eee; }
.dl-modal-btn { width: 100%; padding: 16px 24px; border: none; font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; transition: all 0.3s; }
.dl-modal-btn-primary { background: #1a1a1f; color: #fff; }
.dl-modal-btn-primary:hover { background: #333; }

.dl-modal-media-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.9); border: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; font-size: 14px; color: #1a1a1f; }
.dl-modal-media-prev { left: 16px; } .dl-modal-media-next { right: 16px; }

.dl-toast { position: fixed; top: 24px; right: 24px; background: #fff; border: 1px solid #e5e2dc; box-shadow: 0 8px 30px rgba(0,0,0,0.08); padding: 16px 44px 16px 20px; z-index: 999999; max-width: 320px; animation: toastIn 0.4s ease; }
.dl-toast.hiding { animation: toastOut 0.4s ease forwards; }
.dl-toast-message { font-size: 13px; color: #1a1a1f; margin-bottom: 6px; }
.dl-toast-meta { display: flex; gap: 12px; }
.dl-toast-cart-link { font-size: 11px; color: #888; text-decoration: underline; cursor: pointer; }
.dl-toast-close { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border: none; background: transparent; cursor: pointer; font-size: 16px; color: #999; display: flex; align-items: center; justify-content: center; }

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

@media (max-width: 768px) {
  #dl-root { margin: 20px auto; padding: 0 16px; overflow-x: hidden; }
  .dl-title { font-size: 32px; }
  .dl-card-media { height: 280px; }
  .dl-fav-btn { opacity: 1; }
  .dl-modal-body { flex-direction: column; overflow-y: auto; }
  .dl-modal-media { flex: 0 0 50vh; min-height: 280px; max-height: 50vh; padding: 50px 20px 20px; }
  .dl-modal-info { flex: 1; padding: 24px 20px 30px; border-left: none; border-top: 1px solid #eee; }
  .dl-modal-title { font-size: 22px; }
  .dl-modal-price { font-size: 24px; }
  .dl-card { overflow-x: hidden; }
}
@media (hover: none) {
  .dl-card-overlay { position: static; opacity: 1; pointer-events: all; margin-top: auto; }
  .dl-media-arrow { display: flex; }
  .dl-fav-btn { opacity: 1; }
}


/* Catalog page — light background */
body.catalog-page, body:has(#dl-root.catalog) { background: #f3f3f3 !important; overflow-x: hidden; }
/* Fallback for browsers without :has() — apply via direct selector since catalog.html only uses #dl-root for catalog */
.dl-page-catalog, .dl-page-catalog #dl-root { background: #f3f3f3 !important; }
#dl-root.catalog, #dl-root { background: #f3f3f3; }

/* Stock & Order badges — bordeaux for in-stock, black for on-order, white text */
.dl-badge-stock { background: #6b1234 !important; color: #fff !important; }
.dl-badge-order { background: #1a1a1f !important; color: #fff !important; }
