/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0d1b2a;
  font-family: 'Segoe UI', sans-serif;
  color: #e0e0e0;
  padding: 10px;
  animation: pulseBackground 8s infinite;
}

/* === ANIMATED BACKGROUND === */
@keyframes pulseBackground {
  0%, 100% { background-color: #0d1b2a; }
  50% { background-color: #132238; }
}

.outer-bg-container {
  max-width: 420px;
  margin: auto;
  padding: 10px;
  background: #1f1f1f;
  border-radius: 14px;
  box-shadow: 0 0 25px rgba(0, 191, 255, 0.2);
  animation: fadeInUp 0.6s ease, glowPulse 6s infinite;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 25px rgba(218, 165, 32, 0.15); }
  50% { box-shadow: 0 0 40px rgba(218, 165, 32, 0.4); }
}

/* === TITLE === */
.page-title {
  text-align: center;
  margin-bottom: 25px;
  font-size: 26px;
  color: #00bfff;
}

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-bar input,
.filter-bar select {
  flex: 1;
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px 12px;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: #00bfff;
  outline: none;
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

/* === PRODUCT GRID === */
.product-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === Row of 2 products === */
.product-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* === Product Card === */
.product-box {
  width: 50%;
}

/* === KEEP LAYOUT CONSISTENT ON MOBILE === */
@media (max-width: 9999px) {
  .product-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap; /* prevent wrapping */
  }

  .product-box {
    width: 50%;
  }

  .filter-bar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
  }

  .filter-bar input,
  .filter-bar select {
    flex: 1;
    min-width: 0; /* ensure flex elements shrink properly */
  }
}

/* === PRODUCT CARD === */
.card {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(218, 165, 32, 0.3);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 25px rgba(218, 165, 32, 0.5);
}

.card-img-top {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid #444;
}

.card-body {
  padding: 15px;
}

.card-title {
  font-size: 18px;
  color: #f5c842;
  margin-bottom: 8px;
}

.card-text {
  font-size: 14px;
  color: #ccc;
}

.card-text.fw-bold {
  color: #00bfff;
  margin-top: 10px;
}

/* === ADD TO CART BUTTON === */
.add-cart-btn {
  background: #f5c842;
  color: #000;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  border: none;
  margin-top: 12px;
  transition: background 0.3s ease;
  width: 100%;
}

.add-cart-btn:hover {
  background: #e0b222;
}

/* === CART BAR === */
.cart-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #222;
  border-radius: 8px;
  border: 1px solid #444;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.cart-bar span {
  font-weight: bold;
  color: #f5c842;
}

.cart-bar button {
  background: #00bfff;
  color: #fff;
  border: none;
  padding: 8px 14px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.cart-bar button:hover {
  background: #0099cc;
}

/* === LOAD MORE BUTTON === */
#loadMoreBtn {
  display: block;
  margin: 25px auto 0;
  background: #f5c842;
  color: #000;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

#loadMoreBtn:hover {
  background: #e0b222;
}

/* === MODALS === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal.active {
  display: flex;
}

.modal-box {
  background: #1f1f1f;
  padding: 20px;
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.cart-item {
  background: #2a2a2a;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
}

.cart-item input.qty-input {
  width: 50px;
  margin-left: 5px;
  padding: 4px;
  border-radius: 4px;
  border: none;
}

.modal-close-icon {
  font-size: 20px;
  cursor: pointer;
  color: #ccc;
  transition: color 0.2s ease;
}

.modal-close-icon:hover {
  color: #ff4d4d;
}

.cart-total {
  text-align: right;
  font-weight: bold;
  color: #f5c842;
  margin: 10px 0 16px;
  font-size: 16px;
}

.checkout-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.checkout-actions button {
  flex: 1;
}

.success-alert {
  background: #1e4620;
  color: #a5f6b0;
  border: 1px solid #2ecc71;
  padding: 10px;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
}

.modal-box input,
.modal-box textarea {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 6px;
  border: none;
  background: #333;
  color: #fff;
}

.modal-box button {
  background: #00bfff;
  color: #fff;
  padding: 10px 16px;
  margin-top: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
}

.modal-box button:hover {
  background: #0099cc;
}

.inline-qty {
  background: #991b1b;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  display: inline-block;
  width: 100%;
  text-align: center;
}

.inline-qty-input {
  width: 40px;
  padding: 2px 4px;
  margin: 0 4px;
  border-radius: 4px;
  border: none;
  text-align: center;
}

/* Ensure all product boxes are the same height */
.product-box {
  display: flex;
  flex-direction: column;
}

.card {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}