#dynamic-fare-sale {
  width: 80%;
  margin: 0 auto;
  padding: 20px;
}
.dynamic-fare-sale-table {
  overflow: hidden;
  width: 100%;
  height: 50px;
  border-radius: 8px;
  border-width: 1px;
  border: 1px solid var(--neutrals-Medium-Gray, #d4d8d9);
}
.dynamic-fare-sale-title {
  text-align: left;
  color: var(--primary-Amtrak-Blue, #00537e);
  /* Web Desktop & Tablet/H1 */
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 140%;
  /* 39.2px */
}
.dynamic-fare-sale-description {
  color: #000;
  /* Web Desktop & Tablet/Subtitle2 */
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 150%;
  /* 21px */
}
/* Table Header */
.dynamic-fare-sale-table th {
  background-color: #00537e;
  padding: 12px 20px;
  width: 42px;
  height: 21px;
  top: 228px;
  margin-left: 239px;
  font-weight: 600;
  font-size: 14px;
  line-height: 21px;
  color: #FFFFFF;
  text-align: left;
}
/* Table Rows */
.dynamic-fare-sale-table tr:nth-child(even) {
  background-color: #FFFFFF;
}
.dynamic-fare-sale-table tr:nth-child(odd) {
  background-color: #FFFFFF;
}
.dynamic-fare-sale-table th.sorted-asc::after,
.dynamic-fare-sale-table th.sorted-desc::after {
  content: '';
  display: inline-block;
  /* Ensures it aligns inline with the text */
  width: 12px;
  height: 17px;
  margin-left: 5px;
  /* Space between the text and the icon */
  background-image: url('https://espanol.amtrak.com/sdbeta-aemtest/content/dam/projects/dotcom/hpr/icons/down-arrow.svg');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  vertical-align: middle;
  /* Aligns with the text vertically */
  transform: rotate(0deg);
  /* Default for ascending */
  cursor: pointer;
}
.dynamic-fare-sale-table th.sorted-desc::after {
  transform: rotate(-180deg);
  /* Rotates the icon for descending */
}
/* Font bold for selected header */
.dynamic-fare-sale-table th.sorted-asc,
.dynamic-fare-sale-table th.sorted-desc {
  font-weight: bold !important;
  /* Make the font weight bold for active headers */
}
/* Hover State */
.dynamic-fare-sale-table tr:hover {
  background: var(--primary-Button-Hover-Blue, #006aa3);
  color: white;
  cursor: pointer;
}
.dynamic-fare-sale-table tr:hover td span:nth-of-type(1),
.dynamic-fare-sale-table tr:hover td span:nth-of-type(2),
.dynamic-fare-sale-table tr:hover td span:nth-of-type(3),
.dynamic-fare-sale-table tr:hover td span:nth-of-type(4) {
  color: var(--neutrals-White, #ffffff);
}
/* Pressed State */
.dynamic-fare-sale-table tr:active {
  background: var(--primary-Dark-Blue, #002648);
  color: var(--neutrals-White, #ffffff);
}
.dynamic-fare-sale-table tr:active td span:nth-of-type(1),
.dynamic-fare-sale-table tr:active td span:nth-of-type(2),
.dynamic-fare-sale-table tr:active td span:nth-of-type(3),
.dynamic-fare-sale-table tr:active td span:nth-of-type(4) {
  color: var(--neutrals-White, #ffffff);
}
.click-price span:last-child,
.dynamic-fare-sale-price span:last-child {
  white-space: nowrap;
}
/* Table Cells */
.dynamic-fare-sale-table td {
  padding: 32px 0px 32px 20px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}
.dynamic-fare-sale-table td span:nth-of-type(1) {
  color: var(--primary-Hoffman-Blue, #002436);
  /* Web Desktop & Tablet/Overline */
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 150%;
  /* 18px */
  text-transform: uppercase;
}
.dynamic-fare-sale-table td span:nth-of-type(2) {
  color: var(--primary-Button-Blue, #167fa6);
  /* Web Desktop & Tablet/H1 */
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 140%;
  /* 39.2px */
}
.dynamic-fare-sale-table td span:nth-of-type(3) {
  color: #000;
  /* Web Desktop & Tablet/Caption 2 */
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  line-height: 160%;
  /* 16px */
}
.dynamic-fare-sale-table td span:nth-of-type(4) {
  color: #000;
  /* Web Desktop & Tablet/Caption 2 */
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  line-height: 160%;
  /* 16px */
}
/* Responsive Table Design */
@media screen and (max-width: 768px) {
  .dynamic-fare-sale-table {
    width: 100%;
    border-collapse: collapse;
  }
  .dynamic-fare-sale-table th {
    background-color: #00537e;
    padding: 12px 20px;
    min-width: 120px;
    /* Ensure a reasonable minimum width */
    height: 21px;
    font-weight: 600;
    font-size: 14px;
    line-height: 21px;
    color: #FFFFFF;
    text-align: left;
    white-space: nowrap;
    /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Adds "..." if text is too long */
  }
}
.popup-overlay {
  visibility: hidden;
}
.popup-content {
  visibility: hidden;
}
.popup-overlay.active {
  visibility: visible;
}
.popup-content.active {
  visibility: visible;
}
/* Modal container */
.dynamic-fare-sale-modal {
  display: none;
  /* Hidden by default */
  position: absolute;
  /* Stay in place */
  z-index: 1;
  /* Sit on top */
  left: 0;
  /* top: 180px; */
  width: 100%;
  /* Full width */
  height: 100%;
  /* Full height */
  overflow: hidden;
  justify-content: center;
  /* Enable scroll if needed */
  /* background-color: #000000; */
  /* Fallback color */
  /* background-color: rgba(0, 0, 0, 0.4); */
  /* Black w/ opacity */
}
/* Modal content */
.dynamic-fare-sale-modal-content {
  width: calc(90%);
  align-items: center;
  overflow: hidden;
  height: 355px;
  position: absolute;
  flex-shrink: 0;
  border-radius: 3px;
  background: #FFF;
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25);
  background-color: #fefefe;
  /* 15% from the top and centered */
  padding: 20px;
  /*
    border: 1px solid #888;
     Could be more or less, depending on screen size */
}
.dynamic-fare-sale-modal-content h3 {
  position: relative;
}
/* Sort & Filter styles */
.dynamic-fare-sale-modal-content h3::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 0;
  width: 13px;
  height: 17px;
  transform: rotate(180deg);
  background-image: url('https://espanol.amtrak.com/sdbeta-aemtest/content/dam/projects/dotcom/hpr/icons/am-dropdown-chevron.svg');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
}
.dynamic-fare-sale-modal-content form label {
  display: block;
  margin: 10px 0;
}
.dynamic-fare-sale-modal-content form input[type="radio"] {
  margin-right: 10px;
  border: 1px #002436 solid !important;
}
.dynamic-fare-sale-modal-content button {
  display: block;
  padding: 10px 20px;
  background-color: #00537e;
  color: white;
  border: none;
  cursor: pointer;
}
.dynamic-fare-sale-modal-content button:hover {
  background-color: #00537e;
}
/* Sort & Filter Button */
.dynamic-fare-sale-sort-filter-button-container {
  display: none;
}
.dynamic-fare-sale-cards-container {
  display: none;
}
@media (min-width: 576px) and (max-width: 767.98px) {
  #dynamic-fare-sale {
    width: 100%;
  }
}
/* Mobile view styles */
@media (max-width: 576px) {
  #dynamic-fare-sale {
    width: 100%;
  }
  .dynamic-fare-sale-table {
    display: none;
    /* Hide the table on mobile view */
  }
  .dynamic-fare-sale-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .dynamic-fare-sale-card {
    width: 100%;
    display: flex;
    border-radius: 8px;
    border: 1px solid var(--neutrals-Medium-Gray, #d4d8d9);
    padding: 14px;
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-details {
    flex: 1;
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-details .dynamic-fare-sale-detail-item {
    color: var(--primary-Hoffman-Blue, #002436);
    font-size: 12px;
    font-style: normal;
    line-height: 150%;
    /* 18px */
    padding: 3px;
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-details .dynamic-fare-sale-detail-item:nth-of-type(1),
  .dynamic-fare-sale-card .dynamic-fare-sale-details .dynamic-fare-sale-detail-item:nth-of-type(2) {
    position: relative;
    font-weight: 600;
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-details .dynamic-fare-sale-detail-item:nth-of-type(3),
  .dynamic-fare-sale-card .dynamic-fare-sale-details .dynamic-fare-sale-detail-item:nth-of-type(4) {
    font-weight: 400;
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-price span:nth-of-type(1) {
    color: var(--primary-Hoffman-Blue, #002436);
    text-align: right;
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    /* 18px */
    text-transform: uppercase;
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-price span:nth-of-type(2) {
    color: var(--primary-Button-Blue, #167fa6);
    text-align: right;
    /* Web Mobile/H1 */
    font-size: 22px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    /* 30.8px */
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-price span:nth-of-type(3) {
    color: #000;
    text-align: right;
    /* Web Mobile/Caption */
    font-size: 10px;
    font-style: normal;
    font-weight: 400;
    line-height: 160%;
    /* 16px */
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-price span:nth-of-type(4) {
    color: #000;
    text-align: right;
    /* Web Mobile/Caption */
    font-size: 10px;
    font-style: normal;
    font-weight: 400;
    line-height: 160%;
    /* 16px */
  }
  .dynamic-fare-sale-sort-modal {
    margin-top: 20px;
    display: flex;
    width: 100%;
    justify-content: space-between;
  }
  .dynamic-fare-sale-sort-filter-button-container {
    display: flex;
    position: relative;
    color: var(--colors-primary-Hoffman-Blue, #002436);
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    justify-content: right;
  }
  .dynamic-fare-sale-sort-filter-button-container ::before {
    display: none;
    content: '1';
    position: absolute;
    top: 0px;
    margin-left: -21px;
    width: 14px;
    height: 14px;
    fill: var(--primary-Button-Blue, #167fa6);
    background-image: url('https://espanol.amtrak.com/sdbeta-aemtest/content/dam/projects/dotcom/hpr/icons/ellipse.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    color: var(--neutrals-White, #ffffff);
    text-align: center;
    padding-left: 3px;
    padding-bottom: 15px;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
  }
  .dynamic-fare-sale-sort-filter-button-container ::after {
    content: '';
    position: absolute;
    top: 0px;
    margin-left: 5px;
    width: 12px;
    height: 17px;
    background-image: url('https://espanol.amtrak.com/sdbeta-aemtest/content/dam/projects/dotcom/hpr/icons/am-dropdown-chevron.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
  }
  .dynamic-fare-sale-sort-filter-button-container.show-before ::before {
    display: flex;
  }
  .dynamic-fare-sale-card .dynamic-fare-sale-details .dynamic-fare-sale-detail-item:nth-of-type(1)::after {
    content: '';
    position: absolute;
    top: 3px;
    margin-left: 15px;
    width: 24px;
    height: 20px;
    background-image: url('https://espanol.amtrak.com/sdbeta-aemtest/content/dam/projects/dotcom/hpr/icons/one-way-arrow.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
  }
  .dynamic-fare-sale-modal-content h3 {
    color: var(--primary-Dark-Blue, #002648);
    /* Web Desktop & Tablet/Subtitle1 */
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    /* 24px */
    border-bottom: 1px solid var(--neutrals-Medium-Gray, #d4d8d9);
    padding-bottom: 8px;
    text-align: left;
  }
  .dynamic-fare-sale-modal-content p {
    color: var(--primary-Dark-Blue, #002648);
    /* Web Desktop & Tablet/Subtitle2 */
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    margin-top: 15px;
    opacity: 0.75;
  }
  #dynamic-fare-sale-sort-button {
    color: var(--colors-primary-Hoffman-Blue, #002436);
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    padding-bottom: 13px;
    width: 75px;
  }
  .dynamic-fare-sale-sort-input {
    color: var(--primary-Dark-Blue, #002648);
    /* Web Desktop & Tablet/Body1 */
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 160%;
    padding-top: 10px;
    width: 100%;
    box-sizing: border-box;
  }
  #dynamic-fare-sale-sort-options-form {
    display: flex;
    flex-wrap: wrap;
    margin-left: 0px;
    margin-top: -9px;
  }
  .dynamic-fare-sale-sort-input [type=radio]:checked + label,
  [type=radio]:not(:checked) + label {
    color: #002648;
  }
  .dynamic-fare-sale-sort-input [type=radio]:checked + label:after {
    background: #002436;
  }
  .dynamic-fare-sale-sort-input:last-child {
    color: var(--primary-Dark-Blue, #002648);
    width: 50%;
  }
  #dynamic-fare-sale-clear-sort-filter {
    color: #167FA6;
    text-align: center;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    background-color: unset;
    display: unset;
    padding-left: 30px;
  }
  #dynamic-fare-sale-apply-sort-filter {
    display: inline-flex;
    min-width: 132px;
    min-height: 40px;
    max-height: 40px;
    padding: var(--Space-2x, 16px);
    justify-content: center;
    align-items: center;
    gap: 16px;
    border-radius: 4px;
    background: var(--primary-Button-Blue, #167fa6);
  }
}
