/* =============================================================================
   ALLANI SKELETON SCREENS — Instant Loading Feel
   Shows placeholder content while page loads, then fades to real content.
   ============================================================================= */

/* ── 1. SKELETON ANIMATION ── */
@keyframes allani-shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

.allani-skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0px,
    #e0e0e0 40px,
    #f0f0f0 80px
  );
  background-size: 800px 100%;
  animation: allani-shimmer 1.8s ease-in-out infinite;
  border-radius: 8px;
}

/* ── 2. SKELETON HEADER (shows while real header loads) ── */
.allani-skeleton-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-bottom: 1px solid #e4d8c0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.allani-skeleton-header.allani-skeleton-hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

/* Desktop skeleton header */
.allani-skeleton-header__desktop {
  display: none;
  padding: 16px 0;
}

@media (min-width: 768px) {
  .allani-skeleton-header__desktop {
    display: block;
  }
  .allani-skeleton-header__mobile {
    display: none;
  }
}

.allani-skeleton-header__row {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.allani-skeleton-header__logo {
  width: 180px;
  height: 50px;
}

.allani-skeleton-header__search {
  flex: 1;
  height: 44px;
  max-width: 500px;
}

.allani-skeleton-header__actions {
  display: flex;
  gap: 12px;
}

.allani-skeleton-header__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* Mobile skeleton header */
.allani-skeleton-header__mobile {
  padding: 12px 16px;
}

.allani-skeleton-header__mobile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.allani-skeleton-header__mobile-logo {
  width: 120px;
  height: 36px;
}

.allani-skeleton-header__mobile-icons {
  display: flex;
  gap: 8px;
}

.allani-skeleton-header__mobile-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.allani-skeleton-header__mobile-search {
  height: 40px;
  margin-top: 12px;
}

/* ── 3. SKELETON PRODUCT GRID ── */
.allani-skeleton-products {
  padding: 24px 0;
  transition: opacity 0.4s ease;
}

.allani-skeleton-products.allani-skeleton-hidden {
  opacity: 0;
  pointer-events: none;
}

.allani-skeleton-products__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (max-width: 767px) {
  .allani-skeleton-products__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 450px) {
  .allani-skeleton-products__grid {
    grid-template-columns: 1fr;
  }
}

.allani-skeleton-products__card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.allani-skeleton-products__image {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 12px;
}

.allani-skeleton-products__title {
  height: 16px;
  width: 80%;
  margin-bottom: 8px;
}

.allani-skeleton-products__price {
  height: 20px;
  width: 50%;
}

/* ── 4. SKELETON FOOTER ── */
.allani-skeleton-footer {
  background: #1e1e2e;
  padding: 40px 0;
  margin-top: 60px;
  transition: opacity 0.3s ease;
}

.allani-skeleton-footer.allani-skeleton-hidden {
  opacity: 0;
}

.allani-skeleton-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.allani-skeleton-footer__title {
  height: 20px;
  width: 60%;
  margin-bottom: 16px;
  background: linear-gradient(
    90deg,
    #2d2d44 0px,
    #3d3d54 40px,
    #2d2d44 80px
  );
  background-size: 800px 100%;
  animation: allani-shimmer 1.8s ease-in-out infinite;
  border-radius: 4px;
}

.allani-skeleton-footer__line {
  height: 14px;
  width: 100%;
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    #2d2d44 0px,
    #3d3d54 40px,
    #2d2d44 80px
  );
  background-size: 800px 100%;
  animation: allani-shimmer 1.8s ease-in-out infinite;
  border-radius: 4px;
}

.allani-skeleton-footer__line:last-child {
  width: 70%;
}

/* ── 5. HIDE SKELETONS WHEN REAL CONTENT LOADS ── */
body.allani-loaded .allani-skeleton-header,
body.allani-loaded .allani-skeleton-products,
body.allani-loaded .allani-skeleton-footer {
  display: none;
}

/* ── 6. FADE IN REAL CONTENT ── */
.allani-fade-in {
  animation: allani-fade-in 0.4s ease forwards;
}

@keyframes allani-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Initially hide real content until skeleton is ready */
body:not(.allani-loaded) #dor-header01,
body:not(.allani-loaded) #dor-topbar01 {
  opacity: 0;
}

body.allani-loaded #dor-header01,
body.allani-loaded #dor-topbar01 {
  animation: allani-fade-in 0.4s ease forwards;
}
