/* ========================================
   KOSHI TECH - MAIN STYLESHEET
   Design System & Component Styles
   ======================================== */

/* THEME TOKENS */
:root {
  /* Colors */
  --bg: #0a0a0a;
  --panel: #111;
  --muted: #cfcfcf;
  --text: #f5f5f5;
  --line: #222;
  --brand: #7c3aed;
  --brand-2: #a78bfa;
  --brand-light: rgba(124, 58, 237, 0.15);
  --brand-border: rgba(124, 58, 237, 0.35);

  /* Shadows */
  --shadow: 0 10px 30px rgba(124, 58, 237, 0.25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 60px rgba(124, 58, 237, 0.3);

  /* Radius */
  --radius: 18px;
  --radius-sm: 14px;
  --radius-lg: 26px;

  /* Layout */
  --max: 1200px;
  --btn-pad: 0.85rem 1.15rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* LIGHT THEME OVERRIDES */
html[data-theme="light"] {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --muted: #555;
  --text: #0b0b0c;
  --line: #e5e5e7;
  --shadow: 0 10px 30px rgba(124, 58, 237, 0.18);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .muted {
  color: #666;
}

html[data-theme="light"] footer {
  color: #666;
}

html[data-theme="light"] .hero::before {
  background: radial-gradient(60% 60% at 50% 0%, rgba(124, 58, 237, 0.18), transparent 60%);
}

html[data-theme="light"] .card {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0));
}

html[data-theme="light"] .btn.ghost {
  border-color: var(--line);
}

html[data-theme="light"] ul.clean li {
  color: #333;
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-2);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   LAYOUT
   ======================================== */

.container {
  max-width: var(--max);
  width: min(100%, var(--max));
  margin-inline: auto;
  padding-inline: clamp(12px, 4vw, 24px);
}

section {
  padding: 72px 0;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1 {
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.1;
  margin: 0;
  font-weight: 800;
}

h2 {
  font-size: clamp(22px, 4vw, 32px);
  margin: 0 0 8px;
  font-weight: 700;
}

h3 {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 1.25rem;
}

p {
  margin: 10px 0;
}

.muted {
  color: #bbb;
}

/* ========================================
   COMPONENTS
   ======================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--brand);
  padding: var(--btn-pad);
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--transition-fast), filter var(--transition-fast), background var(--transition-fast);
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.ghost {
  background: transparent;
  border: 1px solid #333;
  box-shadow: none;
}

.btn.ghost:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.btn-secondary {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* Chips */
.chip {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  border: 2px solid var(--brand);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.3);
}

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  border-color: var(--brand-border);
}

/* Tiles */
.tile {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: border-color var(--transition-normal), transform var(--transition-normal);
}

.tile:hover {
  border-color: var(--brand-border);
  transform: translateY(-2px);
}

/* Grids */
.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(1.2) blur(6px);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}

nav {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding-block: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 600;
}

.logo {
  height: 34px;
  width: 34px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.3), rgba(167, 139, 250, 0.15));
  display: grid;
  place-items: center;
  border: 1px solid var(--brand-border);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.95rem;
}

.nav-links a {
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width var(--transition-fast);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10% -10% 40% -10%;
  background: radial-gradient(60% 60% at 50% 0%, rgba(124, 58, 237, 0.25), transparent 60%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2rem;
  align-items: center;
  padding-block: 80px;
  position: relative;
  z-index: 1;
}

.hero .thumb {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.hero .row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.hero .row img {
  height: 110px;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  transition: transform var(--transition-fast);
}

.hero .row img:hover {
  transform: scale(1.05);
}

/* ========================================
   PRICING SECTION
   ======================================== */

.pricing .plan {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 420px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.01));
  transition: border-color var(--transition-normal), transform var(--transition-normal);
}

.pricing .plan:hover {
  border-color: rgba(124, 58, 237, 0.6);
  transform: translateY(-3px);
}

.pricing .plan.featured {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.08), rgba(0, 0, 0, 0.02));
}

.pricing .plan h3 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.pricing .plan p.muted {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.price {
  font-size: 2rem;
  font-weight: 800;
  margin: 12px 0 16px;
  color: var(--brand-2);
}

ul.clean {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  flex-grow: 1;
}

ul.clean li {
  margin: 8px 0;
  color: #ddd;
  padding-left: 1.5rem;
  position: relative;
}

ul.clean li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

.pricing .plan .btn {
  align-self: center;
  margin-top: auto;
  margin-bottom: 10px;
  width: 100%;
  max-width: 200px;
}

/* ========================================
   GALLERY
   ======================================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 700px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.shot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition-normal);
}

.shot:hover {
  transform: translateY(-4px);
}

.shot img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.shot:hover img {
  transform: scale(1.05);
}

/* ========================================
   FAQ
   ======================================== */

details {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.02);
  transition: border-color var(--transition-normal);
}

details:hover {
  border-color: var(--brand-border);
}

details + details {
  margin-top: 12px;
}

details[open] {
  border-color: var(--brand);
}

summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px;
  user-select: none;
}

summary:hover {
  color: var(--brand-2);
}

details p {
  margin-top: 12px;
  padding-left: 8px;
}

/* ========================================
   FORMS
   ======================================== */

form {
  display: grid;
  gap: 12px;
}

@media (min-width: 700px) {
  form {
    grid-template-columns: 1fr 1fr;
  }
}

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  background: color-mix(in oklab, var(--panel) 96%, transparent);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

textarea {
  grid-column: 1/-1;
  min-height: 120px;
  resize: vertical;
  max-height: 40dvh;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a78bfa' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-full {
  grid-column: 1/-1;
}

.submit {
  grid-column: 1/-1;
}

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

footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  color: #aaa;
  font-size: 0.9rem;
}

/* ========================================
   CONFIGURATOR SPECIFIC STYLES
   ======================================== */

.config-builder {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}

.component-selector {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.component-selector h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.component-options {
  display: grid;
  gap: 10px;
}

.component-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.component-card:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.component-card.selected {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: var(--shadow);
}

.bestseller-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fbbf24;
  color: #78350f;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.component-card img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.component-info h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.component-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.component-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-2);
}

.config-summary {
  position: sticky;
  top: 80px;
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.config-summary h3 {
  margin-bottom: 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--brand);
  display: flex;
  justify-content: space-between;
  font-size: 1.4rem;
  font-weight: 800;
}

.summary-total .price {
  color: var(--brand);
}

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

@media (max-width: 1240px) {
  nav {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-actions {
    width: 100%;
    justify-content: center;
  }

  .btn.cta {
    width: 100%;
    max-width: 520px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    padding-block: 56px;
  }

  .hero .container > div:first-child {
    text-align: center;
  }

  .hero .container .btn {
    width: 100%;
    max-width: 420px;
  }

  .hero .row img {
    height: 90px;
  }

  .hero .thumb {
    height: 340px;
  }

  .grid.cols-4 {
    grid-template-columns: 1fr 1fr;
  }

  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .config-builder {
    grid-template-columns: 1fr;
  }

  .config-summary {
    position: static;
  }
}

@media (max-width: 560px) {
  .grid.cols-4,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 0.8rem 1rem;
  }

  form {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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