/* ================ SKELETON LOADING STYLES ================ */
.carousel-skeleton {
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.carousel-skeleton::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer-overlay 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes shimmer-overlay {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Responsive skeleton height - sesuai dengan tinggi carousel */
@media screen and (min-width: 768px) {
  .carousel-skeleton {
    height: 300px;
  }
}

@media screen and (min-width: 1024px) {
  .carousel-skeleton {
    height: 350px;
  }
}

@media screen and (min-width: 1400px) {
  .carousel-skeleton {
    height: 400px;
  }
}

@media screen and (min-width: 1920px) {
  .carousel-skeleton {
    height: 450px;
  }
}

/* Skeleton overlay yang ditambahkan via JavaScript - pastikan tinggi sesuai */
#carouselExample-cf .carousel-skeleton {
  height: 200px !important;
}

@media screen and (min-width: 768px) {
  #carouselExample-cf .carousel-skeleton {
    height: 300px !important;
  }
}

@media screen and (min-width: 1024px) {
  #carouselExample-cf .carousel-skeleton {
    height: 350px !important;
  }
}

@media screen and (min-width: 1400px) {
  #carouselExample-cf .carousel-skeleton {
    height: 400px !important;
  }
}

@media screen and (min-width: 1920px) {
  #carouselExample-cf .carousel-skeleton {
    height: 450px !important;
  }
}

/* Ensure carousel container has min-height to prevent layout shift */
#carouselExample-cf {
  min-height: 200px;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Carousel inner responsive */
#carouselExample-cf .carousel-inner {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

/* Carousel item responsive - tidak mengganggu transisi Bootstrap */
#carouselExample-cf .carousel-item {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 200px;
  height: 200px;
  position: relative;
  text-align: center;
  line-height: 200px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

/* Wrapper untuk gambar agar terpusat tanpa mengganggu transisi */
#carouselExample-cf .carousel-item > img,
#carouselExample-cf .carousel-item > a > img {
  display: inline-block !important;
  vertical-align: middle !important;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
  -webkit-transform: translateZ(0) !important;
  transform: translateZ(0) !important;
}

/* Carousel images responsive - tampil full tanpa terpotong */
#carouselExample-cf img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
}

@media screen and (min-width: 768px) {
  #carouselExample-cf {
    min-height: 300px;
  }

  #carouselExample-cf .carousel-item {
    min-height: 300px;
    height: 300px;
    line-height: 300px;
  }
}

@media screen and (min-width: 1024px) {
  #carouselExample-cf {
    min-height: 350px;
  }

  #carouselExample-cf .carousel-item {
    min-height: 350px;
    height: 350px;
    line-height: 350px;
  }
}

/* Untuk layar besar, biarkan gambar tampil sesuai proporsinya */
@media screen and (min-width: 1400px) {
  #carouselExample-cf {
    min-height: 400px;
  }

  #carouselExample-cf .carousel-item {
    min-height: 400px;
    height: 400px;
    line-height: 400px;
  }
}

@media screen and (min-width: 1920px) {
  #carouselExample-cf {
    min-height: 450px;
  }

  #carouselExample-cf .carousel-item {
    min-height: 450px;
    height: 450px;
    line-height: 450px;
  }
}

/* Hide skeleton when carousel is loaded */
#carouselExample-cf.loaded .carousel-skeleton {
  display: none;
}

/* Ensure carousel doesn't exceed viewport width */
#carouselExample-cf {
  box-sizing: border-box !important;
}

#carouselExample-cf * {
  box-sizing: border-box !important;
}

@media screen and (min-width: 0px) and (max-width: 600px) {
  #slide_tiny_div {
    width: 110%;
    margin-left: -5%;
  }

  #slide_tiny {
    padding: 0 0px;
  }

  #slide_pl {
    font-size: 13px;
  }
}

/* ================ MENU CARD GRID STYLES ================ */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 1rem;
}

