/* ============================================================================
   Comfortrek V442 — Universal Storefront Theme Glow & Luxury Polish Layer
   Adapts automatically to every active storefront theme (Light & Dark modes)
   using each theme's live accent, surface, border & contrast tokens.
   ============================================================================ */

html body#comfortrek-storefront[data-storefront-theme] {
    --ct442-accent: var(--ct340-action, var(--theme-editor-accent, #c59a5b));
    --ct442-surface: var(--ct345-paper, var(--ct340-paper, #ffffff));
    --ct442-ink: var(--ct345-ink, var(--ct340-ink, #171a21));
    --ct442-edge: var(--ct340-edge, rgba(15, 23, 42, 0.11));
    --ct442-glow-soft: color-mix(in srgb, var(--ct442-accent) 18%, transparent);
    --ct442-glow-med: color-mix(in srgb, var(--ct442-accent) 32%, transparent);
    --ct442-glow-rim: color-mix(in srgb, var(--ct442-accent) 44%, transparent);
    --ct442-specular: rgba(255, 255, 255, 0.55);
    --ct442-shadow-card:
        0 6px 24px -8px rgba(15, 23, 42, 0.10),
        0 1px 2px rgba(15, 23, 42, 0.05);
    --ct442-shadow-hover:
        0 20px 44px -14px rgba(15, 23, 42, 0.18),
        0 0 28px -6px var(--ct442-glow-med),
        0 0 0 1px var(--ct442-glow-rim);
    --ct442-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Richer obsidian-depth glow when any storefront theme is in Dark Mode */
html body#comfortrek-storefront.appearance-dark[data-storefront-theme],
html[data-appearance="dark"] body#comfortrek-storefront[data-storefront-theme],
html.dark body#comfortrek-storefront[data-storefront-theme],
body#comfortrek-storefront.dark-mode[data-storefront-theme],
body#comfortrek-storefront.theme-mode-dark[data-storefront-theme],
body#comfortrek-storefront[data-appearance-auto="dark"][data-storefront-theme] {
    --ct442-glow-soft: color-mix(in srgb, var(--ct442-accent) 26%, transparent);
    --ct442-glow-med: color-mix(in srgb, var(--ct442-accent) 44%, transparent);
    --ct442-glow-rim: color-mix(in srgb, var(--ct442-accent) 58%, transparent);
    --ct442-specular: rgba(255, 255, 255, 0.14);
    --ct442-shadow-card:
        0 12px 32px -12px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    --ct442-shadow-hover:
        0 24px 52px -14px rgba(0, 0, 0, 0.72),
        0 0 36px -6px var(--ct442-glow-med),
        0 0 0 1px var(--ct442-glow-rim);
}

/* 1. Subtle atmospheric luxury glow behind storefront canvas */
html body#comfortrek-storefront[data-storefront-theme] {
    background-image:
        radial-gradient(920px 420px at 14% -4%, var(--ct442-glow-soft), transparent 64%),
        radial-gradient(840px 380px at 88% 2%, color-mix(in srgb, var(--ct442-accent) 12%, transparent), transparent 62%);
    background-attachment: scroll;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. Frosted glass sticky header & refined nav glow */
html body#comfortrek-storefront[data-storefront-theme] :is(header.site-header, .site-header, .navbar, .store-header) {
    backdrop-filter: blur(16px) saturate(165%);
    -webkit-backdrop-filter: blur(16px) saturate(165%);
    border-bottom: 1px solid color-mix(in srgb, var(--ct442-accent) 20%, var(--ct442-edge));
    box-shadow: 0 8px 30px -16px rgba(0, 0, 0, 0.22);
    transition: box-shadow 0.28s var(--ct442-ease), border-color 0.28s var(--ct442-ease);
}

html body#comfortrek-storefront[data-storefront-theme] :is(.nav-links a, .site-nav a, .header-nav a) {
    position: relative;
    transition: color 0.22s var(--ct442-ease), text-shadow 0.22s var(--ct442-ease);
}

html body#comfortrek-storefront[data-storefront-theme] :is(.nav-links a, .site-nav a, .header-nav a):hover {
    text-shadow: 0 0 18px var(--ct442-glow-med);
}

/* Announcement bar subtle luminous rim */
html body#comfortrek-storefront[data-storefront-theme] .announcement-bar {
    border-bottom: 1px solid color-mix(in srgb, var(--ct442-accent) 28%, transparent);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

/* 3. Hero section editorial spotlight & luminous border */
html body#comfortrek-storefront[data-storefront-theme] .ck-featured-hero__copy,
html body#comfortrek-storefront[data-storefront-theme] .palo-hero-copy,
html body#comfortrek-storefront[data-storefront-theme] .hero-content {
    border: 1px solid color-mix(in srgb, var(--ct442-accent) 28%, var(--ct442-edge)) !important;
    box-shadow:
        0 24px 56px -22px rgba(15, 23, 42, 0.26),
        0 0 42px -14px var(--ct442-glow-soft),
        inset 0 1px 0 var(--ct442-specular);
    transition: box-shadow 0.35s var(--ct442-ease), border-color 0.35s var(--ct442-ease);
}

html body#comfortrek-storefront[data-storefront-theme] :is(.ck-featured-hero__copy h1, .hero-title, .palo-hero-copy h1) {
    letter-spacing: -0.025em;
}

