/**
 * Product Add-ons/Accessories Styling
 */

/* ========================================
   WHAT'S INCLUDED SECTION
   ======================================== */

.product-included-wrapper {
  padding: var(--space-4) 0;
  margin-bottom: var(--space-5);
}

.product-included-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 5px !important;
  color: var(--text-color);
}

.product-included-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.product-included-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.product-included-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--background-color);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.product-included-item:hover {
  border-color: var(--primary-color);
  background: var(--white);
}

.product-included-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

.product-included-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-color);
  line-height: 1.3;
}

/* ========================================
   PRODUCT ADD-ONS SECTION
   ======================================== */

.product-addons-wrapper {
  background: var(--background-color);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.product-addons-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-color);
}

.product-addons-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.product-addons-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.product-addon-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-md);
  transition: all 0.2s ease;
  overflow: hidden;
}

.product-addon-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-addon-item.selected {
  border-color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.02);
}

/* Main row with checkbox, label, quantity, and info button */
.product-addon-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
}

/* Info button */
.product-addon-info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--background-color);
  border: 1px solid var(--color-border-light);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.product-addon-info-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

.product-addon-info-btn[aria-expanded="true"] {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

.product-addon-info-btn svg {
  width: 18px;
  height: 18px;
}

/* Toggle between question mark and X icon */
.product-addon-info-btn .icon-open {
  display: none;
}

.product-addon-info-btn[aria-expanded="true"] .icon-closed {
  display: none;
}

.product-addon-info-btn[aria-expanded="true"] .icon-open {
  display: block;
}

/* Accordion content */
.product-addon-accordion {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.product-addon-accordion[aria-hidden="false"] {
  max-height: 500px;
  transition: max-height 0.4s ease-in;
}

.product-addon-accordion-content {
  padding: 0 var(--space-4) var(--space-4) var(--space-4);
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.product-addon-accordion-content p {
  margin: 0 0 var(--space-2) 0;
}

.product-addon-accordion-content p:last-child {
  margin-bottom: 0;
}

.product-addon-accordion-content ul,
.product-addon-accordion-content ol {
  margin: var(--space-2) 0;
  padding-left: var(--space-4);
}

.product-addon-accordion-content li {
  margin-bottom: var(--space-1);
}

.product-addon-checkbox-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.product-addon-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.product-addon-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.product-addon-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.product-addon-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-border-light);
}

.product-addon-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.product-addon-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-color);
}

.product-addon-price {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--primary-color);
}

.product-addon-price .out-of-stock {
  color: var(--color-error);
  font-weight: 500;
}

.product-addon-quantity-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--border-radius-sm);
  padding: var(--space-1);
}

.addon-qty-minus,
.addon-qty-plus {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.addon-qty-minus:hover,
.addon-qty-plus:hover {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.product-addon-quantity {
  width: 50px;
  height: 32px;
  text-align: center;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-sm);
  font-size: var(--text-base);
  font-weight: 600;
}

/* Total price section */
.product-addons-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-border-light);
}

.product-addons-total-label {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-color);
}

.product-addons-total-price {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  /* Included items responsive */
  .product-included-wrapper {
    padding: var(--space-3);
  }

  .product-included-title {
    font-size: var(--text-base);
  }

  .product-included-item {
    padding: var(--space-2);
    font-size: var(--text-xs);
  }

  .product-included-image {
    width: 35px;
    height: 35px;
  }

  .product-included-name {
    font-size: var(--text-xs);
  }

  /* Add-ons responsive */
  .product-addon-main {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .product-addon-checkbox-wrapper {
    flex: 1 1 calc(100% - 44px);
    order: 1;
  }

  .product-addon-quantity-wrapper {
    width: 100%;
    justify-content: center;
    order: 3;
  }

  .product-addon-info-btn {
    position: static;
    order: 2;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
  }

  .product-addon-accordion-content {
    padding: var(--space-3);
  }

  .product-addons-wrapper {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .product-included-item {
    width: 100%;
  }

  .product-addon-info-btn {
    width: 28px;
    height: 28px;
  }

  .product-addon-info-btn svg {
    width: 14px;
    height: 14px;
  }

  .product-addon-checkbox-wrapper {
    flex: 1 1 calc(100% - 38px);
  }
}
