/* =========================================
   TakeLoot Offers Page
   Scoped to the offers landing page only.
========================================= */

.tl-offers-page {
  --tl-op-panel: var(--custom-base, #111222);
  --tl-op-panel-soft: rgba(255, 255, 255, 0.035);
  --tl-op-panel-raised: rgba(255, 255, 255, 0.055);
  --tl-op-line: rgba(185, 171, 223, 0.18);
  --tl-op-muted: var(--brand-gray, #a8a5bd);
  --tl-op-text: var(--brand-off-white, #f6f3ff);
  --tl-op-purple: var(--brand-color, #9944ff);
  --tl-op-purple-soft: rgba(153, 68, 255, 0.14);
  width: 100%;
  min-width: 0;
  color: var(--tl-op-text);
}

/* Search and filters */

.tl-offers-toolbar {
  position: relative;
  z-index: 8;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  overflow: visible;
  align-items: center;
}

.tl-offers-search {
  display: flex;
  align-items: center;

  gap: 0.5rem;

  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  color: var(--brand-gray);
  background-color: var(--custom-base);
  background-clip: padding-box;

  border: 1px solid var(--brand-line);
  border-radius: var(--brand-round-pill);

  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.tl-offers-search:focus-within {
  border-color: var(--brand-alpha-40);
  background: var(--brand-dark-bg);
}
.tl-offers-provider-search > i,
.tl-offers-search > i {
  flex: 0 0 auto;
  font-size: 1rem;
}

.tl-offers-search input {
  width: 100%;
  min-width: 0;
  padding: 0.7rem 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tl-op-text);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: none !important;
}

.tl-offers-search input::placeholder {
  color: var(--brand-gray);
  opacity: 1;
}

.tl-offers-search input::-webkit-search-cancel-button {
  display: none;
}

.tl-offers-search > button {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 1.9rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #c1bdd5;
}

.tl-offers-search > button:hover {
  background: rgba(153, 68, 255, 0.18);
  color: #fff;
}

.tl-offers-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 0.5rem;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;

  border: 1px solid var(--brand-line);
  border-radius: var(--brand-round-pill);

  background-color: var(--custom-base);
  background-clip: padding-box;

  color: var(--brand-gray);

  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

.tl-offers-control:hover,
.tl-offers-control[aria-expanded="true"] {
  border-color: var(--brand-50);
  background: var(--brand-10);
  color: #fff;
}

.tl-offers-control > i:first-child {
  color: var(--brand-color);
  font-size: 1rem;
}

.tl-offers-chevron {
  font-size: 0.875rem;
}

.tl-offers-control-count {
  display: inline-grid;
  place-items: center;

  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.25rem;

  border-radius: var(--brand-round-xs);
  border: 1px solid var(--brand-line);
  background: var(--brand-40);

  color: var(--brand-soft);
  font-size: 0.75rem;
  font-weight: 600;
}

.tl-offers-reset-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  margin-left: auto;
  padding: 0.45rem 0.6rem;
  border: 0;
  background: transparent;
  color: var(--tl-op-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 160ms ease;
}

.tl-offers-reset-control:hover {
  color: #e7d6ff;
}

.tl-offers-reset-control i {
  color: #ae80ff;
}

/* Dropdowns */
.tl-offers-dropdown {
  position: relative;
}

.tl-offers-dropdown-menu {
  min-width: 12rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  margin-top: 0.5rem !important;
  padding: 0.75rem;
}

/* Individual options */
.tl-offers-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  width: 100%;
  min-height: 2.5rem;
  margin: 2px 0;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;

  border: 1px solid transparent;
  border-radius: var(--brand-round-xs);
  background: transparent;

  color: var(--brand-gray);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

/* Option icons */
.tl-offers-dropdown-menu .dropdown-item > i:first-child {
  flex: 0 0 1.1rem;
  color: var(--brand-color);
  font-size: 1rem;
  text-align: center;
}

/* Hover and selected option */
.tl-offers-dropdown-menu .dropdown-item:hover,
.tl-offers-dropdown-menu .dropdown-item.active {
  background: var(--brand-20);
  color: #fff;
}

/* Selected checkmark */
.tl-offers-option-check {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--brand-color);
}

/* Keep the provider menu at its intended size */
.tl-offers-dropdown-menu.tl-offers-provider-menu {
  min-width: 18.5rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  margin-top: 0.5rem !important;
  padding: 0.75rem;

  z-index: 600;
}
.tl-offers-dropdown-menu,
.tl-offers-provider-menu {
  border-radius: var(--brand-round-lg);
  box-shadow: 0 18px 45px rgb(0 0 0 / 80%);
}

/* Provider selector */
.tl-offers-provider-menu {
  width: min(21rem, calc(100vw - 2rem));
  min-width: min(19rem, calc(100vw - 2rem));
  max-height: min(75vh, 35rem);
  padding: 0.8rem;
  overflow: hidden;
}

.tl-offers-provider-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0.1rem 0.8rem;
  border-bottom: 1px solid var(--tl-op-line);
}

.tl-offers-provider-menu-head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tl-offers-provider-menu-head strong {
  color: #f3edff;
  font-size: 1rem;
  font-weight: 700;
}

.tl-offers-provider-menu-head span {
  color: var(--brand-gray);
  font-size: 0.872rem;
}

.tl-offers-provider-menu-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.15rem;
}

.tl-offers-provider-menu-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-color);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.tl-offers-provider-menu-actions button:hover {
  color: #fff;
}

