/* CCA Size Dropdown 1.0.2 — unified Style A / Style B */

.cca-sd {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.3;
  box-sizing: border-box;
}

.cca-sd__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.cca-sd__toggle:hover {
  border-color: #3c4247;
}

.cca-sd__toggle:focus-visible {
  outline: 2px solid #c8a15a;
  outline-offset: 2px;
}

.cca-sd.is-open .cca-sd__toggle,
.cca-sd__toggle[aria-expanded="true"] {
  border: 2px solid #c8a15a;
  padding: 7px 11px;
}

.cca-sd__label-prefix {
  font-weight: 700;
  flex: 0 0 auto;
}

.cca-sd__value {
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cca-sd__chevron {
  flex: 0 0 auto;
  margin-left: 4px;
  font-weight: 400;
  opacity: 0.8;
}

.cca-sd__list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px 0;
  list-style: none;
  border: 1px solid #3c4247;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-height: 280px;
  overflow: auto;
  box-sizing: border-box;
}

.cca-sd__list[hidden] {
  display: none !important;
}

.cca-sd__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.cca-sd__option:hover,
.cca-sd__option:focus-visible {
  background: #f5f5f3;
  outline: none;
}

.cca-sd__option.is-selected {
  box-shadow: inset 3px 0 0 #c8a15a;
}

.cca-sd__option.is-out,
.cca-sd__option:disabled {
  opacity: 0.55;
  color: #6b7280;
  cursor: not-allowed;
}

.cca-sd__option.is-out .cca-sd__option-text,
.cca-sd__option:disabled .cca-sd__option-text {
  text-decoration: line-through;
}

.cca-sd__oos {
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.cca-sd__note {
  margin: 4px 0 0;
  font-size: 12px;
  color: inherit;
  opacity: 0.85;
}

/* Style A: hide original CCA grid + head + note (note re-rendered once under dropdown) */
.cca-variations-selector.cca-sd-source .cca-variations-options,
.cca-variations-selector.cca-sd-source .cca-variations-head,
.cca-variations-selector.cca-sd-source > .cca-variations-note {
  display: none !important;
}

.cca-variations-selector.cca-sd-source {
  margin: 16px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* Style B: stack attribute dropdowns full-width; hide table chrome */
.variations_form.cca-sd-form table.variations {
  display: block;
  width: 100%;
  border: 0;
  margin: 0 0 8px;
}

.variations_form.cca-sd-form table.variations tbody,
.variations_form.cca-sd-form table.variations tr,
.variations_form.cca-sd-form table.variations td.value {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.variations_form.cca-sd-form table.variations th.label {
  display: none !important;
}

.variations_form.cca-sd-form table.variations td.value {
  position: relative;
  padding: 0 !important;
  border: 0 !important;
}

.variations_form.cca-sd-form .cca-sd-hide-swatches,
.variations_form.cca-sd-form .cca-sd-hide-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Hide BU reset wrappers in-row; we re-host a subtle clear below */
.variations_form.cca-sd-form .sw-reset-button {
  display: none !important;
}

.cca-sd-reset-wrap {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
}

.cca-sd-reset-wrap a.reset_variations,
.cca-sd-reset-wrap .cca-sd-reset {
  color: #6b7280;
  text-decoration: underline;
  font-weight: 400;
  font-size: 12px;
}

.cca-sd-reset-wrap a.reset_variations:hover,
.cca-sd-reset-wrap .cca-sd-reset:hover {
  color: #3c4247;
}

/* Hide empty reset when Woo hides it */
.cca-sd-reset-wrap:empty,
.cca-sd-reset-wrap a.reset_variations[style*="visibility: hidden"],
.cca-sd-reset-wrap a.reset_variations[style*="display: none"] {
  display: none;
}
