/** custom **/

/* ════════════════════════════════════════════════════════════════
   PAGE LOADING SKELETON — homepage · category · product
   Sits at z-index 400 so the fixed headers (.bm-header z:500,
   .bmm-root z:600) stay visible above it at all times.
   ════════════════════════════════════════════════════════════════ */
.bm-page-skeleton {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: var(--pg-bg, #F5F5F7);
    display: flex;
    justify-content: center;
    padding: 24px 5%;
    padding-top: var(--bm-skel-top, 150px);
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: opacity .35s ease, visibility .35s ease;
}
.bm-page-skeleton.is-loaded {
    opacity: 0;
    visibility: hidden;
}
.bm-page-skeleton-inner {
    width: 100%;
    max-width: 1350px;
}

/* shared shimmer primitive */
.bm-shimmer {
    background: linear-gradient(100deg, #E9E9EE 35%, #F6F6F8 50%, #E9E9EE 65%);
    background-size: 300% 100%;
    animation: bm-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes bm-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -100% 0; }
}

/* ── Homepage ─────────────────────────────────────────────────── */
.bm-skel-hero {
    height: 360px;
    border-radius: 18px;
    margin-bottom: 34px;
}
.bm-skel-section {
    margin-bottom: 38px;
}
.bm-skel-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.bm-skel-title {
    width: 240px;
    max-width: 45%;
    height: 26px;
}
.bm-skel-link {
    width: 90px;
    height: 16px;
}
.bm-skel-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.bm-skel-card {
    background: var(--pg-surface, #fff);
    border: 1px solid var(--pg-border, rgba(0, 0, 0, .07));
    border-radius: 14px;
    padding: 14px;
}
.bm-skel-card-img {
    height: 170px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.bm-skel-card-line {
    height: 14px;
    border-radius: 7px;
    margin-bottom: 10px;
}
.bm-skel-card-line.short {
    width: 60%;
    margin-bottom: 0;
}

/* ── Category ─────────────────────────────────────────────────── */
.bm-skel-cat {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}
.bm-skel-side {
    flex: 0 0 260px;
}
.bm-skel-side-block {
    background: var(--pg-surface, #fff);
    border: 1px solid var(--pg-border, rgba(0, 0, 0, .07));
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
}
.bm-skel-main {
    flex: 1 1 auto;
    min-width: 0;
}
.bm-skel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.bm-skel-select {
    width: 180px;
    height: 38px;
    border-radius: 8px;
}
.bm-skel-cards--cat {
    grid-template-columns: repeat(3, 1fr);
}

/* ── Product (classes also styled by product-modern-v10.css) ──── */
.bm-skeleton-grid {
    display: flex;
    gap: 28px;
}
.bm-skeleton-media {
    flex: 0 0 470px;
    height: 560px;
    border-radius: 18px;
}
.bm-skeleton-info {
    flex: 1 1 auto;
    padding: 10px 0;
}
.bm-skeleton-line {
    height: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.bm-skeleton-line.w70 { width: 70%; }
.bm-skeleton-line.w55 { width: 55%; }
.bm-skeleton-line.w35 { width: 35%; }
.bm-skeleton-box {
    height: 52px;
    border-radius: 12px;
    margin-bottom: 14px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 991px) {
    .bm-skel-side { display: none; }
    .bm-skel-cards { grid-template-columns: repeat(3, 1fr); }
    .bm-skel-hero { height: 260px; }
    .bm-skeleton-media { flex: 0 0 40%; height: 460px; }
}
@media (max-width: 767px) {
    .bm-page-skeleton { padding: 16px 4%; padding-top: var(--bm-skel-top, 175px); }
    .bm-skel-hero { height: 170px; margin-bottom: 24px; }
    .bm-skel-cards,
    .bm-skel-cards--cat { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .bm-skel-card-img { height: 120px; }
    .bm-skel-select { width: 120px; }
    .bm-skeleton-grid { flex-direction: column; gap: 18px; }
    .bm-skeleton-media { flex: 1 1 auto; height: 320px; }
}
@media (prefers-reduced-motion: reduce) {
    .bm-shimmer { animation: none; }
}
@media print {
    .bm-page-skeleton { display: none !important; }
}
