/* Var */
:root {
    --primary-color: #000;
    --secondary-color: #fff;
    --tertiary-color: #b4b4b4; /* rgb(180, 180, 180) */

    --spacing: clamp(18px, 2vw, 36px);
    --width-sidebar: clamp(180px, 20vw, 360px);
    --spacing-field: 0.4rem
}
@font-face {
    font-family: 'SuisseIntl';
    src: url('/assets/font/SuisseIntl-Light.otf') format('opentype');
    
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Reckless Neue';
    src: url('/assets/font/RecklessNeue-Light.otf') format('opentype');
    
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* General */
html, body {
    margin: 0;
    background: var(--secondary-color);
    font-family: 'SuisseIntl', Arial, sans-serif;
    font-size: 15px;
    color: var(--primary-color);
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body:not(.public) main, header, footer {
    padding: var(--spacing);
}
header {
    padding-bottom: 0;
}
main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--spacing);
    padding-top: 0;
    min-height: 0;
}
main:has(.has-sidebar) {
    flex-direction: row;
}
main > * {
    overflow-y: auto;
}
@media (min-width: 1200px) {
    .h1, h1 {
        font-size: 1.65rem;
    }
    .h1, h2 {
        font-size: 1.5rem;
    }
    .h1, h3 {
        font-size: 1.35rem;
    }
    .h1, h4 {
        font-size: 1.2rem;
    }
    .h1, h5 {
        font-size: 1.05rem;
    }
}
form {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}
label {
    color: var(--tertiary-color);
    width: 100%;
}
input, select, textarea {
    border: none;
    border-bottom: 2px solid var(--primary-color);
    width: 100%;
    margin-bottom: var(--spacing-field);
    padding: var(--spacing-field) 0;
    background: none;
}
input:focus, select:focus {
    border-width: 0;
    border-bottom: 0.7px solid var(--primary-color);
    outline: none;
}
label:has(input[type=checkbox]) {
    display: inline-block;
}
label:has(input[type=checkbox]) > * {
    width: auto;
}
input[type="range"],
.noUi-target {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    height: 2px;
    padding: 0;
    margin: var(--spacing-field) 5px;
}
input[type="range"]:hover {
    opacity: 1;
}
input[type="range"]::-webkit-slider-thumb,
.noUi-connect {
    -webkit-appearance: none; /* Override default look */
    appearance: none;
    background: var(--primary-color);
    cursor: pointer;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
/* input[type="range"]::-moz-range-thumb */
.noUi-handle,
.noUi-horizontal .noUi-handle {
    background: var(--primary-color);
    cursor: grab;
    border-radius: 50%;
    box-shadow: none;
    border: none;
    width: 10px;
    height: 10px;
    right: -5px;
    top: -5px;
}
.noUi-handle:after, .noUi-handle:before {
    content: none;
}
.range-values {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 12px;
}
button {
    width: 100%;
    height: 44px;
    border: none;
    padding: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--tertiary-color);
}
img.icon {
    width: 14px;
    height: 14px;
}

/* Framework */
[data-url] {
    cursor: pointer;
}
[data-url] td {
    transition: background-color 0.3s ease;
}
[data-url]:hover td {
    background-color: var(--primary-color);
}
[data-template] {
    display: none !important;
}
.actions {
    text-align: right !important;
}
.show-with-quantity:has([data-quantity="0"]) {
    display: none;
}
.show-without-quantity:has([data-quantity]:not([data-quantity="0"])) {
    display: none;
}
.lang-switch > *:not(:last-child):after {
    content: ' / ';
}

/* Stili */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.btn-group {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}
.t-uppercase {
    text-transform: uppercase;
}
.mb-2 {
    margin-bottom: 2rem;
}
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    position: fixed;
    top: 5rem;
    transform: translateX(-50%) !important;
    left: 50% !important;
    z-index: 1000;
}
.alert-info {
    background-color: #f0f0f0;
}
.alert-danger {
    background-color: #f0f0f0;
}
.alert-success {
    background-color: #f0f0f0;
}
.alert-warning {
    background-color: #f0f0f0;
}
#load-more {
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--tertiary-color);
    margin-top: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
