/* Store Details — full-page loading skeleton (Salestrackerdetails.php) */

@keyframes std-page-skel-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.std-page-skel-shimmer,
.std-page-skel-shimmer::before {
    background: linear-gradient(90deg, #eef2f7 0%, #e2e8f0 45%, #f8fafc 55%, #eef2f7 100%);
    background-size: 200% 100%;
    animation: std-page-skel-shimmer 1.35s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .std-page-skel-shimmer,
    .std-page-skel-shimmer::before {
        animation: none;
        background: #e8edf3;
    }
}

/* —— Title bar —— */
.std-page-skel-title {
    display: none;
    width: min(220px, 52vw);
    height: 22px;
    border-radius: 6px;
    margin-bottom: 6px;
}

body:not(.std-hero-ready) .std-page-skel-title {
    display: block;
}

body.std-hero-ready .std-page-skel-title {
    display: none !important;
}

.std-page-skel-meta-row {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

body:not(.std-hero-ready) .std-page-skel-meta-row {
    display: flex;
}

body.std-hero-ready .std-page-skel-meta-row {
    display: none !important;
}

body:not(.std-hero-ready) .title-bar-left-category-trustpilot-info.std-title-meta-row .std-hero-url-skel {
    display: none !important;
}

.std-page-skel-chip {
    display: inline-block;
    height: 22px;
    width: 72px;
    border-radius: 7px;
    flex-shrink: 0;
}

.std-page-skel-chip--short {
    width: 48px;
}

.std-page-skel-chip--url {
    width: min(160px, 40vw);
}

.std-page-skel-action-chip {
    height: 28px;
    border-radius: 999px;
    flex-shrink: 0;
}

body:not(.std-hero-ready) .std-store-icon-skel {
    border: 1px solid #e2e8f0;
}

body:not(.std-hero-ready) .std-store-icon-skel.std-page-skel-shimmer {
    background: linear-gradient(90deg, #eef2f7 0%, #e2e8f0 45%, #f8fafc 55%, #eef2f7 100%);
    background-size: 200% 100%;
    animation: std-page-skel-shimmer 1.35s ease-in-out infinite;
}

html[data-theme="dark"] body:not(.std-hero-ready) .std-store-icon-skel {
    border-color: var(--dk-border, #262b35);
}

html[data-theme="dark"] body:not(.std-hero-ready) .std-store-icon-skel.std-page-skel-shimmer {
    background: linear-gradient(90deg, var(--dk-surface-deep, #0b0d11) 0%, var(--dk-surface-2, #1b1f27) 45%, var(--dk-surface-3, #232936) 55%, var(--dk-surface-deep, #0b0d11) 100%);
    background-size: 200% 100%;
}

/* —— Hero shell layout —— */
.std-hero-skeleton-shell.std-page-skeleton {
    gap: 12px;
}

.std-page-skel-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.std-page-skel-tab {
    height: 32px;
    border-radius: 8px;
    flex: 1 1 0;
    min-width: 88px;
    max-width: 140px;
}

.std-page-skel-tab--wide {
    max-width: 118px;
}

/* KPI cards */
.std-page-skel-kpi-row {
    margin: 0;
}

.std-page-skel-kpi-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.std-page-skel-kpi-label {
    width: 56%;
    height: 10px;
    border-radius: 5px;
}

.std-page-skel-kpi-label--short {
    width: 42%;
}

.std-page-skel-kpi-value {
    width: 68%;
    height: 16px;
    border-radius: 6px;
}

.std-page-skel-kpi-icons {
    display: flex;
    gap: 6px;
    width: 100%;
}

.std-page-skel-kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* Chart split */
.std-page-skel-vis-geo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

@media (max-width: 960px) {
    .std-page-skel-vis-geo {
        grid-template-columns: 1fr;
    }
}

.std-page-skel-chart-card {
    padding: 10px 12px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.std-page-skel-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.std-page-skel-chart-title {
    width: 38%;
    height: 14px;
    border-radius: 5px;
}

.std-page-skel-chart-controls {
    width: 28%;
    height: 26px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* Shared chart skeleton (hero graphs + page shell preview) */
.std-chart-skel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.std-chart-skel-metric-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.std-chart-skel-metric {
    width: min(168px, 58vw);
    height: 28px;
    border-radius: 6px;
}

.std-chart-skel-metric-sub {
    width: 76px;
    height: 20px;
    border-radius: 999px;
}

.std-chart-skel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.std-chart-skel-title {
    width: 120px;
    height: 18px;
    border-radius: 5px;
}

.std-chart-skel-toggle {
    width: 72px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
}

.std-chart-skel-frame {
    position: relative;
    width: 100%;
    height: var(--std-vis-geo-chart-height, 196px);
    border: 1px solid #eef2f7;
    border-radius: 8px;
    background: linear-gradient(180deg, #fcfdff 0%, #f1f5f9 100%);
    overflow: hidden;
}

.std-chart-skel-frame--compact {
    height: var(--std-vis-geo-chart-height, 196px);
}

.std-chart-skel-svg {
    position: absolute;
    inset: 10px 10px 30px;
    width: calc(100% - 20px);
    height: calc(100% - 40px);
}

.std-chart-skel-axis {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 8px;
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.std-chart-skel-tick {
    width: 32px;
    height: 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.std-chart-skel-tick--hide-sm {
    display: inline-block;
}

@media (max-width: 640px) {
    .std-chart-skel-tick--hide-sm {
        display: none;
    }
}

.std-chart-skel-footer-line {
    width: 52%;
    height: 10px;
    border-radius: 5px;
}

@keyframes std-chart-skel-line-pulse {
    0%, 100% { opacity: 0.48; }
    50% { opacity: 0.88; }
}

.std-chart-skel-svg path[data-skel-line] {
    animation: std-chart-skel-line-pulse 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .std-chart-skel-svg path[data-skel-line] {
        animation: none;
        opacity: 0.65;
    }
}

.std-page-skel-chart-area {
    flex: 1 1 auto;
    min-height: var(--std-vis-geo-chart-height, 196px);
}

.std-page-skel-chart-footer {
    width: 52%;
    height: 10px;
    border-radius: 5px;
}

/* Products + stack split */
.std-page-skel-prod-tech {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: 10px;
}

@media (max-width: 960px) {
    .std-page-skel-prod-tech {
        grid-template-columns: 1fr;
    }
}

.std-page-skel-panel {
    padding: 10px 12px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.std-page-skel-panel-head {
    width: 32%;
    height: 12px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.std-page-skel-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.std-page-skel-toolbar-pill {
    width: 88px;
    height: 28px;
    border-radius: 8px;
}

.std-page-skel-toolbar-search {
    flex: 1 1 120px;
    height: 28px;
    border-radius: 8px;
    min-width: 0;
}

.std-page-skel-prod-carousel {
    display: flex;
    gap: 10px;
    overflow: hidden;
}

.std-page-skel-prod-card {
    flex: 0 0 154px;
    height: 198px;
    border-radius: 10px;
}

.std-page-skel-tech-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.std-page-skel-tech-chip {
    height: 36px;
    border-radius: 8px;
}

/* Dark mode */
html[data-theme="dark"] .std-page-skel-shimmer,
html[data-theme="dark"] .std-page-skel-shimmer::before {
    background: linear-gradient(90deg, var(--dk-surface-deep, #0b0d11) 0%, var(--dk-surface-2, #1b1f27) 45%, var(--dk-surface-3, #232936) 55%, var(--dk-surface-deep, #0b0d11) 100%);
    background-size: 200% 100%;
}

html[data-theme="dark"] .std-page-skel-tabs,
html[data-theme="dark"] .std-page-skel-kpi-card,
html[data-theme="dark"] .std-page-skel-chart-card,
html[data-theme="dark"] .std-page-skel-panel {
    background: var(--dk-surface, #15181e);
    border-color: var(--dk-border, #262b35);
    box-shadow: none;
}

html[data-theme="dark"] .std-chart-skel-frame {
    background: linear-gradient(180deg, var(--dk-surface-deep, #0b0d11) 0%, var(--dk-surface, #15181e) 100%);
    border-color: var(--dk-border, #262b35);
}

html[data-theme="dark"] .std-chart-skel-svg line[data-skel-grid] {
    stroke: var(--dk-border, #262b35);
}

html[data-theme="dark"] .std-chart-skel-svg path[data-skel-line] {
    stroke: #64748b;
}

html[data-theme="dark"] .std-page-skel-tabs {
    background: var(--dk-surface-deep, #0b0d11);
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="dark"] .std-page-skel-shimmer,
    html[data-theme="dark"] .std-page-skel-shimmer::before {
        background: var(--dk-surface-2, #1b1f27);
    }
}

/* —— Similar shops + Top ads (overview preview while hero loads) —— */
.std-page-skel-overview-section {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.std-page-skel-section-title {
    display: block;
    width: 140px;
    height: 18px;
    border-radius: 6px;
}

.std-page-skel-similar-row,
.std-page-skel-top-ads-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow: hidden;
}

.std-page-skel-similar-card {
    flex: 0 0 clamp(200px, 16vw, 230px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.std-page-skel-similar-img {
    width: 100%;
    height: 118px;
    border-radius: 0;
}

.std-page-skel-similar-line {
    width: 72%;
    height: 10px;
    border-radius: 5px;
    margin: 0 10px;
}

.std-page-skel-similar-line--short {
    width: 52%;
}

.std-page-skel-similar-footer {
    width: calc(100% - 20px);
    height: 28px;
    border-radius: 6px;
    margin: 4px 10px 0;
}

.std-page-skel-top-ads-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.std-page-skel-top-ads-toolbar {
    width: min(320px, 58vw);
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
}

.std-page-skel-ad-card {
    flex: 0 0 clamp(255px, 18vw, 310px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    min-height: 320px;
}

.std-page-skel-ad-metrics {
    width: 100%;
    height: 28px;
    border-radius: 8px;
}

.std-page-skel-ad-header {
    width: 100%;
    height: 22px;
    border-radius: 6px;
}

.std-page-skel-ad-media {
    flex: 1 1 auto;
    min-height: 140px;
    border-radius: 10px;
}

.std-page-skel-ad-footer {
    width: 100%;
    height: 36px;
    border-radius: 8px;
}

html[data-theme="dark"] .std-page-skel-overview-section,
html[data-theme="dark"] .std-page-skel-similar-card,
html[data-theme="dark"] .std-page-skel-ad-card {
    background: var(--dk-surface, #15181e);
    border-color: var(--dk-border, #262b35);
}
