/* Comm de Nom - Product Dimensions in Prices - 1.2.0 */
/* Keep chosen colors while making dimension labels visible in WooCommerce cards. */
.woocommerce .price .cdn-unit-label,
.woocommerce-page .price .cdn-unit-label,
.cdn-unit-label {
    display: block;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    margin-top: 4px;
    color: #392B23;
    white-space: normal;
}

.cdn-unit-label .cdn-unit-label-content { display: inline-block; max-width: 100%; }

/* Colour tokens — override to re-skin the effect:
   --ink    main text colour (defaults to currentColor)
   --ink-2  primary accent   --ink-3  secondary accent */
:root { --ink: currentColor; --ink-2: #FF4FD8; --ink-3: #4FF8FF; }

/* 07 Lens-Drift — letters slip in and out of focus, one after another */
.fx-focus {
  font: 600 30px/1.1 "JetBrains Mono", monospace;
  letter-spacing: .08em;
  color: var(--ink);
}
.fx-focus b {
  font-weight: inherit;
  display: inline-block;
  animation: fx-focus 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * .18s);
}
@keyframes fx-focus {
  0%, 100% { filter: blur(0);   opacity: 1; }
  50%      { filter: blur(7px); opacity: .35; }
}

/* Fit the same exact letter motion into WooCommerce price-label typography.
   The [cdnom_lens_drift] standalone demo keeps the untouched 30px rules above. */
.cdn-unit-label--lens-drift .fx-focus {
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: .02em;
}

/* 01 Glowing: subtle pulse based on the selected product label color. */
.cdn-unit-label--glow .cdn-unit-label-content {
    animation: cdnom-pd-glow 3s ease-in-out infinite;
}
@keyframes cdnom-pd-glow {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 8px currentColor, 0 0 16px currentColor; }
}

/* 02 Neon: use user-overridable secondary color tokens. */
.cdn-unit-label--neon .cdn-unit-label-content {
    animation: cdnom-pd-neon 2.8s ease-in-out infinite;
}
@keyframes cdnom-pd-neon {
    0%, 100% { text-shadow: 0 0 2px var(--ink-2), 0 0 5px var(--ink-3); }
    50% { text-shadow: 0 0 5px var(--ink-2), 0 0 12px var(--ink-2), 0 0 22px var(--ink-3); }
}

/* 03 Aurora: animated ink / pink / cyan gradient. */
.cdn-unit-label--aurora .cdn-unit-label-content {
    background: linear-gradient(110deg, var(--ink), var(--ink-2), var(--ink-3), var(--ink));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: cdnom-pd-aurora 5.5s linear infinite;
}
@keyframes cdnom-pd-aurora {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}

/* 04 Typewriter: stepped reveal of actual content, no JS or font downloads. */
.cdn-unit-label--typewriter .cdn-unit-label-content {
    clip-path: inset(0 100% 0 0);
    animation: cdnom-pd-typewriter 5s steps(var(--cdnom-chars), end) infinite;
}
.cdn-unit-label--typewriter .cdn-unit-label-content::after {
    content: "|";
    color: var(--ink-2);
    padding-left: 1px;
    animation: cdnom-pd-caret .8s steps(1, end) infinite;
}
@keyframes cdnom-pd-typewriter {
    0%, 8%   { clip-path: inset(0 100% 0 0); }
    65%, 88% { clip-path: inset(0 0 0 0); }
    100%     { clip-path: inset(0 100% 0 0); }
}
@keyframes cdnom-pd-caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* CSS-only previews on Settings > Dimension Labels. */
.cdnom-pd-previews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-width: 1180px;
    gap: 12px;
}
.cdnom-pd-preview-card {
    border: 1px solid #d5d0c7;
    background: #fff;
    border-radius: 8px;
    min-height: 100px;
    padding: 18px;
    overflow: hidden;
}
.cdnom-pd-preview-card > strong { display: block; color: #392B23; margin-bottom: 16px; }
.cdnom-pd-preview-card .cdn-unit-label { font-size: 22px; }

/* Accessibility: honor the operating-system reduced-motion setting. */
@media (prefers-reduced-motion: reduce) {
    .fx-focus b {
        animation: none !important;
        filter: blur(0) !important;
        opacity: 1 !important;
    }
    .cdn-unit-label--glow .cdn-unit-label-content,
    .cdn-unit-label--neon .cdn-unit-label-content,
    .cdn-unit-label--aurora .cdn-unit-label-content,
    .cdn-unit-label--typewriter .cdn-unit-label-content,
    .cdn-unit-label--typewriter .cdn-unit-label-content::after {
        animation: none !important;
        text-shadow: none !important;
        clip-path: none !important;
        filter: none !important;
        opacity: 1 !important;
    }
    .cdn-unit-label--typewriter .cdn-unit-label-content::after { content: none !important; }
    .cdn-unit-label--aurora .cdn-unit-label-content {
        color: inherit !important;
        background: none !important;
        -webkit-text-fill-color: currentColor !important;
    }
}
