/* =============================================
   Multiselect Dropdown Component
   ============================================= */

.multiselect-dropdown {
  position: relative;
  width: 100%;
}

.multiselect-header {
  padding: 16px 14px;
  border: 1px solid rgba(9, 9, 17, 0.10);
  background: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  color: #9d9da0;
  transition: border-color 0.2s ease;
}

.multiselect-dropdown.has-selection .multiselect-header {
  color: #071209;
}

.multiselect-header:hover {
  border-color: rgba(9, 9, 17, 0.30);
}

.multiselect-dropdown.open .multiselect-header {
  border-color: rgba(9, 9, 17, 0.40);
}

.multiselect-arrow {
  width: 12px;
  height: 12px;
  background-image: url('images/icon-select.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s ease;
}

.multiselect-dropdown.open .multiselect-arrow {
  transform: rotate(180deg);
}

.multiselect-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(9, 9, 17, 0.15);
  border-top: none;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  z-index: 100;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.multiselect-dropdown.open .multiselect-options {
  max-height: 300px;
  overflow-y: auto;
  opacity: 1;
}

.multiselect-option {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  gap: 10px;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid rgba(9, 9, 17, 0.05);
}

.multiselect-option:last-child {
  border-bottom: none;
}

.multiselect-option:hover {
  background-color: rgba(70, 70, 134, 0.05);
}

/* Hide native checkbox */
.multiselect-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Custom checkbox */
.multiselect-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid rgba(9, 9, 17, 0.25);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: #fff;
}

.multiselect-option input[type="checkbox"]:checked + .multiselect-checkbox {
  background-color: #464686;
  border-color: #464686;
}

.multiselect-option input[type="checkbox"]:checked + .multiselect-checkbox::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* Option image */
.multiselect-option img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(9, 9, 17, 0.08);
}

/* Option label text */
.multiselect-label {
  flex: 1;
  font-size: 14px;
  color: #071209;
  line-height: 1.3;
}

/* Scrollbar styling for options */
.multiselect-options::-webkit-scrollbar {
  width: 6px;
}

.multiselect-options::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.multiselect-options::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.multiselect-options::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .multiselect-header {
    padding: 14px 12px;
  }

  .multiselect-option {
    padding: 12px;
    gap: 8px;
  }

  .multiselect-option img {
    width: 32px;
    height: 32px;
  }

  .multiselect-checkbox {
    width: 16px;
    height: 16px;
    min-width: 16px;
  }

  .multiselect-label {
    font-size: 13px;
  }

  .multiselect-dropdown.open .multiselect-options {
    max-height: 250px;
  }
}

/* =============================================
   Size Pills Component
   ============================================= */

.size-pills-container {
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
  flex-shrink: 0;
}

.size-pills-wrapper {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  gap: 0;
  align-items: stretch;
  min-height: 0;
}

.size-pill {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  background: #fff;
  border: 1px solid rgba(9, 9, 17, 0.15);
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
  color: #071209;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-left: -1px;
  min-height: 42px;
  box-sizing: border-box;
}

.size-pill:first-child {
  margin-left: 0;
}

.size-pill:hover {
  border-color: #464686;
  background-color: rgba(70, 70, 134, 0.05);
  z-index: 1;
}

.size-pill.active {
  background-color: #464686;
  border-color: #464686;
  color: #fff;
  z-index: 2;
}

.size-pill.active:hover {
  background-color: #3a3a70;
  border-color: #3a3a70;
}

/* Hidden input for form submission */
.size-pills-value {
  display: none;
}

/* Mobile responsive for Size Pills */
@media (max-width: 768px) {
  .size-pill {
    padding: 8px 6px;
    font-size: 13px;
    min-height: 38px;
  }
}

/* On small screens, selects in a single column (100% each) */
@media (max-width: 600px) {
  .badge-options-extras-content {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Options and extras accordion (arrow toggle)
   ============================================= */
.options-and-extras-checkbox-wrapper {
  margin-bottom: 12px;
  flex: 0 0 100%;
  width: 100%;
}

.options-and-extras-accordion-trigger.options-and-extras-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  margin: 0;
  padding: 0;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
}

.options-and-extras-accordion-trigger:focus {
  outline: none;
}

.options-and-extras-label-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.options-and-extras-label-text {
  display: block;
  color: #090911;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.options-and-extras-sublabel {
  display: block;
  color: rgba(9, 9, 17, 0.55);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

/* Arrow icon: Font Awesome chevron, down by default, rotates to up when expanded */
.options-and-extras-arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.options-and-extras-arrow i {
  font-size: 14px;
  color: #090911;
  transition: transform 0.25s ease;
}

.options-and-extras-expanded .options-and-extras-arrow i {
  transform: rotate(180deg);
}

/* Container that is shown when the accordion is expanded */
.badge-options-extras-content {
  margin-bottom: 16px;
  padding: 0 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
  animation: options-extras-fade-in 0.2s ease-out;
}

/* The pills row takes up 100% of the width (single row) */
.badge-options-extras-content .size-pills-container,
.badge-options-extras-content > *:has(.size-pills-container) {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
}

/* The 4 selects: 50% each, 2 by 2 */
.badge-options-extras-content > *:has(.multiselect-dropdown) {
  min-width: 0;
}

@keyframes options-extras-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Inner content: remove extra margins from the p/span wrapping pills and selects */
.badge-options-extras-content > p,
.badge-options-extras-content > span {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
}

.badge-options-extras-content .size-pills-container {
  margin-bottom: 0;
}

.badge-options-extras-content .multiselect-dropdown {
  width: 100%;
  min-width: 0;
}
