/**
 * Product Lists Shortcode Styles
 * Basiert auf dem Grid-List Design
 */

/* Container */
.spl-container {
  width: 100%;
  margin: 0 auto;
  padding: 20px 0;
}

/* Grid Layout */
.spl-lists-grid {
  display: grid;
  gap: 30px;
  margin-top: 30px;
}

/* Responsive Grid Columns */
.spl-container[data-columns="2"] .spl-lists-grid {
  grid-template-columns: repeat(2, 1fr);
}

.spl-container[data-columns="3"] .spl-lists-grid {
  grid-template-columns: repeat(3, 1fr);
}

.spl-container[data-columns="4"] .spl-lists-grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .spl-container[data-columns="4"] .spl-lists-grid,
  .spl-container[data-columns="3"] .spl-lists-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .spl-lists-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
}

/* List Item */
.spl-list-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.spl-list-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.spl-list-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Image Container */
.spl-list-image {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 Aspect Ratio */
  overflow: hidden;
  background: #f5f5f5;
}

.spl-list-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.spl-list-item:hover .spl-list-image img {
  transform: scale(1.05);
}

/* Placeholder Image */
.spl-placeholder-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.spl-placeholder-image .dashicons {
  font-size: 80px;
  width: 80px;
  height: 80px;
  color: rgba(255, 255, 255, 0.8);
}

/* Overlay */
.spl-list-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.spl-list-item:hover .spl-list-overlay {
  opacity: 1;
}

/* Add Button */
.spl-add-list-btn {
  background: #fff;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 15px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.spl-add-list-btn:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.spl-add-list-btn:active {
  transform: translateY(0);
}

.spl-add-list-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.spl-btn-icon {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
}

.spl-btn-text {
  white-space: nowrap;
}

/* Spinner */
.spl-btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spl-spin 0.8s linear infinite;
}

.spl-add-list-btn.loading .spl-btn-spinner {
  display: block;
}

.spl-add-list-btn.loading .spl-btn-text,
.spl-add-list-btn.loading .spl-btn-icon {
  display: none;
}

@keyframes spl-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* List Info */
.spl-list-info {
  background: #fff;
}

/* Accordion Toggle Button */
.spl-list-toggle {
  width: 100%;
  padding: 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.2s ease;
  background-color: white !important;
}

.spl-list-toggle:hover {
  background: #f9f9f9;
}

.spl-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.spl-list-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.spl-list-count {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* Accordion Icon */
.spl-accordion-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: black;
  border-radius: 50%;
  transition: all 0.3s ease;
  color: white;
}

.spl-list-item.active .spl-accordion-icon {
  transform: rotate(180deg);
  background: black;
  color: white;
}

/* Accordion Content */
.spl-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  border-top: 1px solid #e0e0e0;
}

.spl-list-item.active .spl-accordion-content {
  max-height: 2000px;
}

/* Products List in Accordion */
.spl-products-list {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Mini Product Item */
.spl-product-item-mini {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.spl-product-item-mini:hover {
  background: #f0f0f0;
  transform: translateX(4px);
}

.spl-product-mini-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e0e0e0;
}

.spl-product-mini-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.spl-product-mini-name {
  flex: 1;
  min-width: 0;
}

.spl-product-mini-name a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.spl-product-mini-name a:hover {
  color: #667eea;
}

/* No Lists Message */
.spl-no-lists {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

/* Success Notification */
.spl-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: black;
  color: white;
  padding: 16px 24px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: spl-slideIn 0.3s ease;
  max-width: 400px;
}

.spl-notification.error {
  background: #f44336;
}

.spl-notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spl-notification-icon {
  font-size: 24px;
  line-height: 1;
}

.spl-notification-text {
  flex: 1;
}

.spl-notification-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.spl-notification-message {
  font-size: 14px;
  opacity: 0.9;
}

@keyframes spl-slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes spl-slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.spl-notification.hiding {
  animation: spl-slideOut 0.3s ease forwards;
}

/* Progress Modal */
.spl-progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: spl-fadeIn 0.3s ease;
}

.spl-progress-content {
  background: white;
  border-radius: 12px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.spl-progress-title {
  margin: 0 0 24px 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.spl-progress-bar-container {
  margin-bottom: 16px;
}

.spl-progress-bar {
  width: 100%;
  height: 30px;
  background: #f0f0f0;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}

.spl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.spl-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: spl-shimmer 2s infinite;
}

.spl-progress-text {
  margin: 0;
  text-align: center;
  color: #666;
  font-size: 16px;
  font-weight: 500;
}

@keyframes spl-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spl-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Responsive Button Text */
@media (max-width: 480px) {
  .spl-add-list-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .spl-btn-icon {
    font-size: 20px;
  }

  .spl-notification {
    left: 15px;
    right: 15px;
    bottom: 15px;
  }

  .spl-progress-content {
    padding: 30px 20px;
  }

  .spl-progress-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .spl-progress-bar {
    height: 24px;
  }

  .spl-progress-text {
    font-size: 14px;
  }
}
