/* Category Product Accordion Styles */
.cpa-accordion-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  margin-bottom: 80px; /* Space for sticky bar */
}

/* Accordion Header */
.cpa-accordion-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cpa-accordion-header {
  background: #000;
  padding: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}

.cpa-accordion-header:hover {
  background: #e9ecef;
}

.cpa-accordion-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.cpa-accordion-icon {
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
  transition: transform 0.3s ease;
}

.cpa-accordion-header.active .cpa-accordion-icon {
  transform: rotate(45deg);
}

/* Accordion Content */
.cpa-accordion-content {
  padding: 0;
  background: #fff;
}

.cpa-products-list {
  padding: 0;
}

/* Product Item */
.cpa-product-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
  gap: 15px;
}

.cpa-product-item:last-child {
  border-bottom: none;
}

.cpa-product-serial {
  font-weight: bold;
  color: #666;
  min-width: 30px;
  text-align: center;
}

.cpa-product-image {
  flex-shrink: 0;
}

.cpa-product-image img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.cpa-product-details {
    width: 50%;
  min-width: 0;
}

.cpa-product-name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  line-height: 1.3;
}

/* Removed old price styles from product-details and created separate price column */
.cpa-product-price-column {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 30px;
    flex-shrink: 0;
    width: 25%;
}

.cpa-regular-price {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
}

.cpa-sale-price,
.cpa-price {
  font-weight: 600;
  color: #e74c3c;
  font-size: 16px;
}

/* Quantity Controls */
.cpa-quantity-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.cpa-qty-btn {
  width: 35px;
  height: 35px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cpa-qty-btn:hover {
  background: #c40101;
}

.cpa-qty-btn:active {
  transform: scale(0.95);
}

.cpa-qty-input {
  width: 60px;
  height: 35px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.cpa-qty-input:focus {
  outline: none;
  border-color: #f70101;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Sticky Bottom Bar */
.cpa-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #f70101;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.cpa-cart-info {
  display: flex;
  gap: 20px;
  align-items: center;
}

.cpa-cart-quantity {
  font-weight: 600;
  color: #333;
}

.cpa-cart-count {
  background: #007cba;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  min-width: 20px;
  text-align: center;
  display: inline-block;
}

.cpa-cart-total {
  font-size: 18px;
  font-weight: bold;
  color: #e74c3c;
}

.cpa-view-cart-btn {
  background: #f70101;
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.cpa-view-cart-btn:hover {
  background: #005a87;
  color: white;
}

/* Loading State */
.cpa-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cpa-accordion-container {
    padding: 10px;
    margin-bottom: 100px;
  }

  .cpa-product-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .cpa-product-details {
    flex: 1 1 100%;
    order: 3;
  }

  /* Added responsive styling for price column */
  .cpa-product-price-column {
    order: 2;
    align-items: flex-start;
    min-width: auto;
  }

  .cpa-quantity-controls {
    order: 4;
    margin-left: auto;
  }

  .cpa-sticky-bar {
    flex-direction: column;
    gap: 10px;
    padding: 10px 15px;
  }

  .cpa-cart-info {
    width: 100%;
    justify-content: center;
  }

  .cpa-view-cart-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .cpa-product-item {
    padding: 10px 15px;
  }

  .cpa-product-image img {
    width: 50px;
    height: 50px;
  }

  .cpa-product-name {
    font-size: 14px;
  }

  .cpa-qty-btn,
  .cpa-qty-input {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .cpa-qty-input {
    width: 50px;
  }
}
