/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  padding-top: 80px;
  overflow-x: hidden;
  background-color: #f8f9fa;
}

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  font-family: 'Poppins', 'Inter', Arial, sans-serif;
  margin-bottom: 1rem;
}

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 2000;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  font-family: 'Poppins', 'Inter', Arial, sans-serif;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-weight: 500;
  font-size: 16px;
  transition: color 0.2s;
}

.nav-links a.active {
  color: #4caf50;
}

.nav-links a:hover {
  color: #4caf50;
}

.cart-icon {
  background-color: #4caf50;
  padding: 6px 12px;
  border-radius: 8px;
  color: #fff;
}

/* Cart Popup */
.cart-popup-container {
  position: fixed;
  right: 0;
  top: 84px;
  width: 100%;
  max-width: 400px;
  height: 70vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid rgb(53, 51, 51);
  background-color: rgb(238, 238, 238);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
}

.cart-popup-container.show {
  transform: translateX(0%);
}

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgb(177, 177, 177);
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 10px;
  background: white;
}

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

.item-details-container {
  flex: 1;
  margin-left: 12px;
}

.item-details-container p {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.update-quantity-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.update-quantity-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #4caf50;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.cart-footer {
  padding: 16px;
  border-top: 1px solid rgb(177, 177, 177);
  background: white;
}

.subtotal-container {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.checkout-btn {
  width: 100%;
  height: 50px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: bold;
  background-color: #ffc107;
  color: #000;
  transition: background-color 0.3s;
}

.checkout-btn:hover {
  background-color: #e0a800;
}

.cart-note-container p {
  margin: 0;
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* Main Content */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

.page-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 30px;
  text-align: center;
}

/* Orders Grid */
.orders-grid {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Empty State */
.orders-grid > p {
  text-align: center;
  font-size: 1.2rem;
  color: #666;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Order Container */
.order-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.order-container:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Order Header */
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  flex-wrap: wrap;
  gap: 15px;
}

.order-header-left-section {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.order-header-right-section {
  text-align: right;
}

.order-date,
.order-total {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.order-header-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-header div:not(.order-header-label) {
  font-weight: 600;
  color: #111827;
}

/* Order Details Grid */
.order-details-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.order-details-grid > p {
  padding: 30px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Product Row */
.order-details-grid > div {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  align-items: start;
}

.order-details-grid > div:last-child {
  border-bottom: none;
}

/* Product Image */
.product-image-container {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Details */
.product-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 5px;
}

.product-delivery-date {
  font-size: 0.9rem;
  color: #4caf50;
  font-weight: 500;
}

.product-delivery-date span {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.product-quantity {
  font-size: 0.9rem;
  color: #666;
}

/* Buy Again Button */
.buy-again-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #4caf50;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 10px;
  transition: background-color 0.3s;
  width: fit-content;
}

.buy-again-button:hover {
  background: #45a049;
}

.buy-again-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

/* Product Actions */
.product-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.track-package-button {
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s;
  white-space: nowrap;
}

.track-package-button:not([disabled]) {
  background: #2196f3;
  color: white;
}

.track-package-button:not([disabled]):hover {
  background: #1976d2;
}

.track-package-button[disabled] {
  background: #6c757d;
  color: white;
  cursor: not-allowed;
}

/* Footer */
footer {
  background-color: #4caf50;
  color: #fff;
  padding: 40px 20px 20px;
  margin-top: 50px;
}

.footer-section {
  flex: 1;
  min-width: 150px;
  margin: 10px;
}

.footer-section h3 {
  margin-bottom: 10px;
}

.footer-section p,
.footer-section a {
  margin: 5px 0;
  color: #fff;
  text-decoration: none;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-section input[type="email"] {
  padding: 8px;
  margin-top: 5px;
  margin-bottom: 10px;
  width: 100%;
  border: none;
  border-radius: 4px;
}

.footer-section button {
  padding: 8px 25px;
  background-color: #ffc107;
  color: #000;
  border: none;
  border-radius: 4px;
  font-size: medium;
  cursor: pointer;
}

.footer-section button:hover {
  background-color: #e0a800;
}

.payment-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.payment-icons img {
  width: 50px;
  height: auto;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  body {
    padding-top: 70px;
  }

  .nav {
    padding: 10px 15px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links li {
    margin: 5px 10px;
  }

  .nav-links a {
    font-size: 16px;
  }

  .main {
    padding: 20px 15px;
  }

  .page-title {
    font-size: 2rem;
  }

  .order-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

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

  .order-header-right-section {
    text-align: left;
    width: 100%;
  }

  .order-details-grid > div {
    grid-template-columns: 80px 1fr;
    gap: 15px;
  }

  .product-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
    margin-top: 10px;
  }

  .cart-popup-container {
    top: 70px;
    max-width: 100%;
    height: calc(100vh - 70px);
  }

  footer {
    flex-direction: column;
    height: auto;
    padding: 20px 10px;
  }

  .footer-section {
    min-width: 100%;
    text-align: center;
    margin: 10px 0;
  }
}

@media screen and (max-width: 480px) {
  .order-details-grid > div {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .product-image-container {
    margin: 0 auto;
  }

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

  .product-actions {
    justify-content: center;
  }

  .page-title {
    font-size: 1.8rem;
  }
}

/* Tablet & Desktop View - min-width:601px */
@media (min-width: 601px) {
  .footer-section {
    min-width: 200px;
  }
}

/* Large Desktop View - min-width: 992px */
@media (min-width: 992px) {
  .order-details-grid > div {
    grid-template-columns: 100px 1fr 150px;
  }
}

/* Animation for order items */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-container {
  animation: fadeInUp 0.5s ease forwards;
}

.order-container:nth-child(1) { animation-delay: 0.1s; }
.order-container:nth-child(2) { animation-delay: 0.2s; }
.order-container:nth-child(3) { animation-delay: 0.3s; }
.order-container:nth-child(4) { animation-delay: 0.4s; }
.order-container:nth-child(5) { animation-delay: 0.5s; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-delivered {
  background: #e8f5e8;
  color: #2e7d32;
}

.status-shipped {
  background: #e3f2fd;
  color: #1565c0;
}

.status-processing {
  background: #fff3e0;
  color: #ef6c00;
}

.status-cancelled {
  background: #ffebee;
  color: #c62828;
}

/* Loading state */
.orders-grid.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Print styles */
@media print {
  .header,
  .cart-popup-container,
  footer {
    display: none;
  }
  
  body {
    padding-top: 0;
  }
  
  .order-container {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}