/* HOME PAGE SPECIFIC STYLES */

@-webkit-keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* 2. Wrapper untuk item yang bergerak. */
.scrolling-wrapper {
  display: -webkit-flex;
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  -webkit-animation: scroll-left 30s linear infinite;
  animation: scroll-left 30s linear infinite;
}

/* 4. Kontainer utama (biru) HARUS punya overflow: hidden */
.recent-purchases-container {
  overflow: hidden;
  border: 5px solid white;
  border-radius: 20px !important;
}

/* 5. Styling untuk item */
.purchase-item {
  background-color: white;
  color: var(--bs-primary);
  padding: 12px 40px 12px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.purchase-item .icon {
  font-size: 1.5rem;
  margin-right: 0.5rem;
  margin-left: 0.5rem;
}

.purchase-item .text {
  line-height: 1.2;
  margin-right: 1rem;
}

.purchase-item .text .product {
  font-weight: 600;
}

.purchase-item .text .user {
  font-size: 0.875rem;
}

@media (max-width: 991.98px) {
  .purchase-item {
    padding: 8px 10px 8px 8px;
    margin-right: 0.5rem;
    border-radius: 8px;
  }

  .purchase-item .icon {
    font-size: 1rem;
    margin-right: 0.3rem;
    margin-left: 0.3rem;
  }

  .purchase-item .text {
    margin-right: 0.5rem;
  }

  .purchase-item .text .product {
    font-size: 0.7rem;
  }

  .purchase-item .text .user {
    font-size: 0.6rem;
  }

  .title-desc-harga {
    font-size: 20px;
    font-weight: bold;
  }
}

/* QUICK ACCESS BUTTONS */
.qa-card {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: all .25s ease;
  height: 100%;
}

.qa-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 35px rgba(0,0,0,0.18);
}

.qa-title {
  color: var(--bs-primary);
  font-weight: 800;
  font-size: 1.2rem;
  margin: 0;
}

.qa-subtitle {
  font-size: .9rem;
  color: #6c757d;
  margin-top: 5px;
}

.qa-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bs-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(13,110,253,.25);
}

.qa-ranking-avatars {
  display: flex;
  align-items: center;
  margin-top: 20px;
  justify-content: flex-start;
  gap: 12px;
}

.qa-avatar-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qa-avatar-rank {
  position: absolute;
  top: -12px;
  left: -5px;
  background: var(--bs-primary);
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid white;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.qa-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid var(--bs-primary);
  background-color: white;
  background-size: cover;
  background-position: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  z-index: 5;
}

