/* ---------- Main Container ---------- */
.main {
  max-width: 850px;
  margin-top: 90px;
  margin-bottom: 100px;
  padding-left: 20px;
  padding-right: 20px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Page Title ---------- */
.page-title {
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 25px;
  color: var(--primary-dark);
}

/* ---------- Orders Grid ---------- */

/* Orders grid container */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns */
  gap: 5px; /* spacing between cards */
  padding: 5px; /* optional padding around grid */
  justify-items: center; /* align cards to left */
}

/* Order container inside the grid */
.order-container {
  border: 2px solid black;      
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  background-color: #fff; /* optional for card look */
}



/* ---------- Order Header ---------- */
.order-header {
  background-color: rgb(240, 242, 242);
  border: 1px solid rgb(213, 217, 217);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.order-header-left-section {
  display: flex;
  flex-direction:column;
  flex-shrink: 0;
}

.order-header-label {
  font-weight: 500;
}

.order-date,
.order-total {
  margin-right: 45px;
}

.order-header-right-section {
    display: flex;
    flex-direction: column;
  flex-shrink: 1;
}

/* ---------- Order Details Grid ---------- */
.order-details-grid {
  padding: 40px 25px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  align-items: stretch;
  justify-items: center;
}

/* ---------- Product Card ---------- */
.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
  height: 100%;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  border: 2px solid black;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* ---------- Product Image Container ---------- */
.product-image-container {
  width: 100%;
  height: 250px;                     /* fixed container height */
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f8f8;         /* optional background */
  border-radius: 10px;
  margin-bottom: 15px;
}

.product-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;               /* prevents cropping */
}

/* ---------- Product Details ---------- */
.product-name {
  font-weight: 700;
  margin-bottom: 5px;
}

.product-delivery-date {
  margin-bottom: 3px;
  font-size: 14px;
  color: var(--dark-gray);
}

.product-quantity {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--dark-gray);
}
/* Cancel Order Button */
.cancel-order-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background-color: #ff4d4f; /* Red for cancel */
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.cancel-order-btn:hover {
  background-color: #e63946;
  transform: translateY(-2px);
}

.cancel-order-btn:active {
  transform: translateY(0);
  background-color: #d62828;
}

/* Optional: align button nicely inside product card */
.product-card .cancel-order-btn {
  width: 120px;
  text-align: center;
}

/* ---------- Buttons ---------- */
.no-orders-message{
  font-size: 18px;
  text-align: center;
  margin-top: 50px;
  color: var(--dark-gray);
}
.buy-again-button {
  font-size: 15px;
  width: 100%;
  margin-bottom: 5px;
  background-color: var(--accent-emerald);
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.buy-again-button:hover {
  background-color: #28a745;
}

.track-package-button {
  width: 100%;
  border: 1px solid black;
  background-color: #fff;
  color: black;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.track-package-button:hover {
  background-color: #f0f0f0;
}

.invoice-button {
  width: 100%;
  border: 1px solid var(--primary-dark);
  background-color: #fff;
  color: var(--primary-dark);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 15px;
}

.invoice-button:hover {
  background-color: var(--primary-dark);
  color: white;
}

/* ---------- Responsive Styles ---------- */
@media (max-width: 800px) {
  .order-details-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 20px 15px;
  }

  .product-card {
    width: 100%;
    max-width: 100%;
  }

  .buy-again-button {
    margin-bottom: 10px;
  }

  .product-actions {
    grid-column: 1;
    margin-bottom: 30px;
  }

  .track-package-button {
    width: 100%;
  }

  .invoice-button {
    width: 100%;
  }
}

@media (max-width: 575px) {
  .order-header {
    flex-direction: column;
    align-items: start;
    line-height: 23px;
    padding: 15px;
  }

  .order-header-left-section {
    flex-direction: column;
  }

  .order-header-label {
    margin-right: 5px;
  }

  .order-date,
  .order-total {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .order-header-right-section {
    display: flex;
    flex-direction: column;
    flex-shrink: 1;
  }
}

@media (max-width: 600px) {
  .order-details-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px 10px;
  }

  .product-card {
    max-width: 100%;
    padding: 15px;
  }

  .product-image-container {
    height: 200px;
    margin-bottom: 15px;
  }

  .product-name {
    margin-bottom: 10px;
  }

  .product-quantity {
    margin-bottom: 15px;
  }

  .buy-again-button {
    width: 100%;
    margin-bottom: 15px;
  }

  .track-package-button {
    width: 100%;
    padding: 12px;
  }
}
@media screen and (max-width: 1024px) {
  .orders-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on medium screens */
  }
}

@media screen and (max-width: 600px) {
  .orders-grid {
    grid-template-columns: 1fr; /* 1 column on mobile */
  }
}
