/**
 * Orezero Woo Categories - Frontend Styles v1.0.1
 *
 * Le CSS variables --ozwc-* vengono iniettate inline da PHP.
 * Le regole più critiche (anti-FOUC) sono duplicate nel critical CSS inline
 * stampato direttamente dallo shortcode.
 */

/* ===== Container ===== */
.ozwc-wrapper {
    box-sizing: border-box;
    border: 1px solid var(--ozwc-border, #E8C3DC);
    padding: 18px 0;
    background: transparent;
    font-family: inherit;
    color: var(--ozwc-text, #1A1A1A);
}

.ozwc-wrapper *,
.ozwc-wrapper *::before,
.ozwc-wrapper *::after {
    box-sizing: border-box;
}

/* ===== Liste ===== */
.ozwc-wrapper .ozwc-list,
.ozwc-wrapper .ozwc-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Children: nascoste sia con attribute hidden sia con display none CSS. */
.ozwc-wrapper .ozwc-list--children[hidden],
.ozwc-wrapper [hidden] {
    display: none !important;
}

.ozwc-wrapper .ozwc-list--children {
    margin-top: 8px !important;
    padding-top: 6px !important;
    border-top: 1px dashed var(--ozwc-border, #E8C3DC);
}

/* ===== Riga categoria ===== */
.ozwc-wrapper .ozwc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    min-height: 44px;
    transition: color 0.2s ease;
}

/* Indentazione progressiva per i livelli */
.ozwc-wrapper .ozwc-item--depth-2 > .ozwc-row { padding-left: 36px; }
.ozwc-wrapper .ozwc-item--depth-3 > .ozwc-row { padding-left: 52px; }
.ozwc-wrapper .ozwc-item--depth-4 > .ozwc-row { padding-left: 68px; }
.ozwc-wrapper .ozwc-item--depth-5 > .ozwc-row { padding-left: 84px; }
.ozwc-wrapper .ozwc-item--depth-6 > .ozwc-row { padding-left: 100px; }
.ozwc-wrapper .ozwc-item--depth-7 > .ozwc-row { padding-left: 116px; }
.ozwc-wrapper .ozwc-item--depth-8 > .ozwc-row { padding-left: 132px; }

/* ===== Toggle (freccia) ===== */
.ozwc-wrapper .ozwc-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--ozwc-arrow, #1A1A1A);
    text-decoration: none !important;
    transition: color 0.2s ease;
    outline: none;
    line-height: 1;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.ozwc-wrapper .ozwc-toggle:focus-visible {
    outline: 2px solid var(--ozwc-hover, #002868);
    outline-offset: 2px;
    border-radius: 2px;
}

.ozwc-wrapper .ozwc-toggle:hover {
    color: var(--ozwc-hover, #002868);
    background: transparent;
}

/* Freccia SVG: dimensioni vincolate sia via attribute HTML sia via CSS */
.ozwc-wrapper .ozwc-arrow {
    width: 12px !important;
    height: 8px !important;
    max-width: 12px;
    max-height: 8px;
    display: block;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

/* Rotazione freccia quando espanso */
.ozwc-wrapper .ozwc-item--open > .ozwc-row > .ozwc-toggle .ozwc-arrow {
    transform: rotate(180deg);
}

/* ===== Nome categoria ===== */
.ozwc-wrapper .ozwc-name {
    flex: 1 1 auto;
    text-align: right;
    color: var(--ozwc-text, #1A1A1A);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.4;
    transition: color 0.2s ease;
    border-bottom: none !important;
    box-shadow: none !important;
}

.ozwc-wrapper .ozwc-name:hover,
.ozwc-wrapper .ozwc-name:focus {
    color: var(--ozwc-hover, #002868);
    text-decoration: none !important;
}

/* Stato categoria corrente */
.ozwc-wrapper .ozwc-item--current > .ozwc-row > .ozwc-name {
    color: var(--ozwc-hover, #002868);
    font-weight: 600;
}

/* Riduzione visiva per i livelli più profondi */
.ozwc-wrapper .ozwc-item--depth-2 > .ozwc-row > .ozwc-name,
.ozwc-wrapper .ozwc-item--depth-3 > .ozwc-row > .ozwc-name,
.ozwc-wrapper .ozwc-item--depth-4 > .ozwc-row > .ozwc-name {
    font-size: 12px;
    letter-spacing: 0.06em;
    font-weight: 400;
}

.ozwc-wrapper .ozwc-item--depth-5 > .ozwc-row > .ozwc-name,
.ozwc-wrapper .ozwc-item--depth-6 > .ozwc-row > .ozwc-name,
.ozwc-wrapper .ozwc-item--depth-7 > .ozwc-row > .ozwc-name,
.ozwc-wrapper .ozwc-item--depth-8 > .ozwc-row > .ozwc-name {
    font-size: 11px;
    letter-spacing: 0.04em;
    font-weight: 400;
    text-transform: none;
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
    .ozwc-wrapper .ozwc-row {
        padding: 10px 14px;
    }
    .ozwc-wrapper .ozwc-item--depth-2 > .ozwc-row { padding-left: 30px; }
    .ozwc-wrapper .ozwc-item--depth-3 > .ozwc-row { padding-left: 44px; }
    .ozwc-wrapper .ozwc-item--depth-4 > .ozwc-row { padding-left: 58px; }
    .ozwc-wrapper .ozwc-name {
        font-size: 12px;
    }
}
