/* =========================================================
   Skeleton Loading UI
   Visible while the page loads; removed after preloader fades
   ========================================================= */

@keyframes skel-shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}

/* Lets a wrapper div "disappear" from layout so its children participate in the parent grid */
.d-contents { display: contents !important; }

/* Base shimmer block */
.skel {
    display: block;
    background: linear-gradient(
        90deg,
        #f2f2f2 25%,
        #e8e8e8 37%,
        #f2f2f2 63%
    );
    background-size: 800px 100%;
    animation: skel-shimmer 1.5s ease infinite;
    border-radius: 4px;
}

/* ---- Visibility toggle ---- */
/* Default: skeleton hidden, real content visible */
.skeleton-ui { display: none !important; }

/* While page is loading */
html.is-loading .skeleton-ui { display: block !important; }
html.is-loading .real-ui     { display: none !important; }

/*
 * Hide the spinner preloader on pages that supply their own skeleton UI.
 * The skeleton replaces the spinner as the loading indicator.
 * :has() is supported in all modern browsers (Chrome 105+, Firefox 121+, Safari 15.4+).
 */
html.is-loading:has(.skeleton-ui) .preload-container {
    display: none !important;
}

/* ---- Hero Slider ---- */
.skel-slider {
    width: 100%;
    height: 420px;
    border-radius: 0;
}
@media (min-width: 768px)  { .skel-slider { height: 560px; } }
@media (min-width: 1200px) { .skel-slider { height: 680px; } }

/* ---- Section headings ---- */
.skel-heading    { height: 26px; border-radius: 4px; }
.skel-subheading { height: 15px; border-radius: 4px; }

/* ---- Product card ---- */
.skel-card .skel-card-img {
    width: 100%;
    padding-bottom: 133%;   /* 3 : 4 portrait ratio */
    border-radius: 6px;
}
.skel-card .skel-card-title {
    height: 14px;
    width: 72%;
    border-radius: 4px;
    margin-top: 12px;
}
.skel-card .skel-card-price {
    height: 12px;
    width: 38%;
    border-radius: 4px;
    margin-top: 8px;
}

/* ---- Category card ---- */
.skel-cat .skel-cat-img {
    width: 100%;
    padding-bottom: 132%;
    border-radius: 6px;
}
.skel-cat .skel-cat-name {
    height: 16px;
    width: 60%;
    border-radius: 4px;
    margin: 12px auto 6px;
}
.skel-cat .skel-cat-count {
    height: 12px;
    width: 40%;
    border-radius: 4px;
    margin: 0 auto;
}

/* ---- Shop sidebar ---- */
.skel-sidebar-title {
    height: 18px;
    width: 130px;
    border-radius: 4px;
    margin-bottom: 18px;
}
.skel-sidebar-item {
    height: 13px;
    width: 100%;
    border-radius: 4px;
    margin-bottom: 12px;
}

/* ---- Product detail: image gallery ---- */
.skel-detail-main-img {
    width: 100%;
    padding-bottom: 133%;
    border-radius: 6px;
    margin-bottom: 10px;
}
.skel-detail-thumbs {
    display: flex;
    gap: 8px;
}
.skel-detail-thumb {
    width: 68px;
    height: 90px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ---- Product detail: info panel ---- */
.skel-detail-category { height: 12px; width: 80px;  border-radius: 4px; margin-bottom: 16px; }
.skel-detail-title    { height: 30px; width: 88%;   border-radius: 6px; margin-bottom: 10px; }
.skel-detail-title-2  { height: 24px; width: 55%;   border-radius: 6px; margin-bottom: 20px; }
.skel-detail-stars    { height: 14px; width: 130px; border-radius: 4px; margin-bottom: 18px; }
.skel-detail-price    { height: 30px; width: 100px; border-radius: 6px; margin-bottom: 22px; }

.skel-detail-line {
    height: 13px;
    width: 100%;
    border-radius: 4px;
    margin-bottom: 8px;
}
.skel-detail-line-sm {
    height: 13px;
    width: 65%;
    border-radius: 4px;
    margin-bottom: 24px;
}
.skel-detail-var-label {
    height: 14px;
    width: 70px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.skel-detail-swatches {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.skel-detail-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.skel-detail-size-opts {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.skel-detail-size-opt {
    height: 36px;
    width: 56px;
    border-radius: 4px;
    flex-shrink: 0;
}
.skel-detail-btn {
    height: 52px;
    flex: 1;
    border-radius: 8px;
    margin-top: 8px;
}
.skel-detail-btn-sm {
    height: 52px;
    width: 52px;
    border-radius: 8px;
    margin-top: 8px;
    flex-shrink: 0;
}

/* ---- Product banner (full-width image strip) ---- */
.skel-banner {
    width: 100%;
    height: 120px;
    border-radius: 12px;
}
@media (min-width: 768px)  { .skel-banner { height: 160px; } }
@media (min-width: 1200px) { .skel-banner { height: 200px; } }

/*
 * Hide individual banner shimmer placeholders while the skeleton-ui is
 * still covering the page — they become visible only after phase 1 reveals
 * the page, so phase-2 banner slots shimmer while their AJAX loads.
 */
html.is-loading [id^="banner-"] { display: none !important; }

/* ---- Category "View All" slide ---- */
.cate-view-all {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 338 / 445;
    background: #f5f8fa;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}
.cate-view-all:hover {
    background: #eef0f5;
    color: inherit;
}
.cate-view-all-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #e4e6ef;
    margin-bottom: 16px;
}
@media (max-width: 575px) {
    .cate-view-all-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }
    .cate-view-all .h5,
    .product-view-all .h5 {
        font-size: 13px;
    }
}

/* ---- Product "View All" slide (Best Sellers / New Arrivals / Flash Deals) ---- */
/* Sits inside .card-product > .card-product_wrapper which already has aspect-ratio:0.75 */
.product-view-all {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f5f8fa;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}
.product-view-all:hover {
    background: #eef0f5;
    color: inherit;
}
@media (max-width: 575px) {
    .product-view-all .cate-view-all-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }
}

/* ---- Image progressive loading ---- */
/* Shimmer on image wrapper while <img> is downloading */
.product-img,
.cate-image {
    background: linear-gradient(90deg, #f2f2f2 25%, #e8e8e8 37%, #f2f2f2 63%);
    background-size: 800px 100%;
    animation: skel-shimmer 1.5s ease infinite;
}
/* <img> starts invisible; fades in once loaded */
.product-img img,
.cate-image img {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.product-img img.img-loaded,
.cate-image img.img-loaded {
    opacity: 1;
}

/* =========================================================
   Auth Modal — OR divider
   ========================================================= */
.or-text {
    position: relative;
    margin: 12px 0;
}
.or-text::before,
.or-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 20px);
    height: 1px;
    background: var(--line, #e8e8e8);
}
.or-text::before { left: 0; }
.or-text::after  { right: 0; }
