/* Global Styles */
:root {
  --primary-color: #00aa13; /* Hijau Gojek */
  --secondary-color: #ffc700; /* Kuning Gojek */
  --dark-color: #1a1a1a;
  --light-color: #ffffff;
  --gray-color: #f5f5f5;
  --text-dark: #333333;
  --text-light: #777777;
  --border-color: #e0e0e0;
}

body {
  background-color: var(--gray-color);
  font-family: "Open Sans", sans-serif;
  color: var(--text-dark);
  padding-top: 70px; /* For fixed navbar */
  padding-bottom: 80px; /* For floating button */
}

/* Navbar Styles */
.navbar {
  background-color: var(--primary-color);
  padding: 10px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--light-color) !important;
}

.search-container {
  position: relative;
  flex-grow: 1;
  max-width: 500px;
  margin: 0 15px;
}

.search-input {
  width: 100%;
  border-radius: 25px;
  padding: 8px 15px 8px 40px;
  border: none;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
}

.user-profile {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 0.9rem;
  margin-left: 10px;
}

.nav-link {
  color: var(--light-color) !important;
  font-weight: 500;
  padding: 8px 12px !important;
  border-radius: 20px;
  transition: background-color 0.2s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content & Headers */
.container h1 {
  color: var(--dark-color);
  font-weight: 700;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
  font-size: 1.8rem;
}

.section-title {
  color: var(--dark-color);
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.5rem;
}

.btn-link {
  color: var(--primary-color) !important;
  font-weight: 600;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Store & Menu Cards */
.card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  margin-bottom: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--light-color);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 170, 19, 0.15);
}

.card-img-top {
  height: 160px;
  object-fit: cover;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
}

.card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 8px;
}

.card-text {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 12px;
  flex: 1;
}

.btn-primary {
  background-color: var(--primary-color);
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 600;
  align-self: flex-start;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.btn-primary:hover {
  background-color: #008c10;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: #6c757d;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-2px);
}

.btn-success {
  background-color: var(--primary-color);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-success:hover {
  background-color: #008c10;
  transform: translateY(-2px);
}

/* Floating Cart Button */
.fixed-bottom {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 99;
}

.btn-warning {
  background-color: var(--secondary-color);
  border: none;
  border-radius: 50px;
  padding: 12px 22px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 199, 0, 0.3);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  color: var(--dark-color); /* Text color for warning button */
}

.btn-warning:hover {
  background-color: #e6b800;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 199, 0, 0.4);
}

.btn-warning .cart-icon {
  margin-right: 8px;
  font-size: 1.1rem;
}

.badge.bg-danger {
  background-color: #ff3a30 !important;
  font-size: 0.7rem;
  padding: 5px 8px;
  border-radius: 50%;
}

/* Category Filter */
.category-filter {
  display: flex;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 25px;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.category-filter::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.category-item {
  flex: 0 0 auto;
  margin-right: 10px;
  padding: 8px 18px;
  border-radius: 25px;
  background-color: var(--light-color);
  color: var(--text-dark);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.category-item.active,
.category-item:hover {
  background-color: var(--primary-color);
  color: var(--light-color);
  border-color: var(--primary-color);
}

/* Cart Page Specific Styles */
#cart-items .store-group {
  background-color: var(--light-color);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
}

#cart-items .store-group h3 {
  color: var(--dark-color);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

#cart-items .list-group-item {
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
}

#cart-items .list-group-item:last-child {
  border-bottom: none;
}

#cart-items .list-group-item h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

#cart-items .list-group-item p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0;
}

#cart-summary .card-body {
  padding: 20px;
}

#cart-summary .card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 15px;
}

#total-price {
  color: var(--primary-color);
  font-weight: 700;
}

/* Checkout Page Specific Styles */
#checkout-form .form-label {
  font-weight: 600;
  color: var(--text-dark);
}

#checkout-form .form-control,
#checkout-form .form-select {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 10px 15px;
}

#checkout-form .form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

#transfer-details {
  border: 1px dashed var(--border-color);
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  background-color: var(--gray-color);
}

#order-summary .list-group-item {
  border: none;
  padding: 10px 0;
  font-size: 0.95rem;
}

#order-summary .list-group-item small {
  color: var(--text-light);
}

#order-total {
  color: var(--primary-color);
  font-weight: 700;
}

/* Confirmation Page Specific Styles */
.text-center h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  font-weight: 800;
}

.text-center .lead {
  font-size: 1.2rem;
  color: var(--text-dark);
}

.badge {
  padding: 0.6em 0.9em;
  font-size: 0.85em;
  font-weight: 600;
  border-radius: 0.5rem;
}

.badge.bg-warning {
  background-color: var(--secondary-color) !important;
  color: var(--dark-color);
}

.badge.bg-primary {
  background-color: var(--primary-color) !important;
}

.badge.bg-success {
  background-color: #28a745 !important; /* Bootstrap default success */
}

.table-responsive {
  margin-top: 15px;
}

.table th,
.table td {
  vertical-align: middle;
  padding: 10px;
  font-size: 0.9rem;
}

.table thead th {
  background-color: var(--gray-color);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 992px) {
  .navbar-nav {
    margin-top: 10px;
  }
  .search-container {
    margin: 10px 0;
    order: 3; /* Move search below brand on smaller screens */
    flex: 0 0 100%;
  }
  .user-profile {
    margin-left: 0;
    margin-right: 10px;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 60px;
    padding-bottom: 70px;
  }
  .navbar {
    padding: 8px 0;
  }
  .navbar-brand {
    font-size: 1.2rem;
  }
  .search-input {
    padding: 7px 15px 7px 35px;
    font-size: 0.85rem;
  }
  .search-icon {
    left: 12px;
    font-size: 0.8rem;
  }
  .container h1,
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  .card-img-top {
    height: 140px;
  }
  .card-body {
    padding: 15px;
  }
  .card-title {
    font-size: 1rem;
  }
  .card-text {
    font-size: 0.8rem;
  }
  .btn-primary,
  .btn-secondary,
  .btn-success {
    padding: 8px 15px;
    font-size: 0.85rem;
  }
  .fixed-bottom {
    bottom: 15px;
    right: 15px;
  }
  .btn-warning {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
  .btn-warning .cart-icon {
    font-size: 1rem;
  }
  .category-item {
    padding: 7px 15px;
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .col-md-4.mb-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .card-img-top {
    height: 180px;
  }
  .text-center h1 {
    font-size: 2rem;
  }
  .text-center .lead {
    font-size: 1rem;
  }
}
