/* LOADER */
.loader {
    position: fixed;
    z-index: 1099;
    width: -webkit-fill-available;
    height: 100%;
    background: var(--white);
}
.loader::after {
    content: '';
    position: absolute;
    z-index: 2000;
    top: calc(50% - 1rem);
    left: calc(50% - 1rem);
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid var(--primarioChiaro);
    background: var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    margin: auto;
    animation: spin 0.5s linear infinite;
}

/* BOTTONI */
    /* Bottone Primario */
    .btn-primary {
        width: 100%;
        height: fit-content;
        min-height: 48px;
        padding: 0 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        background: var(--primarioScuro);
        color: var(--light);
        border: 1px solid transparent;
        border-radius: 6px;
        text-align: start;
        line-height: 115%;
        transition: 0.2s ease-in-out;
    }
    .btn-primary:hover {
        background: var(--primarioChiaro);
        border: 1px solid transparent;
        color: var(--light);
    }
    .btn-primary:active {
        opacity: 0.8;
    }

    /* Bottone Secondario */
    .btn-secondary {
        width: 100%;
        height: fit-content;
        min-height: 48px;
        padding: 0 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        background: transparent;
        color: var(--primarioChiaro);
        border: 1px solid var(--primarioChiaro);
        border-radius: 6px;
        text-align: start;
        line-height: 115%;
        transition: 0.2s ease-in-out;
    }
    .btn-secondary:hover {
        background: var(--primarioChiaro);
        border: 1px solid transparent;
        color: var(--light);
    }
    .btn-secondary:active {
        opacity: 0.8;
    }

/* PAGINA LOGIN */
.login-page {
    position: relative;
    height: 100%;
    width: 100%;
    min-height: 100dvh;
    display: flex;
    background: var(--light-medium);

    .form-container {
        width: 580px;
        max-width: 96%;
        margin: auto;
        height: fit-content;
        padding: 3%;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        border-radius: 6px;
        background: var(--white);
    }
    .tab-header {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0;
        margin: 0 0 1rem 0;
    }
    .subtitle {
        color: var(--primarioChiaro);
    }
    .form-control.is-invalid,
    .form-control.is-valid {
        background-position: right 3rem center;
    }
    .captcha-container {
        margin: 0;
    }
    .footer-tab {
        height: fit-content;
        margin: 1rem 0 0 0;
    }
    .btn-large-round-outline {
        background: var(--primarioChiaro);
    }
    .text-big-bold {
        color: var(--red-color);
    }
}

/* PAGINA PRINCIPALE */
.main-page {
    display: flex;
    height: 100%;
    min-height: 100%;
    position: relative;
    width: 100%;
    background-color: var(--light);

    /* Side */
    .side-nav {
        display: flex;
        gap: 0.75rem;
        flex-direction: column;
        justify-content: flex-start;
        width: 320px;
        border-right: 1px solid var(--white);
        height: 100%;
        min-height: 100dvh;
        position: sticky;
        top: 0;
        max-width: 96%;
        background: var(--white);
    }
    .header-side-dashboard {
        gap: 1rem;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        height: fit-content;
        border-bottom: 1px solid var(--grigio_base-opacity);
    }
    .header-side-dashboard .subtitle {
        color: var(--primarioChiaro);
    }
    .header-side-dashboard > .btn-square {
        margin-left: auto;
    }
    .tab-dashboard {
        position: relative;
        height: 100%;
        min-height: 100dvh;
        max-height: 100%;
        width: 1280px;
        max-width: 96%;
        margin: auto;
    }
    .tab-content>.active {
        display: flex;
        flex-direction: column;
    }
    .tab-content {
        height: 100%;
        width: 100%;
        max-width: none;
        margin: auto;
    }

    .nav-tabs {
        height: fit-content;
        max-height: 100% !important;
        min-height: fit-content;
        box-shadow: none !important;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        padding: 0;
        gap: 0.25rem;
    }
    .nav-tabs .nav-link {
        border: none !important;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        width: 100%;
        height: 3.5rem;
        background-color: transparent;
        color: var(--dark);
        font-size: 1rem;
        transition: all 0.3s ease-in-out;
    }
    .nav-tabs .nav-link:hover {
        background-color: var(--grigio_light-opacity);
        filter: none;
    }
    .nav-tabs .nav-link.active {
        color: var(--light);
        background-color: var(--primarioChiaro);
        border-color: transparent;
    }
    .header-tab {
        display: grid;
        grid-template-columns: 75% 23%;
        gap: 2%;
        margin: 0 0 2rem 0;
        padding: 2rem 0;
        border-bottom: 1px solid var(--grigio_base-opacity);
    }
    .header-tab .title {
        grid-column: 1;
        grid-row: 1;
    }
    .header-tab .text-big {
        grid-column: 1;
        grid-row: 2;
    }
    .header-tab .btn-secondary {
        height: 100%;
        grid-row: span 2;
    }
    .form-container {
        gap: 2rem;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        position: relative;
    }
    .header-lista .text-center {
        width: 100%;
        text-align: center!important;
    }
    .form-select {
        min-height: 3rem;
    }

    .paginazione-container {
        display: grid;
        place-items: center;
        width: 100%;
        margin: auto 0 1rem 0;
        max-width: 100%;
        overflow-x: auto;
        padding: 1rem;
    }
    .button-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }
}

