/**
 * Amazon Style Theme for OpenCart 3.0.5.0
 * Skeleton Loading Styles - Placeholder animations while content loads
 *
 * @package    theme_amazon
 * @author     ChatGPT.com
 * @version    1.0.0
 */

/* ============================================
   SKELETON BASE
   ============================================ */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--amazon-bg-gray-light, #f0f0f0);
  border-radius: var(--amazon-radius, 8px);
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
  transform: translateX(-100%);
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

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

.skeleton-text.skeleton-text-sm {
  height: 12px;
}

.skeleton-text.skeleton-text-lg {
  height: 24px;
}

.skeleton-text.skeleton-text-xl {
  height: 32px;
}

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

.skeleton-image {
  aspect-ratio: 1 / 1;
  width: 100%;
}

.skeleton-button {
  height: 44px;
  width: 100%;
  border-radius: 8px;
}

/* ============================================
   PRODUCT CARD SKELETON
   ============================================ */

.skeleton-product-card {
  background: var(--amazon-bg-light, #fff);
  border-radius: var(--amazon-radius, 8px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-product-card .skeleton-image {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}

.skeleton-product-card .skeleton-title {
  height: 18px;
  width: 85%;
}

.skeleton-product-card .skeleton-title-2 {
  height: 18px;
  width: 60%;
}

.skeleton-product-card .skeleton-rating {
  height: 16px;
  width: 120px;
}

.skeleton-product-card .skeleton-price {
  height: 28px;
  width: 80px;
}

.skeleton-product-card .skeleton-badge {
  height: 20px;
  width: 60px;
  border-radius: 4px;
}

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

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

@media (max-width: 575.98px) {
  .skeleton-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* ============================================
   CAROUSEL SKELETON
   ============================================ */

.skeleton-carousel {
  display: flex;
  gap: 16px;
  overflow: hidden;
}

.skeleton-carousel .skeleton-product-card {
  flex: 0 0 200px;
}

@media (max-width: 575.98px) {
  .skeleton-carousel .skeleton-product-card {
    flex: 0 0 150px;
  }
}

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

.skeleton-hero {
  aspect-ratio: 21 / 9;
  width: 100%;
  border-radius: var(--amazon-radius, 8px);
}

@media (max-width: 767.98px) {
  .skeleton-hero {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 575.98px) {
  .skeleton-hero {
    aspect-ratio: 4 / 3;
  }
}

/* ============================================
   CATEGORY CARD SKELETON
   ============================================ */

.skeleton-category-card {
  background: var(--amazon-bg-light, #fff);
  border-radius: var(--amazon-radius, 8px);
  padding: 16px;
}

.skeleton-category-card .skeleton-title {
  height: 24px;
  width: 70%;
  margin-bottom: 16px;
}

.skeleton-category-card .skeleton-image {
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
}

.skeleton-category-card .skeleton-link {
  height: 16px;
  width: 100px;
}

.skeleton-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 991.98px) {
  .skeleton-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .skeleton-category-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   PRODUCT PAGE SKELETON
   ============================================ */

.skeleton-product-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 767.98px) {
  .skeleton-product-page {
    grid-template-columns: 1fr;
  }
}

.skeleton-product-gallery {
  display: flex;
  gap: 12px;
}

.skeleton-product-gallery .skeleton-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-product-gallery .skeleton-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
}

.skeleton-product-gallery .skeleton-main-image {
  flex: 1;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}

.skeleton-product-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton-product-info .skeleton-brand {
  height: 14px;
  width: 100px;
}

.skeleton-product-info .skeleton-title {
  height: 32px;
  width: 90%;
}

.skeleton-product-info .skeleton-rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-product-info .skeleton-stars {
  height: 20px;
  width: 100px;
}

.skeleton-product-info .skeleton-reviews {
  height: 16px;
  width: 80px;
}

.skeleton-product-info .skeleton-price-box {
  padding: 16px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.skeleton-product-info .skeleton-price-label {
  height: 12px;
  width: 60px;
  margin-bottom: 8px;
}

.skeleton-product-info .skeleton-price-value {
  height: 36px;
  width: 120px;
}

.skeleton-product-info .skeleton-availability {
  height: 20px;
  width: 100px;
}

.skeleton-product-info .skeleton-button-add {
  height: 48px;
  width: 100%;
  border-radius: 24px;
  margin-top: 8px;
}

.skeleton-product-info .skeleton-button-buy {
  height: 48px;
  width: 100%;
  border-radius: 24px;
}

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

.skeleton-cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--amazon-bg-light, #fff);
  border-radius: var(--amazon-radius, 8px);
  margin-bottom: 12px;
}

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

.skeleton-cart-item .skeleton-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-cart-item .skeleton-item-title {
  height: 18px;
  width: 80%;
}

.skeleton-cart-item .skeleton-item-price {
  height: 22px;
  width: 70px;
}

.skeleton-cart-item .skeleton-item-qty {
  height: 32px;
  width: 100px;
  margin-top: auto;
}

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

.skeleton-header {
  background: var(--amazon-primary, #232F3E);
  padding: 12px 0;
}

.skeleton-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.skeleton-logo {
  width: 120px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.skeleton-search-bar {
  flex: 1;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.skeleton-header-actions {
  display: flex;
  gap: 16px;
}

.skeleton-header-action {
  width: 80px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ============================================
   ACCOUNT SKELETON
   ============================================ */

.skeleton-account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 767.98px) {
  .skeleton-account-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .skeleton-account-grid {
    grid-template-columns: 1fr;
  }
}

.skeleton-account-card {
  background: var(--amazon-bg-light, #fff);
  border-radius: var(--amazon-radius, 8px);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.skeleton-account-card .skeleton-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.skeleton-account-card .skeleton-content {
  flex: 1;
}

.skeleton-account-card .skeleton-title {
  height: 18px;
  width: 70%;
  margin-bottom: 8px;
}

.skeleton-account-card .skeleton-desc {
  height: 14px;
  width: 90%;
}

/* ============================================
   REVIEWS SKELETON
   ============================================ */

.skeleton-review {
  padding: 16px 0;
  border-bottom: 1px solid #eee;
}

.skeleton-review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.skeleton-review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-review-meta {
  flex: 1;
}

.skeleton-review-name {
  height: 16px;
  width: 120px;
  margin-bottom: 4px;
}

.skeleton-review-stars {
  height: 14px;
  width: 80px;
}

.skeleton-review-content .skeleton-text {
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-review-content .skeleton-text:last-child {
  width: 60%;
}

/* ============================================
   SEARCH RESULTS SKELETON
   ============================================ */

.skeleton-search-results {
  display: flex;
  gap: 24px;
}

.skeleton-filters {
  width: 250px;
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .skeleton-filters {
    display: none;
  }
}

.skeleton-filter-group {
  margin-bottom: 24px;
}

.skeleton-filter-title {
  height: 18px;
  width: 100px;
  margin-bottom: 12px;
}

.skeleton-filter-option {
  height: 20px;
  width: 80%;
  margin-bottom: 8px;
}

.skeleton-results {
  flex: 1;
}

.skeleton-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.skeleton-results-count {
  height: 16px;
  width: 150px;
}

.skeleton-results-sort {
  height: 36px;
  width: 180px;
  border-radius: 4px;
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Hide skeleton when content is loaded */
[data-loaded="true"] .skeleton,
.loaded .skeleton {
  display: none;
}

/* Show content when loaded */
[data-loaded="true"] .content,
.loaded .content {
  display: block;
}

/* Content hidden by default when skeleton is present */
.has-skeleton .content {
  display: none;
}

/* ============================================
   DARK MODE SKELETON
   ============================================ */

[data-theme="DISABLED-dark"] .skeleton {
  background: var(--amazon-bg-gray-light, #2a2a2a);
}

[data-theme="DISABLED-dark"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .skeleton::after {
    animation: none;
    background: rgba(0, 0, 0, 0.05);
    transform: none;
  }
}