@media (max-width: 991.98px) {
  .qa-card {
    flex-direction: column;
    text-align: center;
    padding: 18px;
    gap: 10px;
    height: 100% !important;
  }

  .qa-icon {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .qa-ranking-header {
    flex-direction: column;
    gap: 8px;
  }

  .qa-card .qa-subtitle {
    display: none;
  }

  .qa-ranking-avatars {
    justify-content: center;
    gap: 0px;
  }

  .qa-avatar-wrap:nth-child(1) { order: 2; z-index: 3; }
  .qa-avatar-wrap:nth-child(2) { order: 1; z-index: 1; }
  .qa-avatar-wrap:nth-child(3) { order: 3; z-index: 2; }

  .qa-avatar-wrap:nth-child(1) .qa-avatar {
    width: 56px;
    height: 56px;
    margin-left: -12px;
    margin-right: -12px;
  }

  .qa-avatar-wrap:nth-child(1) .qa-avatar-rank {
    top: -6px;
    left: -2px;
    width: 22px;
    height: 22px;
    font-size: 0.9rem;
  }

  .qa-avatar-wrap:nth-child(2) .qa-avatar,
  .qa-avatar-wrap:nth-child(3) .qa-avatar {
    width: 42px;
    height: 42px;
  }

  .qa-avatar-wrap:nth-child(2) .qa-avatar-rank,
  .qa-avatar-wrap:nth-child(3) .qa-avatar-rank {
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    top: -6px;
    left: -2px;
  }

  /* Colors for Mobile Ranking (Gold, Silver, Bronze) */
  .qa-avatar-wrap:nth-child(1) .qa-avatar { border-color: #fef08a !important; }
  .qa-avatar-wrap:nth-child(1) .qa-avatar-rank { background: #eab308 !important; }
  .qa-avatar-wrap:nth-child(2) .qa-avatar { border-color: #e2e8f0 !important; }
  .qa-avatar-wrap:nth-child(2) .qa-avatar-rank { background: #94a3b8 !important; }
  .qa-avatar-wrap:nth-child(3) .qa-avatar { border-color: #fed7aa !important; }
  .qa-avatar-wrap:nth-child(3) .qa-avatar-rank { background: #d97706 !important; }

  .qa-mobile-btn {
    display: block !important;
    margin-top: 20px;
  }

  .qa-card-horizontal {
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 15px;
  }

  .qa-card-horizontal > div:first-child {
    flex: unset;
  }

  .qa-icon {
    margin: 0;
  }
}

/* Banner & Spacing Updates */
.banner-container {
    padding: 0 15px;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mySwiper {
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.mySwiper .swiper-slide img {
    border-radius: 25px;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.swiper-pagination-custom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 5px;
    position: relative !important;
}

.swiper-pagination-custom .swiper-pagination-bullet {
    background: #d1d9e6;
    opacity: 1;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 !important;
    border: none;
}

.swiper-pagination-custom .swiper-pagination-bullet-active {
    background: #2f74f5;
    width: 40px;
    border-radius: 12px;
}

@media (max-width: 991.98px) {
    .banner-container {
        padding: 0 12px;
    }
    .mySwiper {
        border-radius: 18px;
    }
    .mySwiper .swiper-slide img {
        border-radius: 18px;
    }
    .swiper-pagination-custom {
        margin-top: 12px;
    }
    .swiper-pagination-custom .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
    }
    .swiper-pagination-custom .swiper-pagination-bullet-active {
        width: 30px;
    }
}

/* Menghilangkan dekorasi plus di belakang tombol banner jika ada */
.banner-container .btn::before,
.banner-container .btn::after,
.mySwiper .swiper-slide a::before,
.mySwiper .swiper-slide a::after,
.mySwiper::before,
.mySwiper::after {
    display: none !important;
    content: none !important;
}


/* Stats Box System */
@media (min-width: 992px) {
    .stats-container-wrapper {
        display: flex;
        border-radius: 1rem;
        overflow: hidden;
        border: 5px solid #fff;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        width: 100%;
    }
    .stats-box {
        flex: 1;
        border-right: 5px solid #fff;
        padding: 1.5rem 1rem;
    }
    .stats-box:last-child {
        border-right: none;
    }
    .stats-label {
        font-size: 1.3rem;
        letter-spacing: 1px;
        margin-bottom: 8px;
    }
}

.stats-value-unit {
    font-size: 0.45em;
    opacity: 0.7;
    font-weight: 500;
}

@media (max-width: 991px) {
    .stats-container-wrapper {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        margin: 0 auto !important;
        background: #fff;
        border: 2px solid #dee2e6 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    }
    .stats-box {
        min-width: 0 !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        padding: 1.2rem 10px !important;
        border-radius: 0 !important;
        background: #fff !important;
        color: #2f74f5 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-right: none !important;
    }

    /* Baris 1: Harga Robux (Full Width) */
    .stats-box:nth-child(2) {
        flex: 0 0 100% !important;
        border-bottom: 2px solid #dee2e6 !important; /* Garis abu-abu pemisah baris */
    }

    /* Baris 2: Terjual & Total Orderan (50% each) */
    .stats-box:nth-child(3),
    .stats-box:nth-child(4) {
        flex: 0 0 50% !important;
        border-bottom: none !important;
    }

    /* Pemisah vertikal abu-abu di baris ke-2 */
    .stats-box:nth-child(3) {
        border-right: 2px solid #ced4da !important;
    }

    .stats-box .stats-label {
        font-size: 0.8rem !important;
        color: #2978f7e3 !important;
        margin-bottom: 4px !important;
        white-space: nowrap;
    }
    .stats-box .stats-value {
        font-size: 1.25rem !important;
        color: #2f74f5 !important;
        margin-bottom: 0 !important;
    }
    /* Harga value slightly bigger */
    .stats-box:nth-child(2) .stats-value {
        font-size: 1.5rem !important;
    }

    .stats-box .stats-value-unit {
        font-size: 0.65rem !important;
    }

    .full-width-mobile {
        width: 100% !important;
        margin: 0 auto !important;
        border-radius: 10px !important;
        border: 2px solid #ffffff54 !important;
    }

    /* Override for Terjual & Orderan box on mobile */
}

@keyframes slideUpFade {
  0% {
      opacity: 0;
      transform: translateY(20px);
  }
  100% {
      opacity: 1;
      transform: translateY(0);
  }
}

/* -------------------------------------------------------------------------- */
/* SLIDER & CARD COMPONENT REFINEMENTS                                        */
/* -------------------------------------------------------------------------- */

/* Global showcase card dimension overrides */
.showcase-banner {
    height: 145px !important;
}

.sell-list {
    height: 195px !important;
}

.showcase-card::before {
    top: 115px !important;
}

/* Limited item ribbon styling */
.limited-ribbon {
    position: absolute;
    top: 20px;
    left: -5px;
    background: #ff3b3b;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 6px 15px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(255, 59, 59, 0.4);
    clip-path: polygon(0 0, 100% 0, 90% 50%, 100% 100%, 0 100%);
}

/* -------------------------------------------------------------------------- */
/* MOBILE OPTIMIZATIONS                                                       */
/* -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .display-6,
    .display-md-4,
    h2.showcase-title,
    .title-card {
        font-size: 1.15rem !important;
    }

    .quick-choice-card .fs-5 {
        font-size: 0.85rem !important;
    }

    .quick-choice-card img {
        width: 25px !important;
        height: 25px !important;
    }

    h4.mb-3 {
        font-size: 1.1rem !important;
    }

    .purchase-item {
        padding: 6px 10px !important;
    }

    .purchase-item .text .product {
        font-size: 0.75rem !important;
    }

    .purchase-item .text .user {
        font-size: 0.65rem !important;
    }

    .showcase-card .showcase-title {
        font-size: 0.95rem !important;
    }

    .showcase-banner {
        height: 115px !important;
    }

    .showcase-card::before {
        top: 90px !important;
        font-size: 8px !important;
        padding: 2px 6px !important;
    }

    .sell-list {
        height: 170px !important;
    }

    .showcase-content {
        padding: 10px !important;
    }

    .flash-timer {
        display: none !important;
    }

    .limited-ribbon {
        font-size: 0.75rem !important;
        padding: 4px 10px !important;
        top: 10px !important;
    }
}

/* -------------------------------------------------------------------------- */
/* SCALING FOR HD/720P LAPTOP RESOLUTIONS (1280x720)                          */
/* -------------------------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1366px) {
  .stats-box {
    padding: 1.2rem 0.75rem !important;
  }
  .stats-label {
    font-size: 1.1rem !important;
  }
  .stats-value {
    font-size: 1.6rem !important;
  }
  
  .qa-card {
    padding: 18px !important;
  }
  .qa-icon {
    width: 52px !important;
    height: 52px !important;
    font-size: 22px !important;
  }
  .qa-avatar {
    width: 56px !important;
    height: 56px !important;
  }

  .mySwiper {
    max-width: 800px !important;
    margin: 0 auto !important;
  }
  
  .showcase-banner {
    height: 130px !important;
  }
  .sell-list {
    height: 180px !important;
  }
}

/* LAPTOP VIEW: Keep it small as established */
@media (min-width: 1367px) and (max-width: 1440px) {
  .mySwiper {
    max-width: 1000px !important;
    margin: 0 auto !important;
  }
}

/* PC VIEW: Align with the content container below */
@media (min-width: 1441px) {
  .mySwiper {
    max-width: 1320px !important;
    margin: 0 auto !important;
  }
}

/* Robux Icon Styles (Common with Order Page) */
.nominal-icon-container {
    width: 44px;
    height: 44px;
    background: #2f74f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.nominal-icon-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

@media (max-width: 768px) {
    .nominal-icon-container {
        width: 38px;
        height: 38px;
    }
    .nominal-icon-img {
        width: 22px;
        height: 22px;
    }
}

/* Background for bottom half of the page */
.qa-bottom-bg { 
    background-color: #f0f4f8; 
    position: relative;
}

.qa-bottom-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../img/texture.jpg');
    background-repeat: repeat;
    background-size: cover;
    opacity: 0.15;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0;
}

.qa-bottom-bg > * {
    position: relative;
    z-index: 1;
}
