/* WooCommerce Category Mega Menu */
.wccm {
    --wccm-text: #1f2937;
    --wccm-accent: #e83e8c;
    --wccm-card-hover: #fff1f7;
    --wccm-gap: 0px;
    --wccm-top: 0px;
    position: relative;
    width: 100%;
    font-family: inherit;
}
.wccm *, .wccm *::before, .wccm *::after { box-sizing: border-box; }
.wccm ul { list-style: none; margin: 0; padding: 0; }
.wccm li { margin: 0; padding: 0; }
.wccm a { text-decoration: none; }

/* ── Bar ───────────────────────────────────────────── */
.wccm-nav { width: 100%; }
.wccm-list { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; }
.wccm-item { position: relative; display: flex; align-items: stretch; }
.wccm-head { display: flex; align-items: center; position: relative; }

.wccm-link {
    position: relative;
    display: block;
    padding: 14px 16px;
    color: var(--wccm-text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    transition: color .18s ease;
}
.wccm-item.has-panel .wccm-link { padding-right: 4px; }

.wccm-chevron {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; margin: 0 8px 0 0; padding: 0;
    background: transparent !important; border: 0 !important; border-radius: 50%;
    color: var(--wccm-text); cursor: pointer; box-shadow: none !important;
    transition: transform .22s ease, color .18s ease;
}
.wccm-chevron svg { display: block; }

.wccm-item:hover .wccm-link,
.wccm-item.is-open .wccm-link,
.wccm-link:focus-visible,
.wccm-item:hover .wccm-chevron,
.wccm-item.is-open .wccm-chevron { color: var(--wccm-accent); }
.wccm-item.is-open .wccm-chevron { transform: rotate(180deg); }
.wccm-chevron:focus-visible,
.wccm-link:focus-visible,
.wccm-card-link:focus-visible,
.wccm-viewall:focus-visible,
.wccm-third a:focus-visible,
.wccm-toggle:focus-visible { outline: 2px solid var(--wccm-accent); outline-offset: 2px; }

/* animated underline (desktop) */
.wccm.has-underline:not(.is-mobile) .wccm-head::after {
    content: ""; position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px;
    border-radius: 2px; background: var(--wccm-accent);
    transform: scaleX(0); transform-origin: left center; transition: transform .25s ease;
}
.wccm.has-underline:not(.is-mobile) .wccm-item:hover .wccm-head::after,
.wccm.has-underline:not(.is-mobile) .wccm-item.is-open .wccm-head::after { transform: scaleX(1); }

.wccm:not(.is-mobile) .wccm-toggle { display: none !important; } /* desktop: compact bar, no big button */
.wccm-toggle { display: none; }

/* ── Panel (full viewport width) ───────────────────── */
.wccm-panel {
    position: fixed;
    left: 0;
    top: var(--wccm-top);
    width: 100vw;
    z-index: 99990;
    background: #fff;
    border-top: 1px solid rgba(232, 62, 140, .14);
    box-shadow: 0 28px 40px -16px rgba(15, 23, 42, .22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s;
}
.wccm-panel::before { /* invisible bridge so the pointer never falls into a gap */
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: calc(var(--wccm-gap) + 2px);
}
.wccm-item.is-open > .wccm-panel {
    opacity: 1; visibility: visible; pointer-events: auto;
    transition: opacity .2s ease, visibility 0s;
}

.wccm-panel-inner {
    margin: 0 auto;
    max-width: 1240px;
    padding: 32px 32px 36px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    transform: translateY(10px);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.wccm-item.is-open .wccm-panel-inner { transform: translateY(0); }
.wccm-panel-inner.has-feature { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); align-items: stretch; }

/* ── Intro block ───────────────────────────────────── */
.wccm-feature {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 10px;
    min-height: 200px; padding: 26px;
    background: #fff1f7;
    border-radius: 22px;
}
.wccm-feature > * { position: relative; z-index: 1; }
.wccm-feature-blob { position: absolute !important; z-index: 0 !important; border-radius: 50%; pointer-events: none; }
.wccm-blob-1 { width: 150px; height: 150px; top: -48px; right: -40px; background: rgba(232, 62, 140, .14); }
.wccm-blob-2 { width: 54px; height: 54px; top: 70px; right: 14px; background: rgba(255, 196, 87, .38); }
.wccm-feature-title { margin: 0; font-size: 24px; line-height: 1.15; font-weight: 700; color: #111827; letter-spacing: -.01em; }
.wccm-feature-desc { margin: 0; font-size: 13.5px; line-height: 1.5; color: #6b7280; max-width: 24ch; }
.wccm-viewall {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 6px; padding: 10px 18px;
    background: #e83e8c; color: #fff; border-radius: 999px;
    font-size: 14px; font-weight: 600; line-height: 1;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.wccm-viewall svg { transition: transform .18s ease; }
.wccm-viewall:hover { filter: brightness(.94); box-shadow: 0 8px 18px -6px rgba(232, 62, 140, .55); color: #fff; }
.wccm-viewall:hover svg { transform: translateX(3px); }

/* ── Sub-category cards ────────────────────────────── */
.wccm-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px; align-content: start; align-self: center;
}
.wccm-card { border-radius: 16px; transition: background-color .18s ease; }
.wccm-card:hover, .wccm-card:focus-within { background: var(--wccm-card-hover); }
.wccm-card-link { display: flex; align-items: center; gap: 14px; padding: 10px 12px; color: inherit; border-radius: inherit; }
.wccm-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wccm-card-name { font-size: 15px; font-weight: 600; line-height: 1.3; color: #111827; transition: color .18s ease; overflow-wrap: anywhere; }
.wccm-card:hover .wccm-card-name { color: var(--wccm-accent); }
.wccm-card-count { font-size: 12.5px; color: #9ca3af; }

.wccm-thumb {
    flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #fff1f7; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(232, 62, 140, .22);
    transition: box-shadow .2s ease, transform .2s ease;
}
.wccm-card:hover .wccm-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--wccm-accent); transform: scale(1.04); }
.wccm-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wccm-thumb-letter { font-size: 22px; font-weight: 700; color: var(--wccm-accent); line-height: 1; }
.wccm-grid .wccm-card:nth-child(3n+2) .wccm-thumb { background: #fff6dd; }
.wccm-grid .wccm-card:nth-child(3n+3) .wccm-thumb { background: #e8f7f1; }

.wccm-third { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 12px 12px 82px; }
.wccm-grid.no-thumb .wccm-third { padding-left: 12px; }
.wccm-third a { font-size: 13px; color: #6b7280; transition: color .15s ease; }
.wccm-third a:hover { color: var(--wccm-accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Mobile / small screens ────────────────────────── */
.wccm.is-mobile .wccm-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 12px 16px; background: #fff !important; color: var(--wccm-text) !important;
    border: 1.5px solid #f3d3e3 !important; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer;
}
.wccm.is-mobile .wccm-toggle svg { color: var(--wccm-accent); }
.wccm.is-mobile .wccm-nav { display: none; margin-top: 8px; border-radius: 12px; overflow: hidden; }
.wccm.is-mobile.is-nav-open .wccm-nav { display: block; }
.wccm.is-mobile .wccm-list { flex-direction: column; flex-wrap: nowrap; }
.wccm.is-mobile .wccm-item { display: block; border-bottom: 1px solid #f3f4f6; }
.wccm.is-mobile .wccm-item:last-child { border-bottom: 0; }
.wccm.is-mobile .wccm-head { justify-content: space-between; }
.wccm.is-mobile .wccm-link { flex: 1 1 auto; white-space: normal; }
.wccm.is-mobile .wccm-chevron { width: 36px; height: 36px; margin-right: 6px; }

.wccm.is-mobile .wccm-panel {
    position: static; width: auto; display: none; opacity: 1; visibility: visible; pointer-events: auto;
    box-shadow: none; border-top: 0; background: transparent !important; transition: none;
}
.wccm.is-mobile .wccm-panel::before { display: none; }
.wccm.is-mobile .wccm-item.is-open > .wccm-panel { display: block; }
.wccm.is-mobile .wccm-panel-inner,
.wccm.is-mobile .wccm-panel-inner.has-feature {
    grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 8px 14px !important; transform: none; max-width: none;
}
.wccm.is-mobile .wccm-feature { min-height: 0; padding: 16px 18px; border-radius: 16px; }
.wccm.is-mobile .wccm-feature-title { font-size: 18px; }
.wccm.is-mobile .wccm-feature-desc { display: none; }
.wccm.is-mobile .wccm-grid { grid-template-columns: minmax(0, 1fr) !important; }
.wccm.is-mobile .wccm-third { padding-left: 12px; }

@media (min-width: 1025px) and (max-width: 1280px) {
    .wccm:not(.is-mobile) .wccm-panel-inner.has-feature { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .wccm-panel, .wccm-panel-inner, .wccm-thumb, .wccm-viewall svg, .wccm-chevron { transition: none !important; }
}
