/* Menu del tema (inc/menu.php): barra con tre colonne da 992 px, schermate a scorrimento sotto. */

.dtm-bar,
.dtm-panel,
.dtm-drawer,
.dtm-veil {
    --dtm-ease: cubic-bezier(0.4, 0, 0.25, 1);
}

.dtm-bar,
.dtm-panel ul,
.dtm-drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* League Spartan disegna le lettere circa 0,09em sopra il centro della riga: si abbassa il solo testo. */
.dtm-t {
    position: relative;
    top: 0.09em;
}

.dtm-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #f3f4f6;
    color: #111;
}

.dtm-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dtm-chevron {
    flex: none;
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

[aria-expanded="true"] > .dtm-chevron {
    transform: translateY(2px) rotate(-135deg);
}

/* Promo in evidenza (colore preso dalle impostazioni di Sconti SKU) */
.dtm-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    border-radius: 50%;
    background: var(--dtm-promo);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: 1px;
}

.dtm-badge > span:first-child {
    position: relative;
    top: 0.09em;
}

a.dtm-promo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    background: var(--dtm-promo);
    color: #fff;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: filter 0.2s ease;
}

/* L'emoji sta più in alto del testo: si porta alla stessa altezza. */
.dtm-emoji {
    position: relative;
    top: 0.16em;
    left: 0.13em; /* il disegno dell'emoji non è al centro del suo spazio */
    line-height: 1;
}

a.dtm-promo:hover {
    color: #fff;
    filter: brightness(1.12);
}

/* Computer
--------------------------------------------- */

.dtm-bar {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dtm-bar__link {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: #000;
    font: inherit;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.dtm-bar__link:hover,
.dtm-bar__link[aria-expanded="true"] {
    color: var(--blue-color);
    background: #f3f6fc;
}

.dtm-bar__link .dtm-badge {
    margin-left: -2px;
}

.dtm-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--dtm-top, 160px);
    max-height: calc(100vh - var(--dtm-top, 160px) - 12px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-top: 1px solid #eee;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.14);
    text-align: left;
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.55s var(--dtm-ease), visibility 0s linear 0.55s;
}

.dtm-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.4s ease, transform 0.55s var(--dtm-ease);
}

/* Da una voce all'altra il pannello resta fermo: cambiano contenuto e altezza. */
.dtm-panel.is-switch {
    transform: none;
    transition: none;
}

.dtm-panel__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 26px 12px 24px;
}

.dtm-columns {
    --dtm-col1: 250px;
    --dtm-col2: 270px;
    position: relative;
    min-height: 430px;
}

.dtm-group {
    width: var(--dtm-col1);
    margin-bottom: 2px;
}

