* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #f3f3f3;
}

.navbar {
  background: #131921;
  color: white;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.logo {
  color: #ff9900;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}

.navbar input {
  flex: 1;
  padding: 8px;
  min-width: 200px;
  border-radius: 4px;
  border: none;
}

.cart-link {
  color: white;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 12px;
  background: #ff9900;
  border-radius: 4px;
  font-weight: 500;
}

.container {
  padding: 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.product-card {
  background: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.product-grid img {
  width: 100%;
  max-width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.product-card h3 {
  font-size: 16px;
  margin: 10px 0;
  min-height: 40px;
}

.product-card p {
  font-size: 18px;
  font-weight: bold;
  color: #B12704;
  margin: 8px 0;
}

.product-card button {
  background: #ffd814;
  border: none;
  padding: 10px;
  width: 100%;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 500;
  transition: background 0.2s;
}

.product-card button:hover {
  background: #f7ca00;
}

.product-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-details img {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
}

.product-info h2 {
  margin-bottom: 10px;
  font-size: 1.8rem;
}

.product-info p {
  margin: 10px 0;
  line-height: 1.6;
}

.product-info button {
  background: #ffd814;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  width: 200px;
  border-radius: 4px;
  font-weight: 500;
  margin-top: 15px;
  transition: background 0.2s;
}

.product-info button:hover {
  background: #f7ca00;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px;
  border-bottom: 1px solid #ddd;
  background: white;
  margin-bottom: 10px;
  border-radius: 4px;
}

.cart-item-image img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  margin: 0 0 5px;
  font-size: 1.1rem;
}

.cart-item-price {
  margin: 0 0 10px;
  color: #555;
  font-weight: 500;
  font-size: 1rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cart-item-quantity button {
  width: 32px;
  height: 32px;
  background-color: #eee;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

.cart-item-quantity button:hover {
  background-color: #ddd;
}

.cart-item-quantity span {
  min-width: 30px;
  text-align: center;
  display: inline-block;
  font-weight: 500;
}

.cart-item-remove {
  padding: 8px 12px;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.cart-item-remove:hover {
  background-color: #d32f2f;
}

.cart-item-total {
  font-size: 1.1rem;
  font-weight: bold;
  min-width: 80px;
  text-align: right;
  color: #B12704;
}

.cart-summary {
  background: white;
  padding: 20px;
  margin-top: 20px;
  text-align: right;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-summary h2 {
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.checkout-btn {
  background: #ffa41c;
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  transition: background 0.2s;
}

.checkout-btn:hover {
  background: #ff8f00;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  max-width: 400px;
  margin: 20px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.modal-content h2 {
  margin-bottom: 15px;
  color: #28a745;
}

.modal-content button {
  padding: 10px 20px;
  background: #28a745;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 5px;
  font-size: 16px;
}

/* Confetti canvas */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  z-index: 999;
}

/* Modal animation */
@keyframes modalIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal.show .modal-content {
  animation: modalIn 0.5s ease forwards;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  .navbar {
    padding: 12px;
    gap: 10px;
  }

  .logo {
    font-size: 1.3rem;
  }

  .navbar input {
    min-width: 150px;
    font-size: 14px;
  }

  .cart-link {
    padding: 6px 10px;
    font-size: 14px;
  }

  .container {
    padding: 15px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .product-card {
    padding: 12px;
  }

  .product-grid img {
    height: 150px;
    max-width: 150px;
  }

  .product-card h3 {
    font-size: 14px;
    min-height: 35px;
  }

  .product-card p {
    font-size: 16px;
  }

  .product-card button {
    padding: 8px;
    font-size: 14px;
  }

  /* Product Details - Stack on tablet */
  .product-details {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 15px;
  }

  .product-details img {
    max-width: 100%;
    margin: 0 auto;
  }

  .product-info h2 {
    font-size: 1.5rem;
  }

  .product-info button {
    width: 100%;
    max-width: 300px;
  }

  /* Cart Items */
  .cart-item {
    gap: 15px;
    padding: 12px;
  }

  .cart-item-image img {
    width: 80px;
    height: 80px;
  }

  .cart-item-title {
    font-size: 1rem;
  }

  .cart-item-price {
    font-size: 0.95rem;
  }

  .cart-summary {
    padding: 15px;
  }

  .cart-summary h2 {
    font-size: 1.3rem;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  .navbar {
    padding: 10px;
    gap: 8px;
  }

  .logo {
    font-size: 1.2rem;
    order: 1;
  }

  .navbar input {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    margin-top: 8px;
    font-size: 14px;
    padding: 10px;
  }

  .cart-link {
    order: 2;
    font-size: 13px;
    padding: 6px 10px;
  }

  .container {
    padding: 10px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card {
    padding: 10px;
  }

  .product-grid img {
    height: 120px;
    max-width: 120px;
  }

  .product-card h3 {
    font-size: 13px;
    min-height: 32px;
    margin: 8px 0;
  }

  .product-card p {
    font-size: 15px;
    margin: 6px 0;
  }

  .product-card button {
    padding: 8px;
    font-size: 13px;
  }

  /* Product Details - Full mobile stack */
  .product-details {
    padding: 12px;
    gap: 15px;
  }

  .product-info h2 {
    font-size: 1.3rem;
  }

  .product-info p {
    font-size: 14px;
  }

  .product-info button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
  }

  /* Cart Items - Stack vertically */
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .cart-item-image {
    width: 100%;
    text-align: center;
  }

  .cart-item-image img {
    width: 120px;
    height: 120px;
  }

  .cart-item-details {
    width: 100%;
  }

  .cart-item-title {
    font-size: 0.95rem;
  }

  .cart-item-price {
    font-size: 0.9rem;
  }

  .cart-item-quantity {
    gap: 8px;
  }

  .cart-item-quantity button {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .cart-item-remove {
    width: 100%;
    padding: 10px;
  }

  .cart-item-total {
    width: 100%;
    text-align: left;
    font-size: 1.2rem;
    margin-top: 5px;
  }

  .cart-summary {
    padding: 12px;
    text-align: center;
  }

  .cart-summary h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }

  .checkout-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
  }

  .modal-content {
    padding: 20px;
    margin: 15px;
  }

  .modal-content h2 {
    font-size: 1.3rem;
  }

  .modal-content p {
    font-size: 14px;
  }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-grid img {
    height: 180px;
    max-width: 180px;
  }

  .logo {
    font-size: 1.1rem;
  }

  .cart-link {
    font-size: 12px;
    padding: 5px 8px;
  }
}