/* =========================================================
   DEALS GRID
   - self-contained grid (no Oxygen repeater required)
   - stable cards, hover image scale, RTL-safe
========================================================= */

/* Oxygen wrapper normalization for this specific section */
#deals-category-inner-wrapper{
  display: block;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  box-sizing: border-box;

  /* helps if the parent is flex/grid */
  flex: 1 1 auto;
  justify-self: stretch;
  align-self: stretch;
}

/* UL reset + grid layout */
.deals-grid{
  margin: 0;
  padding: 0;
  list-style: none;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-m);
}

/* responsive */
@media (max-width: 1120px){
  .deals-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  .deals-grid{ grid-template-columns: 1fr; }
}

/* LI reset */
.deals-grid__item{
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Card link wrapper */
.deals-grid__link{
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;

  align-items: flex-start;
  text-align: right;
  text-decoration: none;

  color: inherit;
}

/* Ensure RTL-friendly alignment (even if some parent sets center/left) */
.deals-grid__link,
.deals-grid__title{
  text-align: right;
}

/* Stable image height to prevent uneven cards */
.deals-grid__img,
.deals-grid__img--placeholder{
  width: 100%;
  display: block;

  height: 400px;
  min-height: 400px;

  object-fit: cover;
  object-position: center center;

  margin-bottom: var(--space-4xs);

  transition-duration: 0.2s;
  transition-timing-function: ease-in-out;
}

.deals-grid__img--placeholder{
  background: rgba(0,0,0,0.06);
}

/* Title */
.deals-grid__title{
  font-weight: 300;
  margin: 0;
  width: 100%;
  margin-bottom: var(--space-s);

  color: var(--text-body);
}

/* Hover behavior */
.deals-grid__img{
  will-change: transform;
}

.deals-grid__link:hover .deals-grid__img,
.deals-grid__link:focus-visible .deals-grid__img{
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.deals-grid__link:focus-visible{
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ================= DEALS GRID PAGINATION ================= */

.deals-grid__pagination{
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: var(--space-xl);
}

.deals-grid__pagination-list{
  list-style: none;
  margin: 0;
  padding: 0;

  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2xs);
}

.deals-grid__pagination-item{
  list-style: none;
  margin: 0;
  padding: 0;
}

.deals-grid__pagination-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 40px;
  height: 40px;

  text-decoration: none;
  color: var(--text-body);

  border: 1px solid var(--bg-body);

  font-weight: 300;
}

.deals-grid__pagination-link.is-current{
  background: rgba(0,0,0,0.06);
  cursor: default;
}

.deals-grid__pagination-link:not(.is-current):hover{
  background: rgba(0,0,0,0.03);
}

.deals-grid__pagination-link:focus-visible{
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Chevron arrows (drawn with ::before, not text glyphs) */
.deals-grid__pagination-arrow{
  position: relative;
}

.deals-grid__pagination-arrow::before{
  content: "";
  width: 10px;
  height: 10px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  display: block;
}

.deals-grid__pagination-arrow.is-prev::before{ transform: rotate(-135deg); }
.deals-grid__pagination-arrow.is-next::before{ transform: rotate(45deg); }

/* RTL: flip directions */
[dir="rtl"] .deals-grid__pagination-arrow.is-prev::before{ transform: rotate(45deg); }
[dir="rtl"] .deals-grid__pagination-arrow.is-next::before{ transform: rotate(-135deg); }

/* ================= EMPTY STATE ================= */

.deals-grid__empty{
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;

  text-align: center;
  padding: 24px 0;
  font: inherit;
}