/* ==========================================================================
   FORMS CSS - Form Elements và Input Styles
   ========================================================================== */

/* Form Buy Styles */
.form-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--Space-8, 32px);
  flex: 1 0 0;
}

.form-buy .product-name {
  display: flex;
  padding: var(--Space-4, 16px) var(--Space-2, 8px)
    var(--space-spacer-1-rem, 16px) var(--Space-2, 8px);
  justify-content: center;
  align-items: center;
  gap: 10px;
  align-self: stretch;
  color: var(--On-background-Brand-Default, #231f20);
  /* Title/Sans/Large */
  font-family: var(--Type-Font-Display, "Crimson Text");
  font-size: var(--Title-Page-Size-Large, 56px);
  font-style: normal;
  font-weight: var(--Title-Page-Font-Weight, 700);
  line-height: 120%; /* 67.2px */
  text-transform: uppercase;
}

/* Quantity Input */
.form-buy .quantity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--Space-2, 8px);
}

.form-buy .quantity-input {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: fit-content;
  padding: 6px 12px;
  font-family: sans-serif;
}

.form-buy .quantity-number {
  margin: 0 16px;
  font-size: 18px;
  font-weight: bold;
  min-width: 20px;
  text-align: center;
}

/* Colors Selection */
.colors {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--Space-2, 8px);
}

.colors .title {
  color: var(--On-background-Brand-Default, #231f20);
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Medium, 16px);
  font-style: normal;
  font-weight: var(--Body-Font-Weight-Strong, 600);
  line-height: 140%;
}

.colors .list-color {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.list-color .item {
  height: 76.847px;
  align-self: stretch;
  aspect-ratio: 110/76.85;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.list-color .select {
  border: 1px solid rgb(11, 126, 239);
}

.information-product .nav-tabs .nav-link {
  border: none;
  color: #333;
  font-weight: 500;
}

.information-product .nav-tabs .nav-link.active {
  color: #000;
  border-bottom: 3px solid #000;
}

.information-product .nav-tabs .nav-link:hover {
  color: #000;
}

.tab-pane {
  padding-top: 1rem;
}

/* Product Filter */
.product-filter {
  display: flex;
  padding: var(--Space-10, 40px);
  align-items: flex-start;
  gap: var(--Space-10, 40px);
  align-self: stretch;
}

/* Mobile responsive for product filter */
@media (max-width: 575px) {
  .product-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--Space-5, 20px);
    align-self: stretch;
    padding: 0;
  }

  /* Làm cho cả col-3 và col-9 full width trên mobile */
  .product-filter .col-3,
  .product-filter .col-9 {
    padding: var(--Space-4, 16px);
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  /* Filter box full width on mobile */
  .filter-box {
    width: 100%;
    max-width: none;
  }
}

/* Tablet responsive for product filter */
@media (min-width: 576px) and (max-width: 991px) {
  .product-filter {
    display: flex;
    flex-direction: column;
    padding: var(--Space-10, 40px);
    align-items: center;
    gap: var(--Space-5, 40px);
    align-self: stretch;
    padding: 0;
  }
  /* Làm cho cả col-3 và col-9 full width trên mobile */
  .product-filter .col-3 {
    padding: var(--Space-5, 20px);
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }
  .product-filter .col-9 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  /* Filter box full width on mobile */
  .filter-box {
    width: 100%;
    max-width: none;
  }
}

.filter-box {
  display: flex;
  width: 100%;
  background: #fff;
  border: none;
  padding: 0;
  gap: var(--Space-2, 8px);
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

/* Filter Header */
.filter-box .filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid #e0dbd2;
  padding: 0 var(--Space-1, 4px) var(--Space-2, 8px) var(--Space-1, 4px);
  align-self: stretch;
  border-bottom: 0.5px solid var(--On-background-Global-Default, #8f888a);
}

.filter-box .filter-header .filter-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-box .filter-header h5 {
  color: var(--On-background-Brand-Default, #231f20);
  text-align: center;
  /* Single_Line/BASE/Strong - Allcaps */
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Medium, 18px);
  font-style: normal;
  font-weight: var(--Body-Font-Weight-Strong, 600);
  line-height: 140%; /* 25.2px */
  letter-spacing: -0.72px;
  text-transform: uppercase;
}

.filter-box .filter-header .filter-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%) invert(11%) sepia(7%) saturate(1158%)
    hue-rotate(314deg) brightness(97%) contrast(91%);
}