/* 4. Elevated luxury product & discovery cards with ambient rim glow on hover */
html body#comfortrek-storefront[data-storefront-theme] :is(
    .tag-card,
    .ck-featured-card,
    .product-card,
    .cr-discovery-card,
    .collection-card,
    .bundle-card
) {
    border: 1px solid color-mix(in srgb, var(--ct442-accent) 16%, var(--ct442-edge));
    border-radius: var(--theme-editor-radius, 16px);
    box-shadow: var(--ct442-shadow-card), inset 0 1px 0 var(--ct442-specular);
    transition:
        transform 0.32s var(--ct442-ease),
        box-shadow 0.32s var(--ct442-ease),
        border-color 0.32s var(--ct442-ease);
    overflow: hidden;
}

html body#comfortrek-storefront[data-storefront-theme] :is(
    .tag-card,
    .ck-featured-card,
    .product-card,
    .cr-discovery-card,
    .collection-card,
    .bundle-card
):hover {
    transform: translateY(-5px);
    border-color: var(--ct442-glow-rim) !important;
    box-shadow: var(--ct442-shadow-hover), inset 0 1px 0 var(--ct442-specular) !important;
}

html body#comfortrek-storefront[data-storefront-theme] :is(
    .tag-card img,
    .ck-featured-card img,
    .product-card img,
    .cr-discovery-card img
) {
    transition: transform 0.55s var(--ct442-ease), filter 0.35s var(--ct442-ease);
}

html body#comfortrek-storefront[data-storefront-theme] :is(
    .tag-card:hover img,
    .ck-featured-card:hover img,
    .product-card:hover img,
    .cr-discovery-card:hover img
) {
    transform: scale(1.045);
}

/* 5. Luminous primary CTA buttons with specular sheen & bloom on hover */
html body#comfortrek-storefront[data-storefront-theme] :is(
    .btn-primary,
    .add-to-cart-btn,
    .crp-buy-now,
    .crp-add-to-cart,
    .hero-cta,
    .cta-primary,
    button.primary
) {
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 26px -10px var(--ct442-glow-med),
        0 2px 6px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition:
        transform 0.22s var(--ct442-ease),
        box-shadow 0.28s var(--ct442-ease),
        filter 0.22s var(--ct442-ease);
}

html body#comfortrek-storefront[data-storefront-theme] :is(
    .btn-primary,
    .add-to-cart-btn,
    .crp-buy-now,
    .crp-add-to-cart,
    .hero-cta,
    .cta-primary,
    button.primary
):hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 16px 36px -8px var(--ct442-glow-rim),
        0 0 22px -4px var(--ct442-glow-med),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
    filter: brightness(1.04);
}

