/* ==========================================================================
   MASSIMO — Butoane mărime (generate din select)
   ========================================================================== */
.massimo-size-swatches {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px;
    margin: 4px 0 8px;
    width: 100%;
    max-width: 100%;
}
.massimo-size {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto !important;
    width: 35px !important;
    height: 35px !important;
    min-width: 0 !important;
    max-width: 35px !important;
    padding: 0 !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: #333;
    background: #fff;
    border: 1.5px solid #dcdcdc;
    border-radius: 6px;
    cursor: pointer;
    transition: all .18s ease;
}

.massimo-size:hover {
    color: #6b3fa0;
    border-color: #b795e0;
    background: #f7f2fc;
}
.massimo-size.is-selected {
    color: #fff;
    background: #6b3fa0;
    border-color: #6b3fa0;
}
.massimo-size:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 63, 160, .15);
}
/* mărime fără stoc — gri, tăiată, neclickabilă */
.massimo-size.is-oos {
    color: #bbb;
    background: #f5f5f5;
    border-color: #e5e5e5;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}
.massimo-size.is-oos:hover {
    color: #bbb;
    background: #f5f5f5;
    border-color: #e5e5e5;
}
.massimo-size.is-oos::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 1.5px;
    background: #cfcfcf;
    transform: rotate(-20deg);
}
/* ==========================================================================
   MASSIMO — Butoane mărime în catalog (compacte, centrate)
   ========================================================================== */
.massimo-size-swatches--catalog {
    justify-content: center;
    flex-wrap: wrap !important;      /* în catalog rămân pe mai multe rânduri */
    gap: 5px;
    margin: 6px 0 2px;
}
.massimo-size-swatches--catalog .massimo-size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto !important;       /* în catalog: dimensiune fixă 30px */
    min-width: 30px !important;
    height: 30px;
    padding: 0 5px;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    box-sizing: border-box;
}

/* Exact 5 mărimi: păstrează toate butoanele pe un singur rând.
   :last-child limitează regula la 5 elemente, fără să afecteze cazurile 6+. */
.massimo-size-swatches--catalog:where(:has(> .massimo-size:nth-child(5):last-child)) {
    flex-wrap: nowrap !important;
}
.massimo-size-swatches--catalog:where(:has(> .massimo-size:nth-child(5):last-child)) > .massimo-size {
    flex: 0 0 30px !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    aspect-ratio: 1 / 1;
}

@media (max-width: 549px) {
    .massimo-size-swatches--catalog {
        justify-content: flex-start;
        flex-wrap: nowrap !important;
        gap: 3px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .massimo-size-swatches--catalog .massimo-size {
        flex: 0 0 24px !important;
        width: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        height: 24px !important;
        padding: 0 !important;
        font-size: 10px;
    }
    .massimo-size-swatches--catalog:has(> .massimo-size:nth-child(6)) > .massimo-size {
        flex: 0 0 20px !important;
        width: 20px !important;
        min-width: 20px !important;
        max-width: 20px !important;
        height: 20px !important;
        font-size: 9px;
    }
    .massimo-size-swatches--catalog .massimo-size:first-child {
        margin-left: auto;
    }
    .massimo-size-swatches--catalog .massimo-size:last-child {
        margin-right: auto;
    }
    .massimo-size-swatches:not(.massimo-size-swatches--catalog) .massimo-size {
        width: 30px !important;
        height: 30px !important;
        max-width: 30px !important;
        font-size: 12px;
    }
}
