/* Общие переменные для тем */
:root {
  --bg: #f5f5f5;
  --text: #222;
  --card-bg: #fff;
  --border: #ddd;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --nav-bg: #fff;
  --muted: #666;
}

body.dark {
  --bg: #1a1a2e;
  --text: #e0e0e0;
  --card-bg: #16213e;
  --border: #333;
  --accent: #60a5fa;
  --accent-dark: #3b82f6;
  --nav-bg: #0f0f1a;
  --muted: #999;
}

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

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

/* Навбар */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 40px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent);
}

#nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

#nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  transition: color 0.2s;
}

#nav-links a:hover {
  color: var(--accent);
}

#theme-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s;
}

#theme-btn:hover {
  border-color: var(--accent);
}

/* Секции */
section {
  padding: 60px 40px;
  max-width: 1000px;
  margin: 0 auto;
}

section h2 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

/* Герой */
#hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding-top: 80px;
  max-width: 1000px;
  margin: 0 auto;
}

.hero-text h1 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  line-height: 1.3;
}

.hero-text h1 span {
  color: var(--accent);
}

.hero-text p {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 25px;
  max-width: 420px;
}

.hero-photo {
  flex-shrink: 0;
}

.photo-placeholder {
  width: 260px;
  height: 320px;
  background: var(--card-bg);
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--muted);
}

/* Если вставите настоящее фото */
.hero-photo img {
  width: 260px;
  height: 320px;
  object-fit: cover;
  border-radius: 100px;
  border: 2px solid var(--border);
}

/* Кнопка */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* Навыки */
#skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.skill-card .icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.skill-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

/* Прогресс-бар */
.progress-bg {
  height: 6px;
  background: var(--border);
  border-radius: 10px;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  width: 0;
  transition: width 1s ease;
}

/* Проекты */
#projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.project-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.project-body {
  padding: 16px;
}

.project-body h3 {
  margin-bottom: 8px;
}

.project-body p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.project-body a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: bold;
}

.project-body a:hover {
  text-decoration: underline;
}

/* Карточка товара */
#product-card {
  display: flex;
  gap: 40px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.product-img-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-main-img {
  width: 220px;
  height: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}

.product-thumbs-row {
  display: flex;
  gap: 8px;
}

.product-thumb {
  width: 55px;
  height: 55px;
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.product-thumb:hover,
.product-thumb.active {
  border-color: var(--accent);
}

.product-details {
  flex: 1;
  min-width: 200px;
}

.product-details h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.product-price {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 6px;
}

.product-price-old {
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: line-through;
  margin-bottom: 12px;
}

.product-details p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.qty-row button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
}

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

#qty-display {
  font-size: 1rem;
  font-weight: bold;
  min-width: 24px;
  text-align: center;
}

.cart-msg {
  margin-top: 10px;
  color: green;
  font-size: 0.9rem;
  min-height: 20px;
}

/* Форма */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 500px;
}

#contact-form input,
#contact-form textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#contact-form input:focus,
#contact-form textarea:focus {
  border-color: var(--accent);
}

#contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

#form-result {
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.95rem;
}

/* Футер */
footer {
  text-align: center;
  padding: 30px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Адаптивность */
@media (max-width: 700px) {
  nav {
    padding: 12px 20px;
  }

  #nav-links {
    display: none; /* на мобиле пока скрываем, можно добавить бургер */
  }

  #hero {
    flex-direction: column;
    padding-top: 40px;
    text-align: center;
  }

  .hero-text p {
    max-width: 100%;
  }

  section {
    padding: 40px 20px;
  }

  #product-card {
    flex-direction: column;
    align-items: center;
  }
}