.header-nav {
    display: flex;
    width: 100%;
    height: 5rem;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    z-index: 1099;
    background: var(--light);
    box-shadow: 0 0 6px var(--grigio_base-opacity);
}

/* CONTENITORE FLEX */
.flex-wrap-container {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    gap: 1.75rem 1rem;

    .col-fit {
        flex: 0 0 auto;
        min-width: 40px;
        max-width: 100%;
    }

    .col-xs {
        flex: 0 0 80px;
        max-width: 100%;
    }
    .col-s {
        flex: 0 0 160px;
        max-width: 100%;
    }
    .col-m {
        flex: 0 0 240px;
        max-width: 100%;
    }
    .col-l {
        flex: 0 0 320px;
        max-width: 100%;
    }
    .last-col {
        margin: 0 0 0 auto;
    }
}

/* RIGA PRODOTTO */
.riga-prodotto {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 0 0 1rem 0;

    .form-check {
        margin: 1.4rem auto;
        width: fit-content;
    }
    .last-col {
        display: flex;
        gap: 1rem;
    }
    .btn-container {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        flex: 1 0 170px;
        align-items: center;
    }
    .btn-secondary {
        flex: 1 0 160px;
    }
}

/* MODALE MODIFICA PRODOTTO */
.modal-modifica-prodotto {

    .modal-dialog {
        width: 1280px;
        max-width: 100%;
        margin: 1rem auto;
        height: calc(100dvh - 2rem);
    }
    .modal-content {
        height: 100%;
    }
    .modal-header {
        background: var(--grigio_light-opacity);
        border-bottom: 1px solid var(--grigio_base-opacity);
    }
    .modal-body {
        overflow-y: auto;
        padding: 2%;
        background: var(--grigio_light-opacity);
    }
    .modal-footer {
        background: var(--grigio_light-opacity);
        border-top: 1px solid var(--grigio_base-opacity);
    }
    .btn-primary,
    .btn-secondary {
        width: fit-content;
        flex: 1 0 320px;
    }
    .main-container {
        padding: 1rem;
    }
    .accordion {
        padding: 0 0 1rem 0;
    }
    .header-section {
        padding: 0.5rem;
        border-bottom: 1px solid var(--grigio_base-opacity);
        width: 100%;
        background: transparent;
    }
    .accordion-item {
        background: transparent;
    }
    .accordion-button::after {
        content: "";
        flex-shrink: 0;
        width: 1rem;
        height: 1rem;
        margin-left: auto;
        background-repeat: no-repeat;
        background-size: 1rem;
        background-image: url('data:image/svg+xml,%3csvg xmlns="http://www.w3.org/2000/svg" width="1rem" height="1rem" viewBox="0 0 24 24"%3e%3cpath fill="%23000000" d="M12 2c0-.55-.45-1-1-1s-1 .45-1 1v9H2c-.55 0-1 .45-1 1s.45 1 1 1h8v9c0 .55.45 1 1 1s1-.45 1-1v-9h9c.55 0 1-.45 1-1s-.45-1-1-1h-9V2z"/%3e%3c/svg%3e');
        transition: transform 0.2s ease-in-out;
    }
    .accordion-button:not(.collapsed)::after {
        transform: rotate(45deg);
    }
    .accordion-button:focus {
        border-color: var(--grigio_base-opacity)!important;
    }
    .accordion-collapse {
        padding: 1rem;
    }
    .subtitle {
        margin: 0;
    }
}
.form-dati {
    height: 100%;

    .section-form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .col-fit {
        flex: 0 0 auto;
        min-width: 40px;
        max-width: 100%;
    }
    .col-xs {
        flex: 1 0 80px;
        max-width: 100%;
    }
    .col-s {
        flex: 1 0 160px;
        max-width: 100%;
    }
    .col-m {
        flex: 1 0 240px;
        max-width: 100%;
    }
    .col-l {
        flex: 1 0 320px;
        max-width: 100%;
    }
    .col-xl {
        flex: 1 0 400px;
        max-width: 100%;
    }
    .col-full {
        flex: 1 0 100%;
        max-width: 100%;
    }
    .last-col {
        margin: 0 0 0 auto;
    }
    .form-control {
        background-color: var(--light);
    }
    .form-floating>label {
        width: max-content;
    }
}