#load-more:hover {
    background-color: var(--tertiary-color);
    color: var(--secondary-color);
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
.modal img {
    width: 100%;
    height: calc(100% - 4rem);
    margin-top: 2rem;
    object-fit: contain;
    object-position: center;
}
.flex-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.flex-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}
.flex-jc-between {
    justify-content: space-between;
}
.image-box {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}
.image-box img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* cover/contain */
    object-position: center;
}
.image-thumbs .image-box {
    aspect-ratio: 1 / 1;
    max-width: 107px;
    max-height: 107px;
}
.image-thumbs .image-box:not(:last-child) {
    margin-bottom: 1rem;
}
.mobile-only {
    display: none;
}
.desktop-only {
    display: block;
}
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    .desktop-only {
        display: none;
    }
    .mobile-br {
        height: 0;
        opacity: 0;
        visibility: hidden;
        display: block;
    }
}
.hidden-if-empty:has(.empty-state) {
    display: none;
}

/* Back to top */
#back-to-top img {
    position: fixed;
    bottom: 45px;
    right: 20px;
    width: 30px;
    height: 30px;
    color: var(--secondary-color);
    z-index: 1000;
}

/* Effects */
.opacity:hover .opacity-item {
    opacity: .6;
    -moz-opacity: .6;
    -webkit-opacity: .6;
    filter: opacity(60);
}

.opacity {
    -moz-transition: opacity .25s ease-in-out;
    -webkit-transition: opacity .25s ease-in-out;
    -o-transition: opacity .25s ease-in-out;
    transition: opacity .25s ease-in-out;
}

.zoom:hover .zoom-item {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
}
.zoom .zoom-item {
    -webkit-transition: all 1s ease;
    -moz-transition: all 1s ease;
    -o-transition: all 1s ease;
    -ms-transition: all 1s ease;
    transition: all 1s ease;
}

