/* ============================================================
   COMPONENTS - N-Home Smart Home Builder (with Product Slider)
   ============================================================ */

/* Room Cards */
.room-card {
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.room-card:hover { 
  border-color: #374151; 
  background: #111827; 
}

.room-card-actions { 
  opacity: 0; 
  transition: opacity 0.15s ease; 
  pointer-events: none; 
}

.room-card:hover .room-card-actions { 
  opacity: 1; 
  pointer-events: auto; 
}

.room-card.active .room-card-actions { 
  opacity: 1; 
  pointer-events: auto; 
}

.room-card.active { 
  border-color: #0ea5e9; 
  background: #0f172a; 
}

.room-card.tier-selected { 
  border-color: #10b981; 
  background: rgba(16, 185, 129, 0.1); 
}

.room-card.tier-selected .room-title { 
  color: #10b981; 
}

.room-title { 
  font-weight: 600; 
  font-size: 12px; 
}

.room-meta { 
  font-size: 11px; 
  color: #9ca3af; 
}

/* Add Room Button */
.add-room-btn {
  width: 100%;
  padding: 6px 8px;
  text-align: center;
  border: 1px solid #4b5563;
  background: transparent;
  color: #9ca3af;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  margin-top: 4px;
  transition: all 0.15s ease;
}

.add-room-btn:hover { 
  border-color: #0ea5e9; 
  color: #e5e7eb; 
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: #111827;
  border: 1px solid #374151;
  color: #9ca3af;
}

/* System Chips */
.system-chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid;
  margin-right: 4px;
  margin-top: 4px;
}

.system-chip.audio { 
  background: rgba(59, 130, 246, 0.1); 
  border-color: #3b82f6; 
  color: #3b82f6; 
}

.system-chip.lights { 
  background: rgba(16, 185, 129, 0.1); 
  border-color: #10b981; 
  color: #10b981; 
}

.system-chip.av { 
  background: rgba(245, 158, 11, 0.1); 
  border-color: #f59e0b; 
  color: #f59e0b; 
}

.system-chip.shades { 
  background: rgba(139, 92, 246, 0.1); 
  border-color: #8b5cf6; 
  color: #8b5cf6; 
}

.system-chip.control { 
  background: rgba(168, 85, 247, 0.1); 
  border-color: #a855f7; 
  color: #a855f7; 
}

/* Tier Grid */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tier-card {
  background-color: var(--nh-panel-bg);
  border: 1px solid var(--nh-border-subtle);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.tier-card:hover {
  border-color: var(--nh-tier-card-border-color);
  background: var(--nh-tier-card-bg-hover);
}

.tier-card.selected {
  border-color: var(--nh-tier-card-accent);
  background: var(--nh-tier-card-bg-selected);
}

.tier-card .tier-name {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 4px;
}

.tier-card .tier-price {
  font-size: 11px;
  color: #a5b4fc;
}


/* Summary Table */
.summary-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.summary-table thead tr {
  border-bottom: 1px solid #1f2937;
}

.summary-table th {
  text-align: left;
  padding: 6px 0;
}

.summary-table td {
  padding: 6px 0;
}

.summary-table tbody tr {
  border-bottom: 1px solid #1f2937;
}

/* ============================================================
   PRODUCT SLIDER STYLES
   ============================================================ */

/* Product Slider Container */
.product-slider-root {
  position: relative;
  overflow: hidden;
  padding: 6px 22px 6px 0; /* no left padding by default */
  margin-bottom: 12px;
}
.product-slider-root.has-start-padding {
  padding-left: 30px; /* only when we've scrolled */
}

.product-slider-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: scroll;
  scrollbar-width: none;     /* Firefox */
}

.product-slider-track::-webkit-scrollbar {
  display: none;             /* Chrome, Safari */
  height: 5px;
}

.product-slider-track::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 999px;
}

/* Product Card */
.product-card {
    background-color: var(--nh-panel-bg);
    border: 1px solid var(--nh-border-subtle);
    cursor: pointer;
    text-align: center;
    border-width: 1px;
    border-style: solid;
    border-image: initial;
    border-radius: 6px;
    padding: 12px;
    transition: 0.15s;
}

