/* product.css – ainult toote detailvaate stiilid */

main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  padding-left: 0;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
}

/* Ülemine tooteplokk */
.product-top {
  background-color: #ffffff;
  border-radius: 0.75rem;
  padding: 1.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.08);
}

.product-title {
  font-size: 1.9rem;
  font-weight: 700;
}

.product-price {
  font-size: 1.4rem;
  font-weight: 700;
}

.product-meta {
  font-size: 0.85rem;
  color: #6b7280;
}

.stock-label {
  color: #059669;
  font-weight: 500;
  font-size: 0.95rem;
}

.short-description {
  font-size: 0.95rem;
  color: #4b5563;
}

/* =========================
   TOOTE GALERII (uus layout)
   ========================= */

.product-image-wrapper {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  padding: 12px;
  position: relative;
}

.product-media {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: start;
}

.product-main {
  aspect-ratio: 4 / 3;
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#productMainImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .25s ease;
  transform-origin: 50% 50%;
}

#productMainImage.is-placeholder {
  width: 45%;
  height: auto;
  opacity: .65;
}

/* thumbs paremal: vertikaalne, scroll */
.product-thumbs {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  overflow: auto;
  padding-right: 2px;
  max-height: 100%;
}

.product-thumbs .thumb-btn {
  border: 1px solid #dee2e6;
  background: #fff;
  padding: 0;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  flex: 0 0 auto;
}

.product-thumbs .thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-thumbs .thumb-btn.is-active {
  border-color: #0aa7a6;
  box-shadow: 0 0 0 .2rem rgba(10, 167, 166, .15);
}

/* mobiilis thumbs alla + horisontaalne scroll */
@media (max-width: 576px) {
  .product-media {
    grid-template-columns: 1fr;
  }
  .product-thumbs {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }
}

/* Zoom ainult main plokis */
.product-main.is-zooming #productMainImage {
  transform: scale(1.8);
  cursor: zoom-in;
}

/* Sooduse badge (toote põhipildil) */
.badge-sale {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  background: #dc3545;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

/* =========================
   LISAINF0 TAB
   ========================= */

.tab-header {
  border-bottom: 1px solid #e5e7eb;
  margin-top: 2rem;
}

.tab-header button {
  border-radius: 0.5rem 0.5rem 0 0;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  background-color: #ffffff;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
}

.tab-header button.active {
  border-bottom-color: #ffffff;
  font-weight: 600;
}

.tab-body {
  background-color: #ffffff;
  border-radius: 0 0.5rem 0.5rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-top: none;
  padding: 1.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.06);
}

.tab-body h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.info-table th,
.info-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.info-table th {
  width: 35%;
  font-weight: 600;
  background-color: #f9fafb;
}

.info-table tr:nth-child(even) td {
  background-color: #fdfefe;
}

.info-table .info-group {
  background: transparent;
  font-weight: 700;
  padding: 14px 12px 8px;
}

/* KM tooltip */
.vat-tooltip-trigger {
  cursor: help;
  position: relative;
  font-size: 0.85em;
  color: #6b7280;
  margin-left: 0.25em;
}
.vat-tooltip-trigger:hover::after,
.vat-tooltip-trigger:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 130%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  white-space: normal;
  width: max-content;
  max-width: 320px;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  pointer-events: none;
}
.vat-tooltip-trigger:hover::before,
.vat-tooltip-trigger:focus::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 110%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  z-index: 51;
  pointer-events: none;
}

/* =========================
   SEOTUD TOOTED (ühtlased kaardid)
   ========================= */

.related-section {
  margin-top: 3rem;
}

.related-section .row > [class*="col-"] {
  display: flex;
}

.related-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;

  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.6rem 1.5rem rgba(15, 23, 42, 0.12);
}

.related-card > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  display: block;
}

.related-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 12px;
}

.related-title {
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-price {
  margin-top: auto;
  font-weight: 600;
  padding-top: 8px;
}

.related-sale-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #dc3545;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 2;
}

.related-old-price {
  font-size: 0.85rem;
  color: #888;
  text-decoration: line-through;
}

.related-new-price {
  font-weight: 700;
}

/* =========================
   DARK MODE
   ========================= */

.dark-mode .product-top,
.dark-mode .tab-body,
.dark-mode .related-card,
.dark-mode .product-image-wrapper {
  background-color: #1e293b !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

.dark-mode .product-main {
  background-color: #111827;
}

.dark-mode .info-table th,
.dark-mode .info-table td {
  border-bottom: 1px solid #1f2937;
  color: #e5e7eb;
}

.dark-mode .info-table th {
  background-color: #111827;
}

.dark-mode .info-table td,
.dark-mode .info-table tr:nth-child(even) td {
  background-color: #020617;
}

.text-muted.small.mt-1 {
  opacity: 0.3;
}