:root {
  --orange: #ff6b00;
  --orange-light: #ff8c3a;
  --orange-dark: #e55c00;
}

/* General Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
}

/* Navbar */
.bg-orange {
  background-color: var(--orange);
}
.navbar {
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.navbar-brand {
  font-size: 1.25rem;
}
.navbar-brand img {
  height: 40px;
}
.search-bar {
  flex-grow: 1;
}
.search-bar .input-group {
  width: 100%;
}
.search-bar .form-control {
  border-radius: 20px 0 0 20px;
  border-right: none;
}
.search-bar .form-control:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 0.25rem rgba(255, 107, 0, 0.25);
}

.btn-search {
  /* background-color: white;
  border-radius: 0 20px 20px 0;
  border-left: none; */
  background-color: var(--orange);
  color: white;
  border-color: var(--orange);
}
.btn-search:hover {
  background-color: var(--orange-dark);
  border-color: var(--orange-dark);
}
#product-section-title {
  transition: all 0.3s ease;
}

.nav-icon {
  color: white;
  font-size: 1.2rem;
  position: relative;
  text-decoration: none;
}

.nav-icon:hover {
  color: #f0f0f0;
}

/* Improved Cart Modal Styles */
.cart-modal {
  max-width: 800px;
  width: 95%;
  font-size: 0.85rem; /* Ukuran font lebih kecil */
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* Untuk konsistensi lebar kolom */
}

.cart-table th {
  text-align: left;
  padding: 8px 6px; /* Padding lebih kecil */
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
  white-space: nowrap; /* Mencegah text wrapping */
}

.cart-table td {
  padding: 8px 6px; /* Padding lebih kecil */
  vertical-align: middle;
  border-bottom: 1px solid #dee2e6;
  white-space: nowrap; /* Mencegah text wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-image {
  width: 50px; /* Lebih kecil */
  height: 50px; /* Lebih kecil */
  object-fit: cover;
  border-radius: 4px;
  margin-right: 8px;
}

.cart-item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  display: inline-block;
}

.cart-price {
  font-weight: 500;
  white-space: nowrap;
}

.cart-quantity-input {
  width: 60px; /* Lebih kecil */
  text-align: center;
  padding: 4px;
  font-size: 0.8rem;
}

.cart-subtotal {
  font-weight: 600;
  white-space: nowrap;
}

.cart-summary {
  background-color: #f8f9fa;
  padding: 12px 15px;
  border-radius: 5px;
  margin-top: 15px;
  font-size: 0.9rem;
}

.cart-total {
  font-size: 1rem; /* Lebih kecil */
  font-weight: bold;
  white-space: nowrap;
}

/* Checkout Button Styles */
.cart-checkout-btn {
  width: 100%;
  padding: 8px;
  font-size: 0.9rem;
  margin-top: 15px;
  white-space: nowrap;
}

/* Cart Footer */
.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.cart-total-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cart-total-label {
  font-size: 0.8rem;
  color: #6c757d;
}

.cart-total-amount {
  font-size: 1.1rem;
  font-weight: bold;
  color: #dc3545;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.6rem;
  padding: 3px 6px;
}

/* Categories Nav */
.category-item {
  cursor: pointer;
  padding: 5px;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-item:hover {
  color: var(--orange);
}

.category-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 5px;
  border-radius: 50%;
  background-color: #f8f9fa;
  padding: 5px;
}

.category-item i {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 5px;
}

/* Price Styling */
.text-decoration-line-through {
    opacity: 0.7;
    font-size: 0.8rem;
}

.text-danger {
    font-size: 1rem;
}

/* Product Card */
.product-card {
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
}

.badge-flash {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--orange);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.product-title {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  margin: 8px 0;
}

.product-rating {
  margin-bottom: 8px;
}

/* Buttons */
.btn-orange {
  background-color: var(--orange);
  color: white;
  border: none;
}

.btn-orange:hover {
  background-color: var(--orange-dark);
  color: white;
}

/* Flash Sale Countdown */
.countdown {
  font-size: 0.9rem;
}

/* Payment Methods */
.payment-methods i {
  opacity: 0.8;
  transition: opacity 0.3s;
}

.payment-methods i:hover {
  opacity: 1;
}

/* Navbar Toggle Fix */
.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

