/**
 * LX Sidebar Posts & Products - Stylesheet
 * Responsive layout matching sidebar design with global theme color support
 */

:root {
  --lx-spp-primary: var(--lx-primary-color, var(--primary-color, #e4a819));
  --lx-spp-text: var(--lx-p-color, #333333);
  --lx-spp-border: #f0f0f0;
}

/* Sidebar Outer Container */
.lx-spp-widget-wrap {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

/* Section Block */
.lx-spp-section {
  margin-bottom: 28px;
}

.lx-spp-section:last-child {
  margin-bottom: 0;
}

/* Section Title */
.lx-spp-section-title {
  color: var(--lx-spp-primary);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 16px 0;
  padding: 12px 0;
  line-height: 1.3;
  text-transform: none;
}

.lx-spp-products-section .lx-spp-section-title {
  padding: 16px 0px 16px ;
}

/* List Reset */
.lx-spp-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Individual Items */
.lx-spp-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--lx-spp-border);
  transition: background-color 0.2s ease;
}

.lx-spp-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Post Circle Thumbnail */
.lx-spp-post-item .lx-spp-thumb-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.lx-spp-post-item .lx-spp-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Product Square Thumbnail */
.lx-spp-product-item .lx-spp-thumb-wrap {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
}

.lx-spp-product-item .lx-spp-thumb {
  width: 54px;
  height: 54px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  border: 1px solid #eaeaea;
}

/* Placeholder image fallback */
.lx-spp-thumb-placeholder {
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 18px;
}

.lx-spp-thumb-placeholder.circle {
  border-radius: 50%;
}

.lx-spp-thumb-placeholder.square {
  border-radius: 4px;
  border: 1px solid #eaeaea;
}

/* Item Content Info */
.lx-spp-info {
  flex: 1;
  min-width: 0; /* Ensures proper text truncating */
}

/* Item Link & Title */
.lx-spp-title-link {
  text-decoration: none !important;
  color: inherit;
  display: block;
}

.lx-spp-title {
  font-size: 13.5px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--lx-spp-text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.lx-spp-title-link:hover .lx-spp-title,
.lx-spp-title:hover {
  color: var(--lx-spp-primary);
}

/* WooCommerce Price Styling */
.lx-spp-price {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: #333333;
  line-height: 1.2;
}

.lx-spp-price del {
  color: #999;
  font-weight: 400;
  font-size: 12px;
  margin-right: 4px;
}

.lx-spp-price ins {
  text-decoration: none;
  color: #d9534f;
  font-weight: 700;
}

.lx-spp-price .woocommerce-Price-amount {
  display: inline-block;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .lx-spp-section-title {
    font-size: 17px;
    padding: 16px;
  }
  .lx-spp-title {
    font-size: 13px;
  }
  .lx-spp-price {
    font-size: 13px;
  }
}