.dtm-group__title {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 10px;
    border-radius: 12px;
    color: #000;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.dtm-group.is-active .dtm-group__title,
a.dtm-group__title:hover {
    background: #f3f6fc;
    color: var(--blue-color);
}

.dtm-group__title .dtm-icon {
    transition: color 0.2s ease, background-color 0.2s ease;
}

.dtm-group.is-active .dtm-icon {
    background: var(--blue-color);
    color: #fff;
}

/* Seconda colonna: l'elenco arriva fino al bordo destro, così le schede stanno al suo interno. */
.dtm-group ul {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: calc(var(--dtm-col1) + 16px);
    padding-left: 16px;
    border-left: 1px solid #eee;
}

.dtm-group.is-active ul {
    display: block;
}

.dtm-group ul > li {
    width: var(--dtm-col2);
    padding-right: 16px;
}

.dtm-group li > a {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 12px;
    border-radius: 8px;
    color: #4b4b4f;
    font-size: 17px;
    font-weight: 300;
    line-height: 1.2;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.dtm-group li > a:hover,
.dtm-group li.is-hot > a,
.dtm-group li > a[aria-current="page"] {
    background: #f3f6fc;
    color: var(--blue-color);
}

/* Terza colonna: la scheda della categoria, sostituita da quella della sottocategoria. */
.dtm-card {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: calc(var(--dtm-col1) + var(--dtm-col2) + 33px);
    padding-left: 28px;
    border-left: 1px solid #eee;
}

.dtm-group li > .dtm-card {
    left: calc(var(--dtm-col2) + 16px);
}

.dtm-group.is-active:not(.has-hot) > .dtm-card,
.dtm-group.is-active li.is-hot > .dtm-card {
    display: block;
}

.dtm-card__title {
    margin: 4px 0 12px;
    color: #000;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

/* Specificità più alta di ".woocommerce img", che altrimenti ingrandisce la foto sulle pagine negozio. */
.dtm-card img.dtm-card__photo {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: contain;
    object-position: left center;
}

.dtm-card__text {
    max-width: 520px;
    margin: 14px 0;
    color: #4b4b4f;
    font-size: 17px;
    font-weight: 300;
    line-height: 1.45;
}

a.dtm-card__more {
    color: var(--blue-color);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
}

.dtm-panel__all {
    display: inline-flex;
    align-items: center;
    height: 40px;
    margin-top: 22px;
    padding: 0 20px;
    border-radius: 999px;
    background: #000;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dtm-panel__all:hover {
    background: var(--blue-color);
    color: #fff;
}

.dtm-veil {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--dtm-top, 160px);
    background: rgba(0, 0, 0, 0.22);
    z-index: 9995;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.dtm-veil.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease;
}

/* Entrata morbida: solo dissolvenza per le categorie (uno spostamento muoverebbe anche le colonne). */
.dtm-panel.is-open .dtm-group {
    animation: dtm-fade 0.55s ease backwards;
}

.dtm-group.is-active ul > li {
    animation: dtm-right 0.6s ease backwards;
}

/* La scheda entra con calma, un elemento dopo l'altro. */
.dtm-card > * {
    animation: dtm-up 0.8s ease backwards;
}

.dtm-card > :nth-child(2) { animation-delay: 0.08s; }
.dtm-card > :nth-child(3) { animation-delay: 0.16s; }
.dtm-card > :nth-child(4) { animation-delay: 0.24s; }

@keyframes dtm-fade {
    from { opacity: 0; }
}

@keyframes dtm-up {
    from { opacity: 0; transform: translateY(8px); }
}

@keyframes dtm-right {
    from { opacity: 0; transform: translateX(-8px); }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .dtm-columns {
        --dtm-col1: 215px;
        --dtm-col2: 235px;
    }
}

@media (min-width: 992px) and (max-height: 800px) {
    .dtm-panel__inner {
        padding-top: 16px;
        padding-bottom: 14px;
    }

    .dtm-group {
        margin-bottom: 0;
    }

    .dtm-group__title {
        height: 40px;
    }

    .dtm-group li > a {
        min-height: 32px;
    }

    .dtm-panel__all {
        margin-top: 14px;
    }
}

.dtm-burger,
.dtm-drawer {
    display: none;
}

/* Telefono e tablet
--------------------------------------------- */

@media (max-width: 991px) {
    .primary-navigation,
    .main-navigation {
        display: none !important;
    }

    .dtm-burger {
        display: block;
        position: fixed;
        top: 13px;
        right: calc(2% + 12px);
        z-index: 10000;
        width: 30px;
        height: 30px;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .dtm-burger span,
    .dtm-burger span::before,
    .dtm-burger span::after {
        position: absolute;
        left: 3px;
        width: 24px;
        height: 2px;
        border-radius: 4px;
        background: #000;
        transition: transform 0.3s ease, top 0.3s ease, background-color 0.2s ease;
    }

    .dtm-burger span {
        top: 14px;
    }

    .dtm-burger span::before,
    .dtm-burger span::after {
        content: "";
        left: 0;
    }

    .dtm-burger span::before {
        top: -7px;
    }

    .dtm-burger span::after {
        top: 7px;
    }

    .dtm-open .dtm-burger span {
        background: transparent;
    }

    .dtm-open .dtm-burger span::before {
        top: 0;
        transform: rotate(45deg);
    }

    .dtm-open .dtm-burger span::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .dtm-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 0;
        z-index: 9999;
        overflow: hidden;
        background: #fff;
        color: #000;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.45s cubic-bezier(0.4, 0, 0.25, 1), visibility 0s linear 0.45s;
    }

    .dtm-open .dtm-drawer {
        transform: none;
        visibility: visible;
        transition: transform 0.45s cubic-bezier(0.4, 0, 0.25, 1);
    }

    html.dtm-open,
    html.dtm-open body {
        overflow: hidden !important;
    }

    html.dtm-open #dt-chat-bubble,
    html.dtm-open .iubenda-tp-btn {
        display: none !important;
    }

    .admin-bar .dtm-drawer {
        top: 46px;
    }

    .dtm-open .admin-bar .dtm-burger {
        top: 59px;
    }

    .dtm-drawer__head {
        flex: none;
        display: flex;
        align-items: center;
        height: 60px;
        padding: 0 20px;
        border-bottom: 1px solid #eee;
    }

    .dtm-drawer__head img {
        width: 150px;
        height: auto;
    }

    .dtm-screens {
        position: relative;
        flex: 1;
    }

    /* Una schermata per livello: entra da destra, quella di prima arretra. Nulla si sposta sotto il dito. */
    .dtm-screen {
        position: absolute;
        inset: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.25, 1), opacity 0.5s ease, visibility 0s linear 0.5s;
    }

    .dtm-screen.is-past {
        opacity: 0.35;
        transform: translateX(-25%);
    }

    .dtm-screen.is-current {
        z-index: 1;
        transform: none;
        visibility: visible;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.25, 1), opacity 0.5s ease;
    }

    .dtm-screen__inner {
        max-width: 620px;
        margin: 0 auto;
        padding: 12px 16px calc(32px + env(safe-area-inset-bottom));
    }

    .dtm-drawer a {
        text-decoration: none;
        color: #000;
    }

    .dtm-account a {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 48px;
        border-radius: 999px;
        background: #f3f4f6;
        font-size: 17px;
        font-weight: 500;
        line-height: 1;
        padding-top: 0.18em;
    }

    .dtm-drawer a.dtm-promo--drawer {
        height: 48px;
        margin-top: 10px;
        color: #fff;
        font-size: 18px;
    }

    .dtm-label {
        margin: 22px 8px 4px;
        color: #8a8a8e;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .dtm-list > li + li {
        border-top: 1px solid #f0f0f0;
    }

    .dtm-drawer .dtm-row {
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
        min-height: 56px;
        padding: 6px 8px;
        border: 0;
        background: none;
        color: #000;
        font: inherit;
        font-size: 18px;
        line-height: 1.2;
        text-align: left;
    }

    .dtm-drawer .dtm-row:active {
        background: #f3f6fc;
    }

    .dtm-row__text {
        flex: 1;
    }

    .dtm-row .dtm-chevron {
        margin-right: 6px;
        color: #8a8a8e;
        transform: rotate(-45deg);
    }

    .dtm-back {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 40px;
        padding: 0 14px 0 10px;
        border: 0;
        border-radius: 999px;
        background: #f3f4f6;
        color: #000;
        font: inherit;
        font-size: 16px;
        line-height: 1;
    }

    .dtm-back .dtm-chevron {
        transform: rotate(135deg);
    }

    .dtm-screen__title {
        margin: 18px 8px 10px;
        font-size: 28px;
        font-weight: 600;
        line-height: 1.15;
    }

    .dtm-drawer .dtm-all {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 44px;
        margin: 0 0 8px;
        border-radius: 999px;
        background: #000;
        color: #fff;
        font-size: 16px;
        line-height: 1;
    }

    .dtm-drawer [aria-current="page"] {
        color: var(--blue-color);
    }

    /* "Informazioni": un riquadro compatto, con lo stesso carattere delle voci sopra. */
    .dtm-drawer ul.dtm-info {
        margin-top: 8px;
        padding: 2px 16px;
        border-radius: 16px;
        background: #f5f5f7;
    }

    .dtm-info > li + li {
        border-top: 1px solid #e5e5ea;
    }

    .dtm-drawer .dtm-info a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 48px;
        padding: 0.18em 0 0;
        font-size: 16px;
        line-height: 1.2;
    }

    .dtm-info a::after {
        content: "";
        flex: none;
        width: 7px;
        height: 7px;
        margin: -0.18em 4px 0 0;
        border: solid #a1a1a6;
        border-width: 1.5px 1.5px 0 0;
        transform: rotate(45deg);
    }

    .dtm-info .promo {
        padding: 0 !important;
        background: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dtm-bar *,
    .dtm-drawer,
    .dtm-drawer *,
    .dtm-panel,
    .dtm-panel *,
    .dtm-burger *,
    .dtm-veil {
        animation: none !important;
        transition: none !important;
    }
}