.menu-card {
  background: linear-gradient(135deg, #f0f0f0 0%, #ffffff 100%);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.menu-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.menu-card:hover::before {
  transform: translateX(100%);
}

.menu-card a {
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.menu-card-icon {
  margin-bottom: 10px;
  transition: transform 0.3s;
}

.menu-card:hover .menu-card-icon {
  transform: scale(1.1);
}

.menu-card-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.menu-card-text {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  color: black;
  margin-top: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

/* Responsive: Kurangi ukuran menu card di layar besar */
@media screen and (min-width: 1024px) {
  .menu-card {
    padding: 14px !important;
    min-height: 100px !important;
  }

  .menu-card-icon {
    margin-bottom: 6px !important;
  }

  .menu-card-icon img {
    width: 32px !important;
    height: 32px !important;
  }

  .menu-card-text {
    font-size: 10px !important;
    margin-top: 4px !important;
  }

  .menu-grid {
    gap: 12px !important;
  }
}

@media screen and (min-width: 1400px) {
  .menu-card {
    padding: 12px !important;
    min-height: 90px !important;
  }

  .menu-card-icon {
    margin-bottom: 5px !important;
  }

  .menu-card-icon img {
    width: 28px !important;
    height: 28px !important;
  }

  .menu-card-text {
    font-size: 9px !important;
    margin-top: 3px !important;
  }

  .menu-grid {
    gap: 10px !important;
  }
}

@media screen and (min-width: 1920px) {
  .menu-card {
    padding: 10px !important;
    min-height: 85px !important;
  }

  .menu-card-icon {
    margin-bottom: 4px !important;
  }

  .menu-card-icon img {
    width: 26px !important;
    height: 26px !important;
  }

  .menu-card-text {
    font-size: 9px !important;
    margin-top: 2px !important;
  }

  .menu-grid {
    gap: 8px !important;
  }
}

/* Responsive - tetap 3 kolom di semua ukuran */
@media screen and (max-width: 768px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .menu-card {
    padding: 15px 10px;
    min-height: 100px;
  }

  .menu-card-icon img {
    width: 32px;
    height: 32px;
  }

  .menu-card-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
  }
}

@media screen and (max-width: 480px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .menu-card {
    padding: 12px 8px;
    min-height: 90px;
  }

  .menu-card-icon img {
    width: 28px;
    height: 28px;
  }

  .menu-card-text {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2px;
  }
}

/* ================ SPAREPART PRODUCT CARDS STYLES ================ */
.sparepart-container {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

.sparepart-container::-webkit-scrollbar {
  height: 6px;
}

.sparepart-container::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 10px;
}

.sparepart-container::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 10px;
}

.sparepart-container::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.sparepart-card {
  flex: 0 0 auto;
  width: 200px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.sparepart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.sparepart-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.sparepart-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f7fafc;
  display: block;
}

.sparepart-card-content {
  padding: 12px;
}

.sparepart-card-title {
  font-size: 12px;
  font-weight: 500;
  color: #2d3748;
  line-height: 1.4;
  margin-bottom: 8px;
  min-height: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sparepart-card-price-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  margin-top: 8px;
}

.sparepart-card-price {
  font-size: 16px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 4px;
  line-height: 1.2;
}

.sparepart-card-price del {
  font-size: 13px;
  font-weight: 400;
  color: #e53e3e;
  display: block;
  margin-bottom: 4px;
}

.sparepart-card-location {
  font-size: 11px;
  color: #718096;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.sparepart-card-location i {
  font-size: 10px;
}

.sparepart-view-all {
  flex: 0 0 auto;
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  text-decoration: none;
  color: #4a5568;
}

.sparepart-view-all:hover {
  background: #f7fafc;
  transform: translateX(-2px);
  color: #2d3748;
}

.sparepart-view-all i {
  font-size: 24px;
}

/* Skeleton loading untuk sparepart cards */
.sparepart-card-skeleton {
  flex: 0 0 auto;
  width: 200px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
}

.sparepart-card-skeleton-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.sparepart-card-skeleton-content {
  padding: 12px;
}

.sparepart-card-skeleton-title {
  height: 16px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}

.sparepart-card-skeleton-title:last-of-type {
  width: 70%;
  margin-bottom: 12px;
}

.sparepart-card-skeleton-price {
  height: 20px;
  width: 60%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-top: 8px;
}

.sparepart-card-skeleton-location {
  height: 12px;
  width: 40%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-top: 8px;
}

.sparepart-card.loading {
  position: relative;
}

.sparepart-card.loading .sparepart-card-image {
  opacity: 0;
}

.sparepart-card.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 180px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px 12px 0 0;
}

