/* ============================================
   ECOFACTOR - Form Controls Styles
   Based on Figma Design System
   ============================================ */

/* ============================================
   RADIO BUTTON
   Size: 24×24px, Inner dot: 14×14px
   ============================================ */

.radio {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.radio__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio__control {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-gray-30);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.radio__control::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-green-60);
  transform: scale(0);
  transition: transform var(--transition-fast);
}

/* Radio - Checked */
.radio__input:checked + .radio__control::after {
  transform: scale(1);
}

/* Radio - Hover */
.radio:hover .radio__control {
  border-color: var(--color-green-50);
}

/* Radio - Focus */
.radio__input:focus-visible + .radio__control {
  outline: 2px solid rgba(61, 208, 120, 0.3);
  outline-offset: 2px;
}

/* Radio - Disabled */
.radio__input:disabled + .radio__control {
  border-color: var(--color-gray-70);
  cursor: not-allowed;
}

.radio__input:disabled:checked + .radio__control::after {
  background-color: var(--color-gray-70);
}

.radio__input:disabled ~ .radio__label {
  color: var(--color-gray-70);
}

.radio__label {
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--color-gray-20);
}

/* ============================================
   CHECKBOX
   Size: 32×32px, Box: ~21×21px
   ============================================ */

.checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.checkbox__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox__control {
  width: 21px;
  height: 21px;
  border: 1px solid var(--color-gray-30);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background-color: transparent;
}

.checkbox__control svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--transition-fast);
}

/* Checkbox - Checked */
.checkbox__input:checked + .checkbox__control {
  background-color: var(--color-green-60);
  border-color: var(--color-green-60);
}

.checkbox__input:checked + .checkbox__control svg {
  opacity: 1;
  transform: scale(1);
}

/* Checkbox - Hover */
.checkbox:hover .checkbox__control {
  border-color: var(--color-green-50);
}

/* Checkbox - Focus */
.checkbox__input:focus-visible + .checkbox__control {
  outline: 2px solid rgba(61, 208, 120, 0.3);
  outline-offset: 2px;
}

/* Checkbox - Disabled */
.checkbox__input:disabled + .checkbox__control {
  border-color: var(--color-gray-70);
  background-color: var(--color-gray-95);
  cursor: not-allowed;
}

.checkbox__input:disabled:checked + .checkbox__control {
  background-color: var(--color-gray-70);
  border-color: var(--color-gray-70);
}

.checkbox__input:disabled ~ .checkbox__label {
  color: var(--color-gray-70);
}

.checkbox__label {
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--color-gray-20);
}

/* ============================================
   SWITCH / TOGGLE
   Size: 52×32px
   ============================================ */

.switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 12px;
}

.switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__track {
  width: 52px;
  height: 32px;
  background-color: var(--color-gray-70);
  border-radius: 16px;
  position: relative;
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.switch__handle {
  width: 24px;
  height: 24px;
  background-color: var(--color-white);
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 4px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.switch__handle svg {
  width: 12px;
  height: 12px;
}

/* Switch - Checked/Enabled */
.switch__input:checked + .switch__track {
  background-color: var(--color-green-60);
}

.switch__input:checked + .switch__track .switch__handle {
  left: calc(100% - 28px);
}

/* Switch - Focus */
.switch__input:focus-visible + .switch__track {
  outline: 2px solid rgba(61, 208, 120, 0.3);
  outline-offset: 2px;
}

/* Switch - Disabled */
.switch__input:disabled + .switch__track {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch__label {
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--color-gray-20);
}

/* ============================================
   QUANTITY SELECTOR
   Layout: Minus - Number - Plus
   ============================================ */

.quantity {
  display: inline-flex;
  align-items: center;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-95);
  border-radius: 8px;
  overflow: hidden;
}

.quantity__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  color: var(--color-gray-20);
}

.quantity__btn:hover {
  background-color: var(--color-gray-95);
}

.quantity__btn:disabled {
  color: var(--color-gray-70);
  cursor: not-allowed;
}

.quantity__btn:disabled:hover {
  background-color: transparent;
}

.quantity__btn svg {
  width: 12px;
  height: 12px;
}

.quantity__value {
  width: 40px;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: var(--font-bold);
  text-align: center;
  color: var(--color-gray-20);
  border-left: 1px solid var(--color-gray-95);
  border-right: 1px solid var(--color-gray-95);
  padding: 2px 12px;
  line-height: 1.6;
}

/* Quantity - Dark Theme */
.quantity--dark {
  background-color: var(--color-gray-20);
  border-color: var(--color-gray-30);
}

.quantity--dark .quantity__btn {
  color: var(--color-white);
}

.quantity--dark .quantity__btn:hover {
  background-color: var(--color-gray-30);
}

.quantity--dark .quantity__btn:disabled {
  color: var(--color-gray-70);
}

.quantity--dark .quantity__value {
  color: var(--color-white);
  border-color: var(--color-gray-30);
}

/* ============================================
   DOTS / PAGINATION INDICATORS
   ============================================ */

.dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-gray-70);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  padding: 0;
}

.dot:hover {
  background-color: var(--color-gray-30);
}

.dot--active,
.dot[aria-current="true"] {
  background-color: var(--color-green-60);
}

/* ============================================
   INPUT CHIP / TAG
   Based on Figma: ~88×40px with icon, ~70×40px without
   ============================================ */

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 4px 12px;
  background: var(--color-loading);
  border: 1px solid var(--color-gray-40);
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-gray-20);
  cursor: pointer;
  transition: all var(--transition-fast);
}

/* Chip - Hover: Dark background, white text */
.chip:hover {
  background-color: var(--color-gray-20);
  border-color: var(--color-gray-20);
  color: var(--color-white);
}

/* Chip with close icon - icon goes FIRST */
.chip__icon {
  width: 10.5px;
  height: 10.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  order: -1; /* Icon always first */
}

.chip__icon svg {
  width: 100%;
  height: 100%;
}

.chip__text {
  padding-top: 2px;
}

/* ============================================
   CART BUTTON
   Based on Figma: 54×54px CIRCLE
   Badge: 18×18px positioned top-right inside circle
   ============================================ */

.cart-btn {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-gray-95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

/* Hover: Dark background, white icon */
.cart-btn:hover {
  background-color: var(--color-gray-20);
}

.cart-btn:hover .cart-btn__icon {
  color: var(--color-white);
}

.cart-btn:focus,
.cart-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 208, 120, 0.2);
}

.cart-btn__icon {
  width: 22px;
  height: 22px;
  color: var(--color-gray-20);
  transition: color var(--transition-fast);
}

/* Badge positioned at top-right corner of circle */
.cart-btn__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  background-color: var(--color-green-60);
  border-radius: 50%;
  font-family: var(--font-primary);
  font-size: 10px;
  font-weight: var(--font-bold);
  line-height: 1;
  color: var(--color-gray-20);
  display: flex;
  align-items: center;
  justify-content: center;
}