/* Lista allegati prodotto */
.list-allegati {
    position: relative;
    min-height: 6rem;

    .loader {
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--grigio_light);
    }
    .loader::after {
        content: '';
        display: block;
        position: relative;
        left: 0;
        top: 0;
        z-index: 2000;
        width: 40px;
        height: 40px;
        border: 3px solid var(--primarioChiaro);
        background: transparent;
        border-top-color: transparent;
        border-radius: 50%;
        margin: auto;
        animation: spin 0.4s linear infinite;
    }
}

/* RIGA ALLEGATO */
.riga-allegato {
    position: relative;
    overflow: hidden;
    height: fit-content;
    padding: 0.25rem 0.25rem 0.75rem 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
    width: 100%;
    background: transparent;
    border-bottom: 1px solid var(--grigio_base-opacity);
    
    .img-container {
        position: relative;
        width: 4rem;
        overflow: hidden;
        height: 5rem;
        background: var(--white);
        padding: 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .img-container::before {
        content: "";
        position: relative;
        width: 28px;
        height: 28px;
        border: 3px solid rgba(0, 0, 0, 0.2);
        border-top-color: var(--secondario-chiaro);
        border-radius: 50%;
        animation: spin 1s linear infinite;
        z-index: 1;
        display: block;
    }

    .video,
    .img-allegato {
        width: 100%;
        height: 100%;
        object-fit: contain;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
        padding: 0.25rem;
        background: var(--white);
    }
    .edit-btn {
        position: absolute;
        z-index: 5;
        top: 0;
        right: 0;
        width: 2rem;
        height: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .input-xs {
        flex: 1 0 80px!important;
    }
    .input-s {
        flex: 1 0 120px!important;
    }
    .input-m {
        flex: 1 0 160px!important;
    }
    .input-l {
        flex: 1 0 200px!important;
    }
    .input-btn {
        flex: 1 0 3rem;
        height: 3rem;
    }
    .form-check {
        margin: 1.5rem 0 auto 0;
    }
}

/* SCREEN M */
@media screen and (min-width: 1280px) and (max-width: 1480px) {
    .hide-desktop {
        display: flex;
    }
    .hide-mobile {
        display: none;
    }
}

/* SCREEN S */
@media screen and (min-width: 768px) and (max-width: 1279px) {
    .hide-desktop {
        display: flex;
    }
    .hide-mobile {
        display: none;
    }
}

/* MOBILE */
@media screen and (max-width: 767px) {
    .main-page {
        flex-direction: column;
        gap: 1rem;
    }
    .main-page .header-tab {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .main-page .header-tab .btn-secondary {
        height: fit-content;
        grid-row: auto;
    }
    .riga-prodotto {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 0.5rem;
        background: var(--white);
        box-shadow: inset 0 0 4px var(--grigio_base-opacity);
        margin: 0 0 1rem 0;
        border: none;
        border-radius: 4px;
    }
    .riga-prodotto div {
        grid-column: span 2;
        width: 100%;
    }
    .riga-prodotto .form-check {
        margin: 1rem 0;
    }
    .riga-prodotto .form-select {
        width: 100%;
    }
    .hide-mobile {
        display: none;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0);
    }
    100% {
        transform: rotate(360deg);
    }
}