.tl-offers-provider-menu-actions span {
  width: 1px;
  height: 0.9rem;
  background: var(--tl-op-line);
}

/* Provider filter submission */
.tl-offers-provider-menu-footer {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--tl-op-line);
}

.tl-offers-provider-menu-footer button {
  min-height: 2.5rem;
  justify-content: center;
}

.tl-offers-provider-search {
  margin: 0.75rem 0 0.45rem;

  display: flex;
  align-items: center;

  gap: 0.5rem;

  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  color: var(--brand-gray);
  background-color: var(--custom-base);
  background-clip: padding-box;

  border: 1px solid var(--brand-line);
  border-radius: var(--brand-round-sm);

  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.tl-offers-provider-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f5f1ff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: none !important;
}

.tl-offers-provider-search input::placeholder {
  color: var(--brand-gray);
}

.tl-offers-provider-list {
  max-height: min(52vh, 25rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(153, 68, 255, 0.5) transparent;
}

.tl-offers-provider-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  width: 100%;
  min-height: 2.5rem;
  margin: 2px 0;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;

  border: 1px solid transparent;
  border-radius: var(--brand-round-xs);
  background: transparent;

  color: var(--brand-gray);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.tl-offers-provider-option:hover {
  background: var(--brand-20);
  color: #fff;
}

.tl-offers-provider-option input {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  margin: 0;
  accent-color: var(--brand-color);
  cursor: pointer;
}

.tl-offers-provider-name {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-offers-provider-count {
  margin-left: auto;

  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.25rem;

  border-radius: var(--brand-round-xs);
  border: 1px solid var(--brand-line);
  background: var(--brand-40);

  color: var(--brand-soft);
  font-size: 0.75rem;
  font-weight: 600;

  display: flex;
  align-items: center;
  justify-content: center;
  align-content: stretch;
}

.tl-offers-provider-empty {
  padding: 1rem 0.5rem;
  color: var(--tl-op-muted);
  font-size: 0.82rem;
  text-align: center;
}

.tl-offers-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

/* Results heading and loading state */

.tl-offers-results-section {
  min-width: 0;
}

.tl-offers-results-wrap {
  position: relative;
  padding-top: 1rem;
  margin-top: 1rem;
}

.tl-offers-results-live,
.tl-offers-results-count {
  width: 100%;

  text-align: center;
  color: var(--brand-gray);
  font-size: 0.875rem;
  font-weight: 600;

  position: absolute;
  top: 0;
}

.tl-offers-results-live {
  gap: 0.5rem;
  transition: opacity 0.2s ease;
  opacity: 0;
}

.tl-offers-results-live i {
  font-size: 1rem;
  animation: tlOffersSpin 1s linear infinite;
}

.tl-offers-results-live.is-loading {
  opacity: 1;
}

/* Hide results count while parent Livewire filtering is active */
.tl-offers-results-wrap:has(> .tl-offers-results-live.is-loading)
  .tl-offers-results-count {
  display: none !important;
}

@keyframes tlOffersSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Align the existing offer grid with the new page shell without altering offer cards. */
.tl-offers-page .offer-api-card {
  margin: 1.5rem auto !important;
}

/* Responsive layout */

@media (max-width: 767.98px) {
  .tl-offers-toolbar {
    flex-direction: column;
  }
  .tl-offers-toolbar-area-2 {
    display: flex;
    width: 100%;
    justify-content: flex-end;
  }
  .tl-offers-dropdown,
  .tl-offers-dropdown .tl-offers-control {
    width: 100%;
    min-width: 0;
  }

  .tl-offers-reset-control {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .tl-offers-dropdown,
  .tl-offers-dropdown .tl-offers-control {
    width: 100%;
    min-width: 0;
  }

  .tl-offers-control {
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .tl-offers-control > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tl-offers-reset-control {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-left: 0;
  }
}

/* =========================================
   Offers Grid — Responsive Card Sizing
========================================= */

.offers-section .offer-api-card {
  width: 100%;
  justify-items: stretch;
}

/* Fill each grid column without changing the card design */
.offers-section .offer-api-card .tl-offer-card {
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 3 / 4;
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  .tl-offers-page *,
  .tl-offers-page *::before,
  .tl-offers-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* =========================================
   End Offers Grid — Responsive Card Sizing
========================================= */

/* =========================================
   Offer Category Swiper
========================================= */

/* Prevent the page container from overflowing */
.container-fluid.flex-grow-1.container-p-y:has(.tl-offers-page) {
  min-width: 0;
  max-width: 100%;
}

/* Keep the Offers heading within the available width */
.tl-offers-page .offers-heading {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.tl-offers-toolbar-area-1 {
  width: 100%;
}

.tl-offers-toolbar-area-1,
.tl-offers-toolbar-area-2 {
  display: flex;
  gap: 0.5rem;
}

.tl-offers-page .offers-heading > .d-flex {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.tl-offers-toolbar .offers-device-filter {
  display: flex;
}

/* Carousel takes only the remaining space */
.tl-offers-page .tl-offers-category-carousel {
  flex: 1 1 0;
  width: 0;
  max-width: 100%;
  min-width: 0;
}

/* Reset filter icon */
.tl-reset-filters i {
  display: inline-block;
  transition: color 0.2s ease;
}

/* Hover color */
.tl-reset-filters:hover i {
  color: var(--brand-color);
}

/* Spin 3 times when clicked */
.tl-reset-filters i.is-spinning {
  animation: tl-reset-icon-spin 0.4s ease-in-out 6;
}

@keyframes tl-reset-icon-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .tl-reset-filters i.is-spinning {
    animation: none;
  }
}

/* Carousel frame and navigation */
.tl-offers-page .tl-offers-category-track {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
  /* border: 1px solid red; */
}

/* Swiper viewport */
.tl-offers-page .tl-offers-category-swiper {
  flex: 1 1 0;
  width: 0;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0 !important;

  padding-left: 0.5rem;
  left: -0.5rem;
  padding-right: 2.5em;
}

/* Apply the fade only when category overflow exists */
.tl-offers-page
  .tl-offers-category-track.has-overflow
  .tl-offers-category-swiper {
  --tl-offers-category-swiper-fade-size: clamp(2.5rem, 8vw, 5rem);

  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 0.5rem,
    #000 calc(100% - var(--tl-offers-category-swiper-fade-size)),
    transparent 100%
  );

  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 0.5rem,
    #000 calc(100% - var(--tl-offers-category-swiper-fade-size)),
    transparent 100%
  );
}

/* Reset old category-strip scrolling styles inside Swiper */
.tl-offers-page .tl-offers-category-swiper .tl-offers-category-strip {
  display: flex;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  align-items: stretch;
}

/* Individual slides */
.tl-offers-page .tl-offers-category-slide {
  flex: 0 0 auto;
  width: auto !important;
  height: auto;
  margin-block: 0;
}

/* Category buttons */
.tl-offers-page .tl-offers-category-slide .tl-offers-category {
  display: inline-flex;
  gap: 0.25rem;
  width: auto;
  padding: 0.5rem 0.75rem;
  border-radius: var(--brand-round-sm);
  color: var(--brand-gray, #aaa5c4);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s ease;
  align-items: center;
  margin-right: 0.5rem;
}

.tl-offers-page .tl-offers-category-slide .tl-offers-category:hover {
  color: #fff;
  transform: scale(0.98);
}
.tl-offers-page .tl-offers-category-slide .tl-offers-category:active {
  transform: scale(0.95);
}
.tl-offers-page .tl-offers-category-slide .tl-offers-category.is-active i,
.tl-offers-page .tl-offers-category-slide .tl-offers-category.is-active {
  color: #fff;
  border-color: var(--brand-alpha-50);
  background: linear-gradient(
    135deg,
    var(--brand-btn-g-start),
    var(--brand-btn-g-end)
  ) !important;
}

/* Category icon and emoji*/
.tl-offers-page .tl-offers-category-emoji,
.tl-offers-page .tl-offers-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;

  width: 1.25rem;
  height: 1.25rem;
  color: var(--brand-color);

  font-size: 1rem;
  line-height: 1;
}

/* Category text */
.tl-offers-page .tl-offers-category-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.tl-offers-page .tl-offers-category-copy strong {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Next-category button */
.tl-offers-page .tl-offers-category-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;

  border: 0;

  background: unset;
  color: var(--brand-soft);
  border-radius: var(--brand-round-sm);
  cursor: pointer;

  position: absolute;
  right: 0;
  z-index: 2;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(4px);

  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

/* Always show navigation when categories overflow */
.tl-offers-page
  .tl-offers-category-track.has-overflow
  .tl-offers-category-next {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.tl-offers-page .tl-offers-category-next i {
  font-size: 1rem;
  animation: tl-offers-chevron-pulse 1.4s ease-in-out infinite;
}

.tl-offers-page .tl-offers-category-next:hover {
  background: var(--brand-color);
  color: #fff;
}

@keyframes tl-offers-chevron-pulse {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.65;
  }

  50% {
    transform: translateX(3px);
    opacity: 1;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .tl-offers-page .tl-offers-category-carousel {
    flex: 1 1 100%;
    width: 100%;
  }

  .tl-offers-page .tl-offers-category-slide .tl-offers-category {
    min-height: 38px;
    gap: 7px;
    padding: 6px 10px;
  }

  .tl-offers-page .tl-offers-category-copy strong {
    font-size: 0.8rem;
  }

  .tl-offers-page .tl-offers-category-next {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }
  .tl-offers-toolbar .offers-device-filter {
    height: unset;
  }
  .tl-offers-toolbar .offers-device-filter .btn {
    width: 2.5rem;
  }

  .tl-offers-toolbar .offers-device-filter svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .tl-offers-page .tl-offers-category-next i {
    animation: none;
  }
}
/* =========================================
   End Offer Category Swiper
========================================= */