/* Desktop View */
@media (min-width: 769px) {
  .cart-icon-container {
      margin-left: 15px;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .navbar {
      padding: 0.5rem 1rem;
  }

  .navbar-brand {
      font-size: 1.1rem;
  }

  .navbar-collapse {
      padding-top: 10px;
  }

  .search-bar {
      margin: 0!important;
  }

  .search-bar .input-group {
      width: 100%;
      flex-wrap: nowrap;
  }

  .search-bar .form-control {
      font-size: 0.9rem;
  }

  .search-bar .btn-search {
      border-radius: 0 20px 20px 0 !important;
  }

  .cart-icon-container {
      margin-left: 10px;
      order: 2;
  }

  .nav-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      background: rgba(255,255,255,0.2);
      border-radius: 50%;
  }

  .navbar-toggler {
      padding: 0.25rem 0.5rem;
      font-size: 1rem;
  }
  
  .categories-nav .col {
      padding: 0 5px;
  }
  
  .category-item span {
      font-size: 0.7rem;
  }
  
  .product-title {
      font-size: 0.8rem;
  }
  
  .product-price {
      font-size: 0.9rem;
  }
  
  .cart-modal {
      font-size: 0.8rem;
  }

  .cart-table thead {
      display: none;
  }

  .cart-table tr {
      display: block;
      margin-bottom: 12px;
      border-bottom: 2px solid #dee2e6;
  }

  .cart-table td {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 4px;
      border-bottom: 1px dashed #eee;
      white-space: normal; /* Di mobile boleh wrap */
  }

  .cart-table td:before {
      content: attr(data-label);
      font-weight: bold;
      margin-right: 10px;
      white-space: nowrap;
  }

  .cart-item-info {
      flex-direction: column;
      align-items: flex-start !important;
  }

  .cart-item-name {
      max-width: 100%;
  }

  .cart-quantity-input {
      width: 50px;
  }

  .btn-sm {
      padding: 0.25rem 0.5rem;
      font-size: 0.75rem;
  }
  .cart-footer {
      flex-direction: column;
      gap: 10px;
  }

  .cart-total-container {
      align-items: center;
      width: 100%;
  }

  .cart-checkout-btn {
      width: 100%;
      margin-top: 10px;
  }
  .floating-cart-btn {
      width: 50px;
      height: 50px;
      font-size: 0.9rem;
  }
  .floating-cart-badge {
      width: 20px;
      height: 20px;
      font-size: 0.6rem;
  }
}

/* Cart Modal Adjustments */
.swal2-popup .table {
  margin-bottom: 0;
}

.swal2-popup .table th, 
.swal2-popup .table td {
  padding: 0.5rem;
  vertical-align: middle;
}

.quantity-input {
  text-align: center;
}

.pre-formatted {
  white-space: pre-wrap;
  font-family: inherit;
}
/* Floating Cart Button */
.floating-cart-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--orange);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  border: none;
  transition: all 0.3s ease;
}
.floating-cart-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  background-color: var(--orange-dark);
}
.floating-cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #dc3545;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
}
.pulse {
  animation: pulse 0.5s ease;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Product Detail Modal Styles */
#productCarousel {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carousel-item img {
  height: 400px;
  object-fit: contain;
  background-color: #f8f9fa;
}

.carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 5px;
  background-color: #ccc;
  border: none;
}

.carousel-indicators .active {
  background-color: var(--orange);
}

.carousel-control-prev,
.carousel-control-next {
  width: 40px;
  height: 40px;
  background-color: rgba(0,0,0,0.2);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}

.carousel-control-prev {
  left: 15px;
}

.carousel-control-next {
  right: 15px;
}

.quantity-selector .btn {
  width: 40px;
  font-weight: bold;
}

.quantity-selector .form-control {
  border-left: none;
  border-right: none;
  text-align: center;
  padding: 0.375rem 0;
  font-weight: bold;
}

.add-to-cart-modal {
  flex-grow: 1;
  padding: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .carousel-item img {
      height: 250px;
  }
  
  #productDetailModal .modal-body {
      padding: 15px;
  }
  
  #productDetailName {
      font-size: 1.3rem;
  }
  
  #productDetailPrice {
      font-size: 1rem !important;
  }
}

/* Categories Scroll Styles */
.categories-scroll-container {
  width: 100%;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch; /* Untuk smooth scrolling di iOS */
  padding-bottom: 10px; /* Ruang untuk scrollbar */
}

.categories-scroll-wrapper {
  display: inline-flex;
  white-space: nowrap;
  gap: 15px;
  padding: 0 10px;
}

.category-item {
  flex: 0 0 auto;
  cursor: pointer;
  padding: 5px 10px;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.category-item:hover {
  color: var(--orange);
  transform: translateY(-3px);
}

.category-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 5px;
  border-radius: 50%;
  background-color: #f8f9fa;
  padding: 5px;
}

/* Hide scrollbar but keep functionality */
.categories-scroll-container::-webkit-scrollbar {
  height: 5px;
}
.categories-scroll-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.categories-scroll-container::-webkit-scrollbar-thumb {
  background: var(--orange-light);
  border-radius: 10px;
}
.categories-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}
/* Responsive adjustments */
@media (max-width: 768px) {
  .category-item {
      min-width: 70px;
  }
  .category-item span {
      font-size: 0.7rem;
  }
  .category-image {
      width: 35px;
      height: 35px;
  }
}

