/**
 * kauppa.css — Tototec verkkokaupan tyylit
 * Tuotelistaus (vk-*), tuotesivu (product-*), konfiguraattori (tt-*), toast, ostoskori
 */

/* ===== TUOTELISTAUS (product-embed) ===== */

.vk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.vk-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.vk-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

.vk-card .card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.vk-imgwrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f5f5f5;
}
.vk-imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.vk-card:hover .vk-imgwrap img {
  transform: scale(1.04);
}

.vk-body {
  padding: 14px 16px 18px;
}

.vk-name {
  font-family: "Kumbh Sans", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: #19191B;
  margin-bottom: 6px;
}

.vk-price {
  font-size: 0.95rem;
  color: #333;
}

.vk-price-regular {
  font-weight: 600;
  color: #289548;
}

.vk-price-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vk-price-original {
  text-decoration: line-through;
  color: #999;
  font-size: 0.9rem;
}

.vk-price-current {
  font-weight: 700;
  color: #289548;
}

.vk-price-discount {
  background: #289548;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.vk-price-from {
  color: #666;
  font-size: 0.88rem;
  font-style: italic;
}

.vk-desc {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Skeleton loading */
.vk-skel-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: vk-shimmer 1.5s infinite;
}
.vk-skel-line {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: vk-shimmer 1.5s infinite;
}
@keyframes vk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== FILTERS & SORT ===== */

.vk-filters-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.vk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vk-filter-btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #444;
  background: #fff;
  text-decoration: none;
  transition: all 0.2s;
}
.vk-filter-btn:hover {
  border-color: #289548;
  color: #289548;
}
.vk-filter-btn.active {
  background: #289548;
  border-color: #289548;
  color: #fff;
}

.vk-sort-container {
  position: relative;
}

.vk-sort-select {
  appearance: auto;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
  min-width: 180px;
}
.vk-sort-select:focus {
  outline: none;
  border-color: #289548;
}

/* ===== TUOTESIVU ===== */

.product-single-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.product-gallery-main {
  width: 100%;
  border-radius: 12px;
  background: #f5f5f5;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.product-gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 1.1rem;
}

.product-gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
}
.product-gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
  transition: all 0.2s;
}
.product-gallery-thumb:hover,
.product-gallery-thumb.active {
  opacity: 1;
  border-color: #289548;
}

.product-title {
  font-family: "Kumbh Sans", sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: #19191B;
  margin-bottom: 12px;
}

.product-price-wrapper {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.product-price-current {
  font-size: 1.6rem;
  font-weight: 700;
  color: #289548;
}
.product-price-original {
  font-size: 1.1rem;
  text-decoration: line-through;
  color: #999;
}
.product-price-discount {
  background: #ef4444;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}
.product-price-vat {
  font-size: 0.82rem;
  color: #888;
  width: 100%;
}

.product-short-desc {
  margin-bottom: 20px;
  color: #555;
  line-height: 1.6;
}
.product-short-desc p { margin-bottom: 8px; }

.product-purchase-block {
  margin-bottom: 24px;
}
.product-purchase-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.product-quantity-input {
  width: 70px;
  padding: 10px 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
}
.product-quantity-input:focus {
  outline: none;
  border-color: #289548;
}

.product-add-to-cart-btn {
  flex: 1;
  padding: 12px 24px;
  background: #289548;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.product-add-to-cart-btn:hover {
  background: #1f7a3a;
}
.product-add-to-cart-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.product-description {
  margin-top: 24px;
  margin-bottom: 20px;
  color: #555;
  line-height: 1.7;
}
.product-description p { margin-bottom: 10px; }
.product-description img { border-radius: 8px; margin: 10px 0; }

.product-meta {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
  color: #666;
}
.product-meta p { margin-bottom: 4px; }

/* ===== KONFIGURAATTORI (tt-*) ===== */

.tt-configurator {
  margin-top: 8px;
}

.tt-field {
  margin-bottom: 16px;
}
.tt-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: #333;
}
.tt-select,
.tt-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s;
}
.tt-select:focus,
.tt-input:focus {
  outline: none;
  border-color: #289548;
  box-shadow: 0 0 0 3px rgba(40,149,72,0.1);
}

.tt-dimensions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tt-notice {
  padding: 10px 14px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  color: #6d4c00;
}

.tt-label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: #333;
}

.tt-addons {
  margin-bottom: 20px;
}
.tt-addon-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.tt-addon-check:hover {
  border-color: #289548;
  background: #f0faf3;
}
.tt-addon-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #289548;
}
.tt-addon-price {
  margin-left: auto;
  font-size: 0.88rem;
  color: #666;
  white-space: nowrap;
}

/* ===== TOAST ===== */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #289548;
  color: #fff;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  pointer-events: auto;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.leaving {
  transform: translateY(20px);
  opacity: 0;
}
.toast--error {
  background: #ef4444;
}

/* ===== OSTOSKORI-IKONI (header) ===== */

.header-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  margin-left: 14px;
}
.header-cart:hover {
  color: #289548;
}
.header-cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #289548;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@keyframes cart-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.cart-pulse {
  animation: cart-pulse 0.4s ease;
}

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

@media (max-width: 991px) {
  .product-single-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .vk-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .vk-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .vk-body {
    padding: 10px 12px 14px;
  }
  .vk-name {
    font-size: 0.9rem;
  }
  .vk-filters-container {
    flex-direction: column;
    align-items: stretch;
  }
  .product-purchase-row {
    flex-direction: column;
  }
  .product-quantity-input {
    width: 100%;
  }
  .tt-dimensions {
    grid-template-columns: 1fr;
  }
  #toast-container {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
}