.product-card:hover {
  border-color: var(--nh-border-subtle);
  background: var(--nh-tier-card-bg-hover);
}

.product-card.selected {
  border-color: var(--nh-tier-card-accent);
  box-shadow: 0 0 0 1px rgba(14,165,233,0.5);
  background: var(--nh-tier-card-bg-selected);
}

.product-card-header {
  margin-bottom: 8px;
}

.product-card-title {
  font-weight: 600;
  font-size: 12px;
  color: #e5e7eb;
  margin-bottom: 4px;
}

.product-card-subtitle {
  font-size: 11px;
  color: #9ca3af;
  min-height: 26px;
}

.product-card-price {
  font-size: 11px;
  color: #a5b4fc;
  
}
.product-card.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  /* pointer-events stays ON so we can catch the click and show a modal */
}

.product-card-lock-message {
    margin-top: 6px;
    font-size: 9px;
    letter-spacing: 0.05em;
    border-radius: 999px;
    padding: 2px 6px;
    border: 1px solid #8b5cf6;
    color: #8b5cf6;
}
/* Variants */
.variant-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.variant-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #374151;
  color: #d1d5db;
  cursor: pointer;
  user-select: none;
  background: #020617;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.variant-pill:hover {
  border-color: #4b5563;
}

.variant-pill.selected {
  border-color: #0ea5e9;
  background: #0f172a;
  color: #e5e7eb;
}

/* Pill radio group */
.pill-group {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  cursor: pointer;
  gap: 4px;
    align-items: center;
  text-align: center;
}

.pill-sub {
  font-size: 8px;
  line-height: 1.2;
  opacity: 0.7;
  pointer-events: none;
}

/* Hide native radio, but keep it accessible */
.pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Active state */
.pill--active {
  background: #0f172a;
  border-color: #0ea5e9;
  color: #f9fafb;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.4);
}

/* Hover */
.pill:not(.pill--active):hover {
  border-color: #4b5563;
  background: #020617;
}


/* Quantity Controls */
.qty-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  background: #020617;
  border-radius: 999px;
  border: 1px solid #1f2937;
  padding: 2px 8px;
}

.qty-btn {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.qty-btn:hover {
  color: #e5e7eb;
}

.qty-value {
  min-width: 16px;
  text-align: center;
  font-size: 11px;
  color: #e5e7eb;
}

/* Navigation Arrows */
.product-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: rgba(15,23,42,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: #9ca3af;
  z-index: 2;
  opacity: 0;                  /* hidden by default */
  pointer-events: none;        /* can't click until visible */
  transition: opacity 0.25s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.product-slider-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

.product-slider-nav:hover {
  border-color: #374151;
  color: #e5e7eb;
  background: rgba(15,23,42,1);
}

.product-slider-nav.prev { 
  left: 4px; 
}

.product-slider-nav.next { 
  right: 4px; 
}

.product-slider-nav.disabled {
  opacity: 0.25;
  pointer-events: none;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 640px) {
  .product-slider-root {
    padding-inline: 8px;
  }
  
  .product-card {
    flex: 0 0 190px;
  }
}
/* ============================================================
   INLINE MODAL STYLES
   ============================================================ */

/* UNIVERSAL INLINE MODAL (replaces tab-modal) */
.inline-modal {
  position: absolute;
  display: none;
  z-index: 99999;
}

.inline-modal.visible {
  display: block;
}

.inline-modal-content {
  background: #1f1f1f;
  border: 1px solid #333;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  border-radius: 12px;
  padding: 16px;
  width: 260px;
  color: #fff;
}

.inline-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
}

.inline-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: 20px;
  line-height: 1;
}

.inline-modal-body {
  font-size: 14px;
  padding: 8px 0 14px 0;
  line-height: 1.35;
}

.inline-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.inline-modal-cancel,
.inline-modal-confirm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}

.inline-modal-cancel {
  background: #333;
  border: 1px solid #444;
  color: #ccc;
}