/* Active Category Style */
.category-item.active {
  color: var(--orange);
  font-weight: 600;
}
.category-item.active .category-image {
  border: 2px solid var(--orange);
  padding: 3px;
}
.category-item.active .category-icon {
  color: var(--orange);
}
.category-icon {
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: #6c757d;
}
/* Loading Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.product-item {
  animation: fadeIn 0.3s ease forwards;
}

/* Pagination Styles */
.pagination {
  margin-top: 20px;
}

.page-item.active .page-link {
  background-color: var(--orange);
  border-color: var(--orange);
}

.page-link {
  color: var(--orange);
  border: 1px solid #dee2e6;
  padding: 0.5rem 0.75rem;
}

.page-link:hover {
  color: var(--orange-dark);
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.page-item.disabled .page-link {
  color: #6c757d;
}

.page-item:first-child .page-link {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.page-item:last-child .page-link {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

/* Responsive Pagination */
@media (max-width: 576px) {
  .pagination {
      flex-wrap: wrap;
      justify-content: center;
  }
  
  .page-item {
      margin: 2px;
  }
}

/* Banner Styles */
.banner-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  height: 100%;
}

.banner-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.banner-item:hover img {
  transform: scale(1.02);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .banner .col-md-8, 
  .banner .col-md-4 {
      width: 100%;
  }
  
  .banner-item {
      margin-bottom: 15px;
      height: auto;
  }
  
  .banner-item:last-child {
      margin-bottom: 0;
  }
}

/* ==================== */
/* BANNER CAROUSEL */
/* ==================== */

.main-banner-carousel {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.main-banner-carousel .carousel-item img {
  height: 400px;
  object-fit: cover;
  width: 100%;
}

.main-banner-carousel .carousel-caption {
  background-color: rgba(0,0,0,0.6);
  border-radius: 10px;
  padding: 1.25rem;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 800px;
}

.main-banner-carousel .carousel-caption h5 {
  font-size: 1.75rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.main-banner-carousel .carousel-caption p {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.main-banner-carousel .carousel-indicators {
  margin-bottom: 1rem;
}

.main-banner-carousel .carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 6px;
  background-color: rgba(255,255,255,0.5);
  border: none;
  transition: all 0.3s ease;
}

.main-banner-carousel .carousel-indicators .active {
  background-color: var(--orange);
  transform: scale(1.2);
}

.main-banner-carousel .carousel-control-prev,
.main-banner-carousel .carousel-control-next {
  width: 50px;
  height: 50px;
  background-color: rgba(0,0,0,0.3);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.9;
  transition: all 0.3s ease;
}

.main-banner-carousel .carousel-control-prev:hover,
.main-banner-carousel .carousel-control-next:hover {
  opacity: 1;
  background-color: rgba(0,0,0,0.5);
}

.main-banner-carousel .carousel-control-prev {
  left: 1.5rem;
}

.main-banner-carousel .carousel-control-next {
  right: 1.5rem;
}

/* Animasi untuk transisi */
.main-banner-carousel .carousel-item {
  transition: transform 0.6s ease-in-out;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .main-banner-carousel .carousel-item img {
    height: 350px;
  }
}

@media (max-width: 768px) {
  .main-banner-carousel .carousel-item img {
    height: 250px;
  }
  
  .main-banner-carousel .carousel-caption {
    bottom: 1.5rem;
    padding: 0.75rem;
    width: 90%;
  }
  
  .main-banner-carousel .carousel-caption h5 {
    font-size: 1.25rem;
  }
  
  .main-banner-carousel .carousel-caption p {
    font-size: 0.9rem;
  }
  
  .main-banner-carousel .carousel-control-prev,
  .main-banner-carousel .carousel-control-next {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 576px) {
  .main-banner-carousel .carousel-item img {
    height: 200px;
  }
  
  .main-banner-carousel .carousel-caption {
    display: none; /* Sembunyikan caption di mobile jika perlu */
  }
}

/* ==================== */
/* FOOTER STYLES */
/* ==================== */
footer a {
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--orange-light) !important;
}

footer .fa-map-marker-alt,
footer .fab,
footer .fas {
  width: 20px;
  text-align: center;
}

footer hr {
  border-color: rgba(255,255,255,0.1);
  margin: 1.5rem 0;
}

/* Responsive Footer */
@media (max-width: 768px) {
  footer .col-md-4 {
      margin-bottom: 1.5rem;
  }
  
  footer h5 {
      font-size: 1.1rem;
  }
}