/* ========================================
   SKELETON LOADER STYLES
   ======================================== */

/* Skeleton base animation */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0px, #e0e0e0 40px, #f0f0f0 80px);
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s infinite ease-in-out;
  border-radius: 4px;
}

/* Dark mode skeleton */
@media (prefers-color-scheme: dark) {
  .skeleton {
    background: linear-gradient(90deg, #2a2a2a 0px, #3a3a3a 40px, #2a2a2a 80px);
  }
}

/* ========================================
   PRODUCT GRID SKELETON
   ======================================== */

.skeleton-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.skeleton-product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.skeleton-product-image {
  width: 100%;
  height: 280px;
  background: linear-gradient(90deg, #f0f0f0 0px, #e0e0e0 40px, #f0f0f0 80px);
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s infinite ease-in-out;
}

.skeleton-product-info {
  padding: 20px;
}

.skeleton-product-title {
  height: 24px;
  margin-bottom: 12px;
  border-radius: 4px;
}

.skeleton-product-category {
  height: 16px;
  width: 60%;
  margin-bottom: 12px;
  border-radius: 4px;
}

.skeleton-product-price {
  height: 28px;
  width: 40%;
  border-radius: 4px;
}

/* ========================================
   HEADER SKELETON
   ======================================== */

.skeleton-header {
  background: #b30000;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skeleton-logo {
  width: 120px;
  height: 32px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0px,
    rgba(255, 255, 255, 0.2) 40px,
    rgba(255, 255, 255, 0.1) 80px
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s infinite ease-in-out;
  border-radius: 4px;
}

.skeleton-nav {
  display: flex;
  gap: 20px;
}

.skeleton-nav-item {
  width: 80px;
  height: 20px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0px,
    rgba(255, 255, 255, 0.2) 40px,
    rgba(255, 255, 255, 0.1) 80px
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s infinite ease-in-out;
  border-radius: 4px;
}

/* ========================================
   CART SKELETON
   ======================================== */

.skeleton-cart-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skeleton-cart-image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
}

.skeleton-cart-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-cart-title {
  height: 20px;
  width: 60%;
  border-radius: 4px;
}

.skeleton-cart-price {
  height: 24px;
  width: 40%;
  border-radius: 4px;
}

.skeleton-cart-quantity {
  height: 32px;
  width: 120px;
  border-radius: 4px;
}

/* ========================================
   TRANSACTION SKELETON
   ======================================== */

.skeleton-transaction-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skeleton-transaction-row {
  height: 18px;
  margin-bottom: 12px;
  border-radius: 4px;
}

.skeleton-transaction-row:nth-child(1) {
  width: 80%;
}

.skeleton-transaction-row:nth-child(2) {
  width: 60%;
}

.skeleton-transaction-row:nth-child(3) {
  width: 40%;
}

/* ========================================
   BANNER SKELETON
   ======================================== */

.skeleton-banner {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  margin-bottom: 40px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.skeleton-text {
  height: 16px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-text-lg {
  height: 24px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-rounded {
  border-radius: 12px;
}

/* Hide skeleton when content is loaded */
.content-loaded .skeleton-loader {
  display: none;
}

/* Show content only when loaded */
.content-hidden {
  display: none;
}

.content-loaded .content-hidden {
  display: block;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .skeleton-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  .skeleton-product-image {
    height: 180px;
  }

  .skeleton-nav {
    display: none;
  }

  .skeleton-banner {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .skeleton-cart-item {
    flex-direction: column;
  }

  .skeleton-cart-image {
    width: 100%;
    height: 200px;
  }
}