/* Grid */
.grid-cols-1 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}
.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Cards list */
.cards-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    /*   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); */
}
@media (max-width: 2000px) {
    .cards-list {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 1200px) {
    .cards-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .cards-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
.cards-carousel {
    position: relative;
    padding: 0 2rem;
}
.cards-carousel .cards-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-snap-align: start;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
    margin: 0 1rem;
}
.cards-carousel::-webkit-scrollbar {
    display: none;
}
.cards-carousel .cards-container > * {
    flex: 0 0 calc(100% / 5 - 3rem);
    scroll-snap-align: start;
}
@media (max-width: 1400px) {
    .cards-carousel .cards-container > * {
        flex: 0 0 calc(100% / 4 - 3rem);
    }
}
@media (max-width: 1024px) {
    .cards-carousel .cards-container > * {
        flex: 0 0 calc(100% / 3 - 3rem);
    }
}
@media (max-width: 768px) {
    .cards-carousel .cards-container > * {
        flex: 0 0 calc(100% / 2 - 3rem);
    }
}
.cards-carousel a.carousel-arrow {
    position: absolute;
    width: 2rem;
    height: 2rem;
    top: calc(50% - 1rem);
    z-index: 1;
    background-color: var(--secondary-color);
    border-radius: 50%;
    font-size: 2rem;
    line-height: 2rem;
    text-align: center;
    color: var(--tertiary-color);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.cards-carousel a.carousel-arrow:hover {
    background-color: var(--tertiary-color);
    color: var(--secondary-color);
    opacity: 1;
}
.cards-carousel a.carousel-arrow.prev {
    left: 0;
}
.cards-carousel a.carousel-arrow.next {
    right: 0;
}
/*
@media (max-width: 480px) {
    .cards-list {
        grid-template-columns: repeat(1, 1fr);
    }
}
*/
.card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
}
.card-header {
    height: 100%;
}
.card-text {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
}
.card-footer {
    padding-top: 1rem;
}
@media (max-width: 768px) {
    .cards-carousel.mobile-vertical {
        padding: 0;
    }
    .cards-carousel.mobile-vertical .cards-container {
        flex-direction: column;
    }
    .cards-carousel.mobile-vertical .cards-container > * {
        flex-direction: row;
        gap: 1rem;
    }
    .cards-carousel.mobile-vertical .cards-container .card {
        padding: 0;
    }
    .cards-carousel.mobile-vertical .card > * {
        width: 50%;
    }
    .cards-carousel.mobile-vertical .carousel-arrow {
        display: none;
    }
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 0.5rem;
    border: 1px solid var(--primary-color);
}
.table th {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}
.table td {
    background-color: var(--secondary-color);
}
.table tr:nth-child(even) td {
    background-color: var(--tertiary-color);
}
.table tr:not(.edit):hover td {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    cursor: pointer;
}
.table tr:not(.edit) span,
.table tr.edit input,
.table tr.edit select,
.table tr.edit button {
    display: block;
}
.table tr.edit span,
.table tr:not(.edit) input,
.table tr:not(.edit) select,
.table tr:not(.edit) button {
    display: none;
}

/* Sidebar */
.sidebar {
    width: var(--width-sidebar);
    height: 100%;
    background-color: var(--secondary-color);
    /*border-right: 1px solid var(--tertiary-color);*/
    overflow-x: hidden;
    overflow-y: auto;
}
.sidebar.sticky {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: fit-content;
    max-height: 100vh;
    overflow-y: auto;
    background: #FFF;
    z-index: 1000;
    padding: 1rem 0;
}
.sidebar-header,
.count {
    font-size: 20px;
    line-height: 29px;
}
.sidebar-button {
    display: none;
}
.sidebar-content {
    display: flex;
    flex-direction: column;
    font-size: 19px;
}
.sidebar-content summary {
    padding-top: 20px;
}
.sidebar:has(.sidebar-content) .sidebar-header,
.sidebar:has(.sidebar-footer) .sidebar-content {
    padding-bottom: calc(var(--spacing) / 2);
}

.has-sidebar {
    width: calc(100% - var(--width-sidebar));
}
@media (max-width: 768px) {
    body {
        display: block;
    }
    main:has(.has-sidebar) {
        flex-direction: column;
    }
    .sidebar, .has-sidebar {
        width: 100%;
    }
    .sidebar.show {
        display: flex;
        flex-direction: column;
        background: var(--secondary-color);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        padding: 1rem;
        box-sizing: border-box;
    }
    .sidebar .plus {
        display: block;
    }
    .sidebar .minus {
        display: none;
    }
    .sidebar.show .plus {
        display: none;
    }
    .sidebar.show .minus {
        display: block;
    }
    .sidebar-button {
        display: flex;
        gap: 0.5rem;
        justify-content: center;
        align-items: center;
        border: 1px solid var(--tertiary-color);
        background: var(--secondary-color);
    }
    .sidebar-content {
        display: none;
    }
    .sidebar.show .sidebar-content {
        display: block;
    }
    .sidebar-content > * {
        margin-bottom: 1rem;
    }
    .sidebar-content > *:last-child {
        margin-bottom: 0;
    }
}

/* Filters*/
.filter-item,
#filters button {
    font-family: 'SuisseIntl', Arial, sans-serif;
    font-size: 12px;
    line-height: 10px;
}
.filter-item:not(:last-child) {
    margin-right: 2px;
}
.filter-item:after {
    content: 'x';
    font-weight: bold;
    margin: 3px
}
#filters {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    position: relative;
    min-height: 35px;
}
#filters-list {
    margin-right: 95px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 6px;
}   
#filters-clear {
    position: absolute;
    top: 0;
    right: 0;
}
#filters button {
    width: 83px;
    height: 29px;
    background: none;
    border: 2px solid var(--primary-color);
}
.filters-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}
.filter-accordion-item > summary {
    cursor: pointer;
    list-style: none;
    border-bottom: 2px solid var(--primary-color);
}
.filter-accordion-item > summary::-webkit-details-marker {
    display: none;
}
.filter-accordion-item[data-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}
.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}
.filter-option {
    background: transparent;
    font-size: 13px;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    height: auto;
    text-align: left;
}
.filter-option.active {
    font-weight: bold;
}
.search-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 442px;
    margin-left: auto;
}
.search-container label {
    color: var(--primary-color);
}
.search-container input {
    width: 100%;
    height: 35px;
    padding: 0 0.5rem;
}
.search-container img {
    width: 20px;
    height: 20px;
}

/* Header */
.app-nav-toggle {
    display: none;
}

.app-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header-logo img {
    display: block;
    width: 230px;
    margin: 0 auto;
}

