/* Home catalog loader — mirrors app HomeCatalogLoader */
.dtm-catalog-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dtm-catalog-loader.dtm-catalog-loader--done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dtm-catalog-loader__inner {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 24px;
}

.dtm-catalog-loader__hero {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dtm-catalog-loader__stage {
    position: relative;
    width: 112px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.dtm-catalog-loader__orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(245, 146, 7, 0.22);
    animation: dtm-loader-orbit 2.2s linear infinite;
}

.dtm-catalog-loader__orbit::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59207;
}

@keyframes dtm-loader-orbit {
    to { transform: rotate(360deg); }
}

.dtm-catalog-loader__bubble {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff7ed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(245, 146, 7, 0.18);
    animation: dtm-loader-pulse 1.3s ease-in-out infinite;
}

@keyframes dtm-loader-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.dtm-catalog-loader__hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.dtm-catalog-loader__hero-img.is-visible {
    opacity: 1;
}

.dtm-catalog-loader__hero-shine {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.22);
    opacity: 0.35;
    animation: dtm-loader-shine 2.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes dtm-loader-shine {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

.dtm-catalog-loader__hero-icon {
    font-size: 42px;
    color: #f59207;
    transition: opacity 0.2s ease;
}

.dtm-catalog-loader__hero-icon.is-hidden {
    opacity: 0;
    position: absolute;
}

.dtm-catalog-loader__text {
    text-align: center;
    min-height: 72px;
    padding: 0 8px;
    transition: opacity 0.22s ease;
}

.dtm-catalog-loader__text.is-fading {
    opacity: 0;
}

.dtm-catalog-loader__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.35;
}

.dtm-catalog-loader__subtitle {
    margin: 8px 0 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

.dtm-catalog-loader__dots {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 18px;
    margin: 18px 0 16px;
}

.dtm-catalog-loader__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59207;
    animation: dtm-loader-bounce 0.7s ease-in-out infinite;
}

.dtm-catalog-loader__dot:nth-child(2) { animation-delay: 0.12s; }
.dtm-catalog-loader__dot:nth-child(3) { animation-delay: 0.24s; }

@keyframes dtm-loader-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.dtm-catalog-loader__progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}

.dtm-catalog-loader__progress-fill {
    height: 100%;
    width: 8%;
    border-radius: 999px;
    background: #f59207;
    animation: dtm-loader-progress 9s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

@keyframes dtm-loader-progress {
    to { width: 94%; }
}

.dtm-catalog-loader__hint {
    margin: 10px 0 0;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
}

.dtm-catalog-loader__preview {
    width: 100%;
    margin-top: 36px;
}

.dtm-catalog-loader__preview-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.dtm-catalog-loader__preview-header .material-icons {
    font-size: 16px;
    color: #f59207;
}

.dtm-catalog-loader__preview-label {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.02em;
    transition: opacity 0.22s ease;
}

.dtm-catalog-loader__preview-label.is-fading {
    opacity: 0;
}

.dtm-catalog-loader__cards {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.dtm-catalog-loader__card {
    flex: 1;
    max-width: 168px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #fed7aa;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(245, 146, 7, 0.12);
    animation: dtm-loader-card-pulse 2.4s ease-in-out infinite;
}

.dtm-catalog-loader__card:nth-child(2) {
    animation-delay: 0.18s;
}

@keyframes dtm-loader-card-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.dtm-catalog-loader__card-img-wrap {
    aspect-ratio: 1;
    background: #fff7ed;
    overflow: hidden;
}

.dtm-catalog-loader__card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dtm-catalog-loader__card-footer {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dtm-catalog-loader__card-line {
    height: 9px;
    border-radius: 4px;
    background: #f1f5f9;
}

.dtm-catalog-loader__card-line--wide { width: 88%; }
.dtm-catalog-loader__card-line--short { width: 55%; }

.dtm-catalog-loader__skip {
    margin-top: 28px;
    padding: 12px 28px;
    border: none;
    border-radius: 24px;
    background: #f59207;
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(245, 146, 7, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dtm-catalog-loader__skip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(245, 146, 7, 0.32);
}

.dtm-catalog-loader__skip:active {
    transform: translateY(0);
}

@media (max-width: 360px) {
    .dtm-catalog-loader__title { font-size: 16px; }
    .dtm-catalog-loader__card { max-width: 148px; }
}

/* Compact background prefetch pill (does not block the home catalog loader) */
.dtm-bg-prefetch__icon {
    font-size: 16px !important;
    color: #f59207;
    animation: dtm-bg-prefetch-spin 1.2s linear infinite;
}

.dtm-bg-prefetch {
    position: fixed;
    left: 50%;
    bottom: 88px;
    z-index: 9990;
    display: none;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 32px);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.9);
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dtm-bg-prefetch.is-visible {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dtm-bg-prefetch[hidden] {
    display: none !important;
}

.dtm-bg-prefetch__spin {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #f59207;
    border-radius: 50%;
    animation: dtm-bg-prefetch-spin 0.7s linear infinite;
}

.dtm-bg-prefetch__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes dtm-bg-prefetch-spin {
    to { transform: rotate(360deg); }
}

/* Temu-style freeze overlay + stale-while-revalidate shimmer */
#dtm-home-keepalive {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20050;
    background: #ffffff;
}
#dtm-home-keepalive.is-open { display: block; }
#dtm-home-keepalive iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
    display: none;
}
#dtm-home-keepalive iframe.is-active { display: block; }
body.dtm-product-overlay-open { overflow: hidden; }

.dtm-feed-revalidate-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    height: 3px;
    overflow: hidden;
    background: #FED7AA;
}
body.dtm-feed-revalidate .dtm-feed-revalidate-bar { display: block; }
.dtm-feed-revalidate-bar span {
    display: block;
    height: 100%;
    width: 40%;
    background: #f59207;
    animation: dtm-feed-revalidate-slide 0.9s ease-in-out infinite;
}
@keyframes dtm-feed-revalidate-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(350%); }
}
body.dtm-feed-revalidate .product-card,
body.dtm-feed-revalidate .product-card.horizontal {
    opacity: 0.88;
    transition: opacity 0.2s ease;
}
html.dtm-embed-product .bottom-nav,
body.dtm-embed-product .bottom-nav {
    display: none !important;
}