/* Filter Sections */
.filter-box .section {
  width: 100%;
  display: flex;
  padding: var(--Space-2, 8px);
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-spacer-1-rem, 16px);
  align-self: stretch;
}

.filter-box .section + .section {
  border-top: 1px solid #8f888a;
}

/* Collapse Header */
.filter-box .section-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.filter-box .section-header .primary-text.text-strong {
  margin: 0;
  color: var(--On-background-Brand-Default, #231f20);
  /* Single_Line/BASE/Strong */
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Medium, 18px);
  font-style: normal;
  font-weight: var(--Body-Font-Weight-Strong, 600);
  line-height: 140%; /* 25.2px */
}

.filter-box .toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: var(--Stroke-Forcus-ring, 2px) solid
    var(--On-background-Stroke-Primary, #8f888a);
  border-radius: 50%;
  transition: transform 0.3s ease;
  padding: var(--spacers-3, 12px);
}

.filter-box .toggle-icon img {
  width: 20px;
  height: 20px;
  filter: brightness(0) saturate(100%) invert(11%) sepia(7%) saturate(1158%)
    hue-rotate(314deg) brightness(97%) contrast(91%);
}

.collapse.show + .toggle-icon {
  transform: rotate(180deg);
}

/* Section header toggle icon animation */
.filter-box .section-header[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

/* Form Controls */
.filter-box .section-body {
  margin-left: 10px;
}

.filter-box .section-body .form-check {
  margin-bottom: 16px;
}

.filter-box .section-body .form-check-label {
  color: var(--On-background-Brand-Default, #231f20);
  /* Single_Line/BASE/Regular */
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Medium, 16px);
  font-style: normal;
  font-weight: var(--Body-Font-Weight-Regular, 400);
  line-height: 150%; /* 24px */
  letter-spacing: -0.16px;
}

/* Custom Radio Button */
.filter-box .section-body .form-check {
  display: flex;
  align-items: center;
}

.filter-box .section-body .form-check-input[type="radio"] {
  width: 20px;
  height: 20px;
  border: 2px solid var(--On-background-Stroke-Primary, #8f888a);
  border-radius: 50%;
  background-color: transparent;
  background-image: none;
  margin-right: 8px;
  margin-top: 0;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-box .section-body .form-check-input[type="radio"]:checked {
  background-color: transparent;
  border-color: var(--On-background-Brand-Default, #231f20);
  background-image: url("/images/Knob.svg");
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-position: center;
}

.filter-box .section-body .form-check-input[type="radio"]:focus {
  box-shadow: 0 0 0 0.25rem rgba(35, 31, 32, 0.25);
}

/* Discount Switch Section */
.filter-box .discount-section {
  display: flex;
  width: 100%;
  height: 72px;
  max-height: 72px;
  padding: var(--space-spacer-1-rem, 16px) var(--Space-2, 16px);
  justify-content: space-between;
  align-items: center;
}

/* Custom Toggle Switch */
.filter-box .form-switch {
  padding: 0;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.filter-box .discount-section .form-check-label {
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.filter-box .form-switch .form-check-input {
  display: flex;
  width: 48px;
  height: 24px;
  padding: 3px 3px 3px var(--Space-5, 20px);
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  border-radius: var(--Radius-pill, 999px);
  border: var(--Stroke-Border, 1px) solid
    var(--On-background-Stroke-Primary, #8f888a);
  background: var(--Background-Global-Primary, #fefdf9);
  background-image: none;
  position: relative;
  cursor: pointer;
}

.filter-box .form-switch .form-check-input::before {
  content: "";
  width: 18px;
  height: 18px;
  background: #8f888a;
  border-radius: 50%;
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}

.filter-box .form-switch .form-check-input:checked {
  background: var(--Background-Global-Primary, #fefdf9);
  border-color: var(--On-background-Stroke-Primary, #8f888a);
}

.filter-box .form-switch .form-check-input:checked::before {
  background-image: url("/images/Knob.svg");
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  left: calc(100% - 21px);
}

/* Price Filter */
.price-filter {
  width: 100%;
  margin: 0;
  min-height: 80px;
}

/* Price Filter Label */
.price-filter__label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--On-background-Brand-Default, #231f20);
  /* Single_Line/BASE/Strong */
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Medium, 18px);
  font-style: normal;
  font-weight: var(--Body-Font-Weight-Strong, 600);
  line-height: 140%; /* 25.2px */
}

/* Price Filter Values */
.price-filter__values {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.price-filter__values span {
  text-align: right;
}

/* Currency Value (số) */
.currency-value {
  color: var(--On-background-Brand-Default, #231f20);
  /* Single_Line/Large/Regular */
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Large, 20px);
  font-style: normal;
  font-weight: var(--Body-Font-Weight-Regular, 400);
  line-height: 140%; /* 28px */
  letter-spacing: 0.2px;
}

/* Currency Symbol (đ) */
.currency-symbol {
  color: var(--On-background-Brand-Default, #231f20);
  /* Single_Line/Large/Underline */
  font-family: var(--Type-Font-Serif, "Plus Jakarta Sans");
  font-size: var(--Body-Size-Large, 20px);
  font-style: normal;
  font-weight: var(--Body-Font-Weight-Regular, 400);
  line-height: 140%; /* 28px */
  letter-spacing: 0.2px;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-skip-ink: auto;
  text-decoration-thickness: auto;
  text-underline-offset: auto;
  text-underline-position: from-font;
}

.price-filter__slider {
  margin: 16px 0 0 10px;
  height: 20px;
  width: calc(100% - 10px);
  display: block;
}

/* jQuery UI Slider Styling */
.ui-slider {
  position: relative;
  text-align: left;
  background: var(--Background-Utilities-Blanket, rgba(35, 31, 32, 0.1));
  border: none;
  height: 8px;
  border-radius: var(--sds-size-radius-full);
}

.ui-slider .ui-slider-handle {
  position: absolute;
  z-index: 2;
  width: 20px;
  height: 20px;
  cursor: pointer;
  background: var(--On-background-Brand-Default, #231f20);
  border: none;
  border-radius: 50%;
  top: -6px;
  margin-left: -10px;
  outline: none;
  transition: transform 0.1s;
}

.ui-slider .ui-slider-handle:hover,
.ui-slider .ui-slider-handle:focus {
  transform: scale(1.1);
}

.ui-slider .ui-slider-range {
  position: absolute;
  z-index: 1;
  font-size: 0.7em;
  display: block;
  border: none;
  background: var(--On-background-Brand-Default, #231f20);
  height: 8px;
  top: 0;
  border-radius: var(--sds-size-radius-full);
}

.ui-slider-horizontal .ui-slider-range {
  height: 100%;
}

/* Mobile responsive - Change title font sizes to 16px */
@media (max-width: 575px) {
  .form-buy .product-name {
    font-size: var(--Title-Page-Size-Medium, 32px);
  }
  .filter-box .filter-header h5 {
    font-size: 16px;
  }

  .filter-box .section-header .primary-text.text-strong {
    font-size: 16px;
  }

  .price-filter__label {
    font-size: 16px;
  }

  /* Filter content full width on mobile */
  #mobile-filter-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Full width for all filter sections on mobile */
  .filter-box .section,
  .filter-box .discount-section,
  .filter-box .price-filter {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Filter header mobile styling */
  .filter-box .filter-header {
    cursor: pointer;
    padding: var(--Space-4, 16px) var(--Space-2, 8px);
    justify-content: space-between;
  }

  .filter-box .filter-header .toggle-icon {
    transition: transform 0.3s ease;
  }

  .filter-box .filter-header[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
  }
}

/* Tablet responsive - Change title font sizes to 16px */
@media (min-width: 576px) and (max-width: 991px) {
  .form-buy .product-name {
    font-size: var(--Title-Page-Size-Medium, 32px);
  }
  .filter-box .filter-header h5 {
    font-size: 16px;
  }

  .filter-box .section-header .primary-text.text-strong {
    font-size: 16px;
  }

  .price-filter__label {
    font-size: 16px;
  }

  /* Filter content full width on tablet */
  #mobile-filter-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Full width for all filter sections on tablet */
  .filter-box .section,
  .filter-box .discount-section,
  .filter-box .price-filter {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Filter header tablet styling */
  .filter-box .filter-header {
    cursor: pointer;
    padding: var(--Space-4, 16px) var(--Space-2, 8px);
    justify-content: space-between;
  }

  .filter-box .filter-header .toggle-icon {
    transition: transform 0.3s ease;
  }

  .filter-box .filter-header[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
  }
}

/* Desktop responsive - Full width */
@media (min-width: 992px) {
  /* Filter content full width on desktop */
  #mobile-filter-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Full width for all filter sections on desktop */
  .filter-box .section,
  .filter-box .discount-section,
  .filter-box .price-filter {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Ensure filter-box itself is full width */
  .filter-box {
    width: 100% !important;
    max-width: 100% !important;
  }
}