html body#comfortrek-storefront[data-storefront-theme] :is(
    .btn-primary,
    .add-to-cart-btn,
    .crp-buy-now,
    .crp-add-to-cart,
    .hero-cta,
    .cta-primary,
    button.primary
):active:not(:disabled) {
    transform: translateY(0) scale(0.985);
}

/* Secondary buttons subtle accent halo */
html body#comfortrek-storefront[data-storefront-theme] :is(.btn-secondary, .btn-outline, .quick-view-btn) {
    border-color: color-mix(in srgb, var(--ct442-accent) 30%, var(--ct442-edge));
    transition: transform 0.22s var(--ct442-ease), box-shadow 0.26s var(--ct442-ease), border-color 0.26s var(--ct442-ease);
}

html body#comfortrek-storefront[data-storefront-theme] :is(.btn-secondary, .btn-outline, .quick-view-btn):hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--ct442-accent);
    box-shadow: 0 8px 22px -10px var(--ct442-glow-med);
}

/* 6. PDP gallery, trust blocks, offers, swatches & floating controls */
html body#comfortrek-storefront[data-storefront-theme] :is(
    .crp-trust-row,
    .crp-option-group,
    .ct-offers-zone,
    .ct174-best-price,
    .ct195-smart-os,
    .shop-filter,
    .newsletter-form
) {
    border: 1px solid color-mix(in srgb, var(--ct442-accent) 20%, var(--ct442-edge)) !important;
    box-shadow: 0 10px 28px -16px rgba(15, 23, 42, 0.16), inset 0 1px 0 var(--ct442-specular);
    border-radius: var(--theme-editor-radius, 14px);
}

html body#comfortrek-storefront[data-storefront-theme] :is(.crp-thumb.active, .crp-thumb.is-active, .variant-pill.active, .size-pill.active, .color-swatch.active) {
    border-color: var(--ct442-accent) !important;
    box-shadow: 0 0 0 2px var(--ct442-glow-soft), 0 0 16px -4px var(--ct442-glow-med);
}

html body#comfortrek-storefront[data-storefront-theme] :is(.product-badge, .crp-rating-pill, #cr-jump-top, .wishlist-heart-btn) {
    box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.20), 0 0 12px -4px var(--ct442-glow-soft);
    transition: transform 0.22s var(--ct442-ease), box-shadow 0.22s var(--ct442-ease);
}

html body#comfortrek-storefront[data-storefront-theme] :is(#cr-jump-top, .wishlist-heart-btn):hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 20px -6px var(--ct442-glow-rim);
}

/* 7. Luminous top hairline divider on storefront footer */
html body#comfortrek-storefront[data-storefront-theme] :is(footer.site-footer, .site-footer, footer.luxury-footer) {
    position: relative;
    border-top: 1px solid color-mix(in srgb, var(--ct442-accent) 26%, var(--ct442-edge));
    box-shadow: 0 -14px 40px -24px var(--ct442-glow-soft);
}

html body#comfortrek-storefront[data-storefront-theme] :is(footer.site-footer, .site-footer, footer.luxury-footer)::before {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ct442-accent), transparent);
    opacity: 0.72;
    pointer-events: none;
}

/* 8. Inputs crisp focus glow */
html body#comfortrek-storefront[data-storefront-theme] :is(input, select, textarea):focus {
    border-color: var(--ct442-accent) !important;
    box-shadow: 0 0 0 3px var(--ct442-glow-soft) !important;
}

/* 9. Accessibility & low-data respect */
@media (prefers-reduced-motion: reduce) {
    html body#comfortrek-storefront[data-storefront-theme] :is(
        .tag-card, .ck-featured-card, .product-card, .cr-discovery-card,
        .btn-primary, .add-to-cart-btn, .crp-buy-now, .crp-add-to-cart,
        .tag-card img, .ck-featured-card img, .product-card img
    ) {
        transition: none !important;
        transform: none !important;
    }
}

html body#comfortrek-storefront.theme-reduced-motion-on :is(.tag-card, .ck-featured-card, .product-card, .btn-primary) {
    transition: none !important;
    transform: none !important;
}