.app-header-hamburger {
    width: 32px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.app-header-hamburger span {
    height: 2px;
    background-color: var(--primary-color);
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-header-mobile-panel {
    display: none;
    padding: 0 1rem 1rem;
}

.app-header-user--mobile {
    display: block;
    padding-top: var(--spacing);
}

.app-header-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.app-header-menu--mobile {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
}

.app-header-menu--mobile li {
    list-style: none;
}

.app-header-menu--mobile a {
    font-size: 0.9rem;
}

.app-header-lang {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.app-header-user-title {
    margin-bottom: 0.25rem;
}

.app-header-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-header-username {
    font-weight: 600;
}

.app-header-desktop {
    display: none;
}

.app-header-desktop-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.app-header-menu--desktop a {
    margin-left: 1.5rem;
}

/* Toggle stato aperto menu mobile */
.app-nav-toggle:checked ~ .app-header-mobile-panel {
    display: block;
}

.app-nav-toggle:checked ~ .app-header-bar--mobile .app-header-hamburger span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.app-nav-toggle:checked ~ .app-header-bar--mobile .app-header-hamburger span:nth-child(2) {
    opacity: 0;
}

.app-nav-toggle:checked ~ .app-header-bar--mobile .app-header-hamburger span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* Footer */
footer {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: space-between;
    border-top: 1px solid var(--tertiary-color);
}

@media (max-width: 768px) {
    footer {
        flex-direction: column;
    }
}

@media (min-width: 769px) {
    .app-header-bar--mobile,
    .app-header-mobile-panel,
    .app-header-user--mobile {
        display: none;
    }

    .app-header-desktop {
        display: block;
    }

    .app-header-bar--desktop {
        padding-bottom: 0.5rem;
    }

    .app-header-bar__spacer {
        flex: 1;
    }

    .app-header-logo {
        flex: 0 0 auto;
    }

    .app-header-lang--desktop {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }

    .app-header-desktop-bottom {
        align-items: flex-end;
    }

    .app-header-user--desktop {
        max-width: 50%;
    }
}

/* Login / Register */
#login-public main,
#register-public main {
    padding: 0;
    min-height: 100vh;
    display: flex;
    width: 100%;
    flex-direction: row;
}
#login-form {
    width: 50%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-left: clamp(20px, 5vw, 168px);
    justify-content: space-evenly;
}
#login-form > * {
    max-width: 540px;
}
#login-form img {
    width: clamp(200px, 20vw, 364px);
    /*margin: clamp(50px, 20vw, 180px) 0;*/
}
#login-bg {
    width: 50%;
    background-image: url('/assets/media/login.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
#login-public .lang-switch {
    position: fixed;
    padding: var(--spacing);
    right: 50%;
}
@media (max-width: 768px) {
    #login-form {
        width: 100%;
        padding-left: 0;
        margin: 2rem;
    }

    #login-bg {
        display: none;
    }
    .btn-group {
        flex-direction: column;
    }
    #login-public .lang-switch {
        right: 0;
    }
}

/* Tappeti */ 
[data-reserved] {
    position: relative;
}
[data-reserved="1"]:after {
    content: 'Riservato';
    background: var(--tertiary-color);
    color: #FFF;
    opacity: 0.8;
    font-family: 'Reckless Neue', Arial, sans-serif;
    font-size: 17px;
    text-align: center;
    position: absolute;
    top: 1rem;
    right: 0;
    width: 106px;
    height: 32px;
    line-height: 32px;
}
html[lang="en"] [data-reserved="1"]:after {
    content: 'Reserved';
}

/* Tappeto */
.carpet-data {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
}
.carpet-data > * {
    margin: 0 1rem;
}
.carpet-data > *:last-child {
    margin-right: 0;
}
.carpet-data > *:first-child {
    margin-left: 0;
}
.carpet-data h1 {
    font-family: 'Reckless Neue', Arial, sans-serif;
    font-size: 45px;
    line-height: 50px;
}
.carpet-data label {
    font-family: 'Reckless Neue', Arial, sans-serif;
    font-size: 20px;
    line-height: 29px;
}
.carpet-data span {
    font-family: 'Reckless Neue', Arial, sans-serif;
    font-size: 17px;
    line-height: 25px;
}
.carpet-data span label {
    font-family: 'SuisseIntl', Arial, sans-serif;
    font-size: 17px;
    line-height: 25px;
    text-transform: uppercase;
    margin-bottom: 0;
}
.carpet-data span label,
.carpet-data span small {
    width: 100%;
    display: block;
}
@media (max-width: 2000px) {
    .carpet-data {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 1200px) {
    .carpet-data {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .carpet-data {
        grid-template-columns: repeat(1, 1fr);
    }
    .carpet-data > *:nth-child(2) {
        order: 1;
    }
    .carpet-data > *:nth-child(3) {
        order: 2;
    }
    .carpet-data > *:nth-child(1) {
        order: 3;
    }
    .carpet-data > *:nth-child(4) {
        order: 4;
    }
}