/* Components: buttons, cards, builder, cart, faq, toast */

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #1a1208;
}

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

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.btn-dark {
  background: #1a1208;
  color: var(--accent-2);
}

.btn-block {
  width: 100%;
}

.cart-button {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  cursor: pointer;
}

.cart-button:hover {
  border-color: var(--accent);
}

.input {
  width: 100%;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  font-size: 1rem;
  font-family: var(--font-body);
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 48px;
}

.feature-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.feature-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 122, 26, 0.12);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  margin-bottom: 16px;
}

.feature-card p {
  color: var(--muted);
  margin: 0;
}

/* Module filters + grid */
.module-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.filter-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.filter-btn.active,
.filter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.module-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.module-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.module-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.module-card p {
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.module-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-price {
  font-family: var(--font-mono);
  font-weight: 700;
}

.small-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.small-btn:hover {
  background: var(--accent);
  color: #1a1208;
}

/* Builder */
.builder {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  margin-top: 40px;
  align-items: start;
}

.builder-step {
  margin-bottom: 32px;
}

.builder-step small {
  color: var(--muted);
  font-weight: 400;
}

.finish-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.finish-swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
}

.finish-swatch.selected {
  border-color: var(--accent);
}

.swatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.slot-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.slot-option {
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-size: 0.9rem;
}

.slot-option.selected {
  border-color: var(--accent);
  background: rgba(255, 122, 26, 0.08);
}

.slot-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.slot-option span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.builder-summary {
  position: sticky;
  top: 90px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.summary-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  margin-bottom: 18px;
  min-height: 180px;
  transition: background 0.3s;
}

.preview-slot {
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  min-height: 64px;
  text-align: center;
  padding: 4px;
}

.preview-slot.filled {
  border-style: solid;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.35);
  color: var(--accent-2);
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 18px;
  font-size: 1.1rem;
}

.summary-total strong {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.4rem;
}

/* Specs */
.spec-table {
  width: 100%;
  max-width: 820px;
  margin: 40px auto 0;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
}

.spec-table th {
  color: var(--muted);
  font-weight: 600;
  width: 38%;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* FAQ */
.faq-list {
  margin-top: 36px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-question {
  width: 100%;
  background: none;
  border: 0;
  color: var(--text);
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 20px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq-question::after {
  content: "+";
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.3rem;
}

.faq-item.open .faq-question::after {
  content: "-";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: var(--muted);
}

.faq-answer p {
  padding-bottom: 20px;
  margin: 0;
}

/* Signup */
.signup-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 24px auto 0;
}

.signup-form .input {
  background: #fff;
  color: #1a1208;
  border-color: transparent;
}

.form-message {
  margin-top: 14px;
  font-weight: 700;
  min-height: 1.6em;
}

/* Cart drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 90;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 100%);
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  transform: none;
}

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.cart-head h3 {
  margin: 0;
}

.cart-close {
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.cart-items {
  list-style: none;
  margin: 0;
  padding: 0 24px;
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}

.cart-item-detail {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 8px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}

.remove-btn {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.85rem;
}

.cart-empty {
  color: var(--muted);
  padding: 30px 0;
  text-align: center;
}

.cart-foot {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}

.cart-note {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  margin: 10px 0 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 120px);
  background: var(--bg-3);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 22px;
  border-radius: var(--radius);
  transition: transform 0.3s ease;
  z-index: 200;
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .builder {
    grid-template-columns: 1fr;
  }

  .builder-summary {
    position: static;
  }

  .signup-form {
    flex-direction: column;
  }
}