/* Header con il menu del tema (body.dtm-header): logo, ricerca e account sulla prima riga,
   tutta la larghezza alle categorie sulla seconda. Solo da 992 px: sotto resta l'header di prima. */
@media (min-width: 992px) {
    .dtm-header #site-navigation ul#top-menu li {
        padding: 5px 0;
    }

    .dtm-header #site-navigation ul#top-menu a {
        font-size: 14px;
    }

    .dtm-header header#masthead {
        border-bottom: 1px solid #ececee;
    }

    .dtm-header .header-cont {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "logo search shop"
            "nav  nav    nav";
        align-items: center;
        column-gap: 40px;
        row-gap: 10px;
        padding-top: 16px;
        padding-bottom: 10px;
    }

    /* Ricerca e menu stanno nello stesso contenitore: si "scioglie" per metterli su righe diverse. */
    .dtm-header .search-container {
        display: contents;
    }

    .dtm-header .site-branding {
        grid-area: logo;
        width: auto;
    }

    /* Il logo aveva un margine fisso di -17px: qui si centra sulla riga della ricerca. */
    .dtm-header header#masthead .site-branding .custom-logo-link,
    .dtm-header header#masthead .site-branding .custom-logo-link img {
        display: block;
    }

    .dtm-header header#masthead .site-branding .custom-logo-link img {
        margin: 0;
    }

    .dtm-header .search-container .search-form,
    .dtm-header .header-cont .search-form {
        grid-area: search;
        margin: 0 !important;
    }

    .dtm-header .header-cont .search-form form {
        max-width: 720px;
    }

    .dtm-header .header-cont .search-form input.form-control {
        border-radius: 999px;
        font-size: 17px;
    }

    .dtm-header .shop-container {
        grid-area: shop;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        width: auto;
        margin: 0;
    }

    .dtm-header .shop-container ul#shop-menu {
        margin: 0;
    }

    .dtm-header ul#shop-menu li {
        margin-right: 0;
    }

    .dtm-header ul#shop-menu a {
        display: flex;
        align-items: center;
        height: 44px;
        padding: 0.18em 18px 0;
        line-height: 1;
        border-radius: 999px;
        background: #f3f4f6;
        font-size: 16px;
        white-space: nowrap;
        text-decoration: none;
    }

    .dtm-header .wpmenucartli a.wpmenucart-contents {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: #f3f4f6;
    }

    .dtm-header .primary-navigation {
        grid-area: nav;
        position: relative;
        min-width: 0;
        margin: 0;
    }

    .dtm-header .dtm-bar {
        flex-wrap: nowrap;
        justify-content: safe center;
        column-gap: 2px;
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
    }

    .dtm-header .dtm-bar::-webkit-scrollbar {
        display: none;
    }

    .dtm-header .dtm-bar__item {
        flex: none;
    }

    .dtm-header .dtm-bar__link {
        white-space: nowrap;
    }

    .dtm-header .dtm-bar__link .dtm-icon {
        width: 22px;
        height: 22px;
        background: none;
        color: inherit;
    }

    .dtm-header a.dtm-promo--bar {
        height: 38px;
        margin-left: 8px;
        padding: 0 18px;
        font-size: 15px;
    }

    .dtm-arrow {
        position: absolute;
        top: 50%;
        z-index: 2;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        color: #000;
        font-size: 20px;
        line-height: 1;
        transform: translateY(-50%);
    }

    .dtm-arrow[hidden] {
        display: none;
    }

    .dtm-arrow--prev {
        left: -6px;
    }

    .dtm-arrow--next {
        right: -6px;
    }

    /* Pagina scorsa: una riga sola (logo, categorie, account). */
    .dtm-header.initial-scroll header#masthead .header-cont {
        grid-template-areas: "logo nav shop";
        column-gap: 20px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .dtm-header.initial-scroll header#masthead .custom-logo-link img {
        max-width: 140px;
        margin-top: 0;
    }

    .dtm-header.initial-scroll ul#shop-menu {
        display: none;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .dtm-header .header-cont {
        column-gap: 20px;
    }

    .dtm-header .dtm-bar__link {
        gap: 5px;
        padding: 0 9px;
        font-size: 15px;
    }
}

/* Con tante categorie la barra scorre, ma il pulsante promo resta in vista a destra. */
@media (min-width: 992px) {
    .dtm-header .dtm-bar__item--promo {
        position: sticky;
        right: 0;
        background: #fff;
        box-shadow: -10px 0 10px #fff;
    }
}

@media (min-width: 992px) {
    .dtm-header .primary-navigation.is-scrollable .dtm-bar {
        margin: 0 36px;
    }

    .dtm-header .primary-navigation.is-scrollable .dtm-arrow--prev {
        left: -4px;
    }

    .dtm-header .primary-navigation.is-scrollable .dtm-arrow--next {
        right: -4px;
    }
}

@media (min-width: 992px) {
    .dtm-header ul#top-menu {
        align-items: center;
    }

    .dtm-header ul#top-menu li.promo {
        display: flex;
        align-items: center;
        height: 26px;
        padding: 0 10px !important;
    }

    .dtm-header ul#top-menu li.promo a {
        position: relative;
        top: 0.09em;
        line-height: 1;
    }
}