@media screen and (max-width: 768px) {
  .sparepart-card-skeleton {
    width: 180px;
  }

  .sparepart-card-skeleton-image {
    height: 160px;
  }

  .sparepart-card.loading::after {
    height: 160px;
  }
}

@media screen and (max-width: 480px) {
  .sparepart-card-skeleton {
    width: 160px;
  }

  .sparepart-card-skeleton-image {
    height: 140px;
  }

  .sparepart-card.loading::after {
    height: 140px;
  }
}

.ps-product__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e53e3e;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media screen and (max-width: 768px) {
  .sparepart-card {
    width: 180px;
  }

  .sparepart-card-image {
    height: 160px;
  }

  .sparepart-card-title {
    font-size: 11px;
    min-height: 36px;
  }

  .sparepart-card-price {
    font-size: 14px;
  }
}

@media screen and (max-width: 480px) {
  .sparepart-container {
    gap: 12px;
  }

  .sparepart-card {
    width: 160px;
  }

  .sparepart-card-image {
    height: 140px;
  }

  .sparepart-card-content {
    padding: 10px;
  }

  .sparepart-card-title {
    font-size: 10px;
    min-height: 32px;
  }

  .sparepart-card-price {
    font-size: 13px;
  }

  .sparepart-view-all {
    width: 50px;
  }

  .sparepart-view-all i {
    font-size: 20px;
  }
}

/* Modal Menu Grid & Card Styles */
.modal-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem;
  padding: 1rem 0;
}

.modal-menu-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  text-decoration: none;
  color: #333;
}

.modal-menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: #333;
}

.modal-menu-card:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.modal-menu-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.modal-menu-card b {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Responsive adjustments untuk layar besar */
@media screen and (min-width: 1024px) {
  /* Batasi lebar modal body di layar besar */
  #moremenu .modal-body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
  }

  .modal-menu-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1.5rem 0;
  }

  .modal-menu-card {
    padding: 1.25rem 1rem;
    min-height: 130px;
    max-width: 100%;
  }

  .modal-menu-card img {
    width: 36px;
    height: 36px;
    margin-bottom: 0.625rem;
  }

  .modal-menu-card b {
    font-size: 10px;
  }
}

@media screen and (min-width: 1400px) {
  /* Batasi lebar modal body di layar besar */
  #moremenu .modal-body {
    max-width: 1400px;
    padding: 2.5rem;
  }

  .modal-menu-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.75rem;
  }

  .modal-menu-card {
    padding: 1.125rem 0.875rem;
    min-height: 125px;
  }

  .modal-menu-card img {
    width: 34px;
    height: 34px;
    margin-bottom: 0.5rem;
  }

  .modal-menu-card b {
    font-size: 9.5px;
  }
}

@media screen and (min-width: 1920px) {
  /* Batasi lebar modal body di layar besar */
  #moremenu .modal-body {
    max-width: 1600px;
    padding: 3rem;
  }

  .modal-menu-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
  }

  .modal-menu-card {
    padding: 1rem 0.75rem;
    min-height: 120px;
  }

  .modal-menu-card img {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
  }

  .modal-menu-card b {
    font-size: 9px;
  }
}

/* Responsive adjustments untuk layar kecil */
@media screen and (max-width: 768px) {
  .modal-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0.75rem 0;
  }

  .modal-menu-card {
    padding: 1.25rem 0.75rem;
    min-height: 120px;
  }

  .modal-menu-card img {
    width: 35px;
    height: 35px;
    margin-bottom: 0.5rem;
  }

  .modal-menu-card b {
    font-size: 10px;
  }
}

@media screen and (max-width: 480px) {
  .modal-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .modal-menu-card {
    padding: 1rem 0.5rem;
    min-height: 110px;
  }

  .modal-menu-card img {
    width: 30px;
    height: 30px;
    margin-bottom: 0.5rem;
  }

  .modal-menu-card b {
    font-size: 9px;
  }
}
