/* Product Purchase Styles */

.product-purchase {
  margin: 0 0 40px 0;
}

.product-purchase .product-price {
  font-size: 14px;
  font-weight: bold;
}

.product-purchase .add-to-cart {
  text-align: right;
  height: 30px;
}

/* Format Selection Styles */
.format-selection {
  margin-bottom: 40px;
}

.format-selection h3 {
  color: #2f417d;
  font-size: 16px;
  margin-bottom: 10px;
}

.format-selection-container,
.product-selection-container {
  margin-bottom: 20px;
}

.format-selection-container h4,
.product-selection-container h4 {
  color: #2f417d;
  font-size: 14px;
  margin: 0 0 8px 0;
  font-weight: bold;
  position: relative;
}

/* Info icon styling */
.info-icon-container {
  position: relative;
  display: inline-block;
}

.info-icon {
  display: inline-block;
  color: #7790c8;
  font-size: 16px;
  cursor: help;
  margin-left: 5px;
  position: relative;
}

/* Tooltip styling */
.tooltip-text {
  visibility: hidden;
  position: absolute;
  background-color: #fff;
  border: 1px solid #d2d8eb;
  border-radius: 4px;
  padding: 12px;
  width: 250px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 100;
  font-size: 12px;
  color: #333;
  line-height: 1.5;
  text-align: left;
  bottom: 100%;
  left: -5px;
  margin-bottom: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

/* Arrow for tooltip pointing down */
.tooltip-text::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 15px;
  width: 12px;
  height: 12px;
  background-color: #fff;
  border-right: 1px solid #d2d8eb;
  border-bottom: 1px solid #d2d8eb;
  transform: rotate(45deg);
  box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.02);
}

.tooltip-text strong {
  color: #2f417d;
  display: block;
  margin-bottom: 3px;
}

.tooltip-header {
  font-weight: bold;
  color: #2f417d;
  font-size: 13px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e6e9f0;
  padding-bottom: 5px;
}

.tooltip-divider {
  height: 1px;
  background-color: #e6e9f0;
  margin: 8px 0;
}

.tooltip-option {
  padding: 4px 0;
}

.tooltip-option.selected strong {
  color: #7790c8;
}

.tooltip-description {
  margin-top: 2px;
  font-size: 11px;
}

/* Show the tooltip on hover */
.info-icon:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.product-options {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 15px;
}

/* Custom Select Styles */
.custom-select-wrapper {
  width: 220px;
  position: relative;
  user-select: none;
}

.custom-select {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #d2d8eb;
  border-radius: 5px;
  background-color: white;
}

.custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #2f417d;
  cursor: pointer;
  height: 40px;
}

.custom-select-trigger:after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #2f417d;
}

.custom-select.opened .custom-select-trigger:after {
  border-top: none;
  border-bottom: 5px solid #2f417d;
}

.custom-options {
  position: absolute;
  display: block;
  top: 100%;
  left: 0;
  right: 0;
  border: 1px solid #d2d8eb;
  border-top: 0;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.custom-select.opened .custom-options {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.custom-option {
  position: relative;
  display: block;
  padding: 10px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-option:hover {
  background-color: #f0f3fa;
}

.custom-option.selected {
  color: #2f417d;
  background-color: #e6ebf7;
}

.custom-option.disabled {
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.custom-option.disabled:hover {
  background-color: transparent;
}

.product-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #d2d8eb;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: calc(33.33% - 5px);
  box-sizing: border-box;
  position: relative;
  min-height: 100px;
  justify-content: space-between;
}

.product-option:hover {
  background-color: #f0f3fa;
}

.product-option.selected {
  background-color: #e6ebf7;
  border-color: #7790c8;
}

.product-name {
  font-weight: bold;
  font-size: 14px;
  color: #2f417d;
  display: block;
  margin-top: 5px;
  align-self: flex-start;
}

.product-price {
  font-weight: bold;
  font-size: 14px;
  color: #333;
  display: block;
  margin-top: auto;
  align-self: flex-start;
}

.product-option input[type='radio'] {
  margin: 0;
  align-self: flex-start;
}

/* Product options responsiveness */
@media (max-width: 768px) {
  .product-option {
    width: calc(50% - 10px);
  }
}

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

  .custom-select-wrapper {
    width: 100%;
  }
}
