.ansarel-products{
  display: grid;
  transition: opacity .22s ease, transform .22s ease;

  &.is-loading {
    opacity: .65;
    pointer-events: none;
    transform: translateY(4px);
  }
}
.ansarel-product {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity .22s ease, transform .3s ease, box-shadow .3s ease;

  &.ansarel-filter-hidden {
    display: none !important;
  }

  &.ansarel-filter-hiding {
    opacity: 0;
    transform: translateY(8px) scale(.98);
    pointer-events: none;
  }

  &.ansarel-filter-showing {
    animation: ansarel-product-card-in .32s ease both;
  }

  &.is-outofstock {
    opacity: .6;
  }
  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
  }
  &-media {
    position: relative;
    overflow: hidden;

    &__image {
      width: 100%;
      height: auto;
      display: block;
    }

    &__link {
      position: absolute;
      inset: 0;
      z-index: 2;
    }
  }

  &-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 20px;
    background: #e63946;
    color: #fff;
    z-index: 3;
  }

  &-content {
    position: relative;
  }

  &-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;

    a {
      color: inherit;
      text-decoration: none;
    }
  }

  &-price {
    font-weight: 600;
    margin-top: 6px;
  }

  &-rating {
    margin-top: 6px;
  }

  &-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }
}

@keyframes ansarel-product-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.ansarel-product--layout-one {
    display: flex;
    flex-direction: column;

  .ansarel-product-content {
    padding: 16px;
  }

  .ansarel-product-actions {
    justify-content: flex-start;
  }
}
.ansarel-product--layout-two {
  .ansarel-product-media {
    position: relative;

    img {
      transition: transform .4s ease;
    }
  }

  &:hover {
    .ansarel-product-media img {
      transform: scale(1.06);
    }
  }

  .ansarel-product-content {
    position: absolute;
    inset: auto 0 0 0;
    padding: 16px;
    z-index: 3;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, .75),
      rgba(0, 0, 0, 0)
    );
    color: #fff;
  }

  .ansarel-product-title,
  .ansarel-product-price,
  .ansarel-product-rating {
    color: #fff;
  }

  .ansarel-product-actions {
    margin-top: 10px;

    a,
    button {
      background: #fff;
      color: #000;
    }
  }
}
.ansarel-product--layout-three {
    display: flex;
    gap: 16px;
    align-items: stretch;

  .ansarel-product-media {
    width: 160px;
    flex-shrink: 0;

    img {
      height: 100%;
      object-fit: cover;
    }
  }

  .ansarel-product-content {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .ansarel-product-actions {
    margin-top: auto;
  }
}
.ansarel-product-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;

  .ansarel-product-price {
    font-weight: 600;
    line-height: 1;
  }

  .ansarel-product-stock {
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;

    .is-instock & {
      color: #16a34a; // green
    }

    .is-outofstock & {
      color: #dc2626; // red
    }
  }
}
.ansarel-product--layout-two {
  .ansarel-product-meta-row {
    justify-content: center;
    gap: 16px;
  }
}

.ansarel-product--layout-three {
  .ansarel-product-meta-row {
    justify-content: flex-start;
  }
}
.ansarel-product {

  .ansarel-product-cart {

    a.button,
    button.button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;

      min-height: 42px;
      padding: 10px 16px;

      font-size: 14px;
      font-weight: 600;
      line-height: 1;

      border-radius: 8px;
      border: none;
      cursor: pointer;
      text-decoration: none;
      white-space: nowrap;

      background:  #2563eb;
      color: #fff;

      transition: 
        background-color .25s ease,
        box-shadow .25s ease,
        transform .15s ease;

      &:hover {
        background: #1e40af;
        box-shadow: 0 8px 22px rgba(0,0,0,.12);
        transform: translateY(-1px);
      }

      &:active {
        transform: translateY(0);
        box-shadow: none;
      }
    }
  }
}
.ansarel-product {

  // Simple / Virtual / Downloadable
  .product_type_simple,
  .product_type_virtual,
  .product_type_downloadable {
    background: #2563eb;
  }

  // Variable products (Select options)
  .product_type_variable {
    background: #0f172a;

    &:hover {
      background: #020617;
    }
  }

  // Grouped products
  .product_type_grouped {
    background: #7c3aed;

    &:hover {
      background: #6d28d9;
    }
  }

  // External / Affiliate
  .product_type_external {
    background: #059669;

    &:hover {
      background: #047857;
    }
  }

  // Subscriptions
  .product_type_subscription,
  .product_type_variable-subscription {
    background: #9333ea;

    &:hover {
      background: #7e22ce;
    }
  }
}
.ansarel-product {

  .add_to_cart_button {

    &.loading {
      opacity: .6;
      pointer-events: none;
      position: relative;

      &:after {
        content: "";
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255,255,255,.4);
        border-top-color: #fff;
        border-radius: 50%;
        animation: ansarel-spin .6s linear infinite;
      }
    }

    &.added {
      background: #16a34a;

      &:after {
        content: "✓";
        font-weight: 700;
        margin-left: 6px;
      }
    }
  }
}

@keyframes ansarel-spin {
  to { transform: rotate(360deg); }
}
.ansarel-product {

  &.is-outofstock {

    .ansarel-product-cart a.button {
      background: #9ca3af;
      cursor: not-allowed;
      pointer-events: none;
      box-shadow: none;
    }
  }
}
.ansarel-product {

  .product_type_simple:not(.ajax_add_to_cart) {
    background: #334155;
  }
}
.ansarel-product--layout-one {
  .ansarel-product-cart a.button {
    width: 100%;
  }
}
.ansarel-product--layout-two {
  .ansarel-product-cart {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity .3s ease;
  }

  &:hover {
    .ansarel-product-cart {
      opacity: 1;
    }
  }
}
.ansarel-product--layout-three {
  .ansarel-product-cart a.button {
    padding: 8px 14px;
    font-size: 13px;
  }
}
.ansarel-product-cart svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
// Navigation
.ansarel-navigation{
    .page-numbers{
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        .page-numbers{
            background-color: #eff2fe;
            color: #FF007F;
            align-items: center;
            font-size: 18px;
            border-radius: 8px;
            transition: all 0.5s;
            justify-content: center;
            min-width: 45px;
            min-height: 45px;
            &.current, &:hover{
                background-color: #FF007F;
                color: #eff2fe;
            }
        }
        li{
            list-style: none;
        }
    }
    ul{
        margin: 0;
    }
}