.inline-modal-confirm {
  background: #4f8cff;
  border: none;
  color: white;
}

/* ============================================================
   POPUP UNDER DISABLED TABS
   ============================================================ */

.tab-popover {
  position: absolute;
  z-index: 200;
  min-width: 260px;
  max-width: 320px;
  background: rgba(3, 7, 18, 0.98);
  border-radius: 10px;
  border: 1px solid #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
  padding: 14px 16px;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tab-popover.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tab-popover::before {
  /* Arrow pointing up to the tab */
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 7px 7px 7px;
  border-style: solid;
  border-color: transparent transparent #020617 transparent;
}

.tab-popover-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 12px;
}

.tab-popover-body {
  color: #9ca3af;
  margin-bottom: 12px;
  font-size: 12px;
}

.tab-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tab-popover button {
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 999px;
}

.tab-popover-cancel {
  background: transparent;
  border: 1px solid #1f2937;
  color: #cbd5f5;
}

.tab-popover-cancel:hover {
  background: rgba(15, 23, 42, 0.85);
}

.tab-popover-confirm {
  background: #0ea5e9;
  border: none;
  color: #020617;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.45);
}

.tab-popover-confirm:hover {
  background: #38cfff;
}
.system-tab.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: #6b7280;
  pointer-events: auto; /* so click triggers popover */
}

.system-tab.is-disabled:hover {
  color: #6b7280;
  background: transparent;
}

/* Lighting room panel (450px block) */
.lighting-room-card {
  max-width: 450px;
  width: 100%;
}

.lighting-room-card .card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.lighting-room-card .card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lighting-wall {
  border-top: 1px solid #111827;
  padding-top: 12px;
  margin-top: 12px;
}

.lighting-wall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.lighting-wall-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  color: #e5e7eb;
  font-size: 13px;
}

.lighting-wall-label {
  font-weight: 500;
}

.lighting-wall .chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.lighting-wall.open .chevron {
  transform: rotate(45deg);
}

.lighting-wall-body {
  display: none;
  margin-top: 10px;
  gap: 12px;
  align-items: center;
}
.lighting-wall.open .lighting-wall-body {
    display: flex;
    flex-direction: column;
}

/* Multi-gang wall plate (1–4 gangs) */
.wall-plate-icon {
  display: flex;
  gap: 6px;
  padding: 10px;
  background: #020617;
  border: 1px solid #374151;
  border-radius: 10px;
  min-height: 90px;
  align-items: center;
  justify-content: center;
}

/* Wrap plate + table */
.lighting-wall-icon-and-table {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wall-paddle {
  width: 28px;
  height: 72px;
  border-radius: 6px;
  background: #020617;
  border: 1px solid #4b5563;
}

.wall-plate-icon[data-gangs="1"] { width: 70px; }
.wall-plate-icon[data-gangs="2"] { width: 110px; }
.wall-plate-icon[data-gangs="3"] { width: 150px; }
.wall-plate-icon[data-gangs="4"] { width: 190px; }

.lighting-wall-table-wrapper {
  width: -webkit-fill-available;
  width: 100%;
  overflow-x: auto;
}

.lighting-wall-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.lighting-wall-table-wrapper th,
.lighting-wall-table-wrapper td {
  padding: 4px 4px;
  border-bottom: 1px solid #111827;
  text-align: left;
  white-space: nowrap;
}

.lighting-wall-table-wrapper th {
  color: #9ca3af;
  font-weight: 500;
  background: #020617;
}

.lighting-wall-table-wrapper tr:last-child td {
  border-bottom: none;
}

.lighting-room-card .tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: #111827;
  border: 1px solid #1f2937;
  color: #9ca3af;
}
.lighting-room-card .link-button {
  background: none;
  border: none;
  padding: 0;
  color: #4da3ff; /* or your accent color */
  font-size: 12px;
  cursor: pointer;
}

.lighting-room-card .link-button:hover {
  text-decoration: underline;
}

.lighting-room-card .link-danger {
  color: #ff6b81;
}
