/**
 * Relee.fi Product Catalog Styles
 * 
 * @package Relee.fi
 */

/* Korttigridi Shelly-katalogille */
.relee-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 320px); /* Kiinteä 320px leveys */
  gap: 24px;
  margin: 32px 0;
  justify-content: start; /* Kortit vasemmalle, tai 'center' keskelle */
}

/* Tablet - 2 columns */
@media (max-width: 768px) {
  .relee-product-grid {
    grid-template-columns: repeat(auto-fill, 280px);
    gap: 20px;
    justify-content: center; /* Keskitetään pienemmillä näytöillä */
  }
}

/* Mobile - 1 column */
@media (max-width: 480px) {
  .relee-product-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Yksittäinen tuotekortti */
.relee-product-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  /* max-width: 320px;*/ /* Estää venymisen */
  width: 100%;
}

.relee-product-card:hover {
  border-color: #c0c0c0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Kuvalinkki */
.relee-product-image-link {
  display: block;
  text-decoration: none;
}

.relee-product-image-link:hover {
  text-decoration: none;
}

/* Kuva-alue */
.relee-product-image {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.relee-product-img {
  max-width: 150px;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Placeholder jos ei kuvaa */
.relee-product-image-placeholder {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.relee-product-image-placeholder i {
  font-size: 64px;
  color: rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
  .relee-product-image {
    height: 160px;
    padding: 2px 10px;
  }
  
  .relee-product-img {
    max-width: 130px;
    max-height: 130px;
  }
}

/* Sisältöalue */
.relee-product-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* Otsikko */
.relee-product-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
}

.relee-product-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.relee-product-title a:hover {
  color: #0066cc;
}

@media (max-width: 480px) {
  .relee-product-title {
    font-size: 1.05rem;
  }
}

/* Lyhyt kuvaus */
.relee-product-excerpt {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #666;
  margin: 0;
}

/* Application-pill-tagit */
.relee-product-apps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.relee-app-pill {
  background: #f5f0e8;
  color: #5a4a3a;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.relee-app-pill:hover {
  background: #e8dcc8;
  color: #3a2a1a;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Connectivity ikonit */
.relee-product-connectivity {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

.relee-connectivity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border-radius: 8px;
  padding: 6px;
  transition: all 0.3s ease;
  overflow: visible;
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.relee-connectivity-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: all 0.3s ease;
  opacity: 0.85;
}

/* Yksittäisen ikonin hover-efekti */
.relee-connectivity-icon:hover {
  background: #f0f0f0;
  transform: scale(1.15);
}

.relee-connectivity-icon:hover .relee-connectivity-img {
  opacity: 1;
  filter: brightness(1.1) saturate(1.2);
}

/* Tooltip */
.relee-connectivity-icon::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #2c3e50;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Tooltip arrow */
.relee-connectivity-icon::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  border: 6px solid transparent;
  border-top-color: #2c3e50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

/* Show tooltip on hover */
.relee-connectivity-icon:hover::before,
.relee-connectivity-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
