﻿body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}


/* Stili del logo */
.navbar-brand {
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    margin-right: 15px;
    margin-left: 0;
    flex-shrink: 0;
}

.site-name-black {
    color: #000;
    font-size: 2rem;
    font-weight: 750;
}

.site-name-green {
    color: #3FB44C;
    font-size: 2rem;
    font-weight: 750;
}

/* Stili della barra di navigazione */
.navbar-container {
    position: fixed !important;
    top: 0;
    left: 0; 
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: white;
    padding: 10px 0;
    z-index: 1000;
}

.navbar-content {
    max-width: 1200px; /* максимальная ширина */
    width: 100%; /* занимает всю доступную ширину до 1200px */
    margin: 0 auto; /* центрируем по горизонтали */
    padding: 0 16px; /* внутренние отступы по бокам */
    box-sizing: border-box; /* учитываем padding в ширину */
}

/* Stili per il selettore lingua */
.dot {
    display: inline-block;
    margin: 0 0.3rem;
    font-size: xx-large;
    font-weight: bold;
    vertical-align: middle;
}

.language-selector {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.selected-language {
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #f5f5f5;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .selected-language:hover {
        border-color: #3FB44C;
        box-shadow: 0 0 0 3px rgba(63, 180, 76, 0.5); 
    }

    .selected-language img {
        width: 24px;
        height: 18px;
        object-fit: cover;
    }

.language-dropdown {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    width: 45px;
    border: 1px solid rgba(30, 30, 30, 0.5);
}

.language-item {
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

    .language-item:last-child {
        margin-bottom: 0;
    }

    .language-item:hover {
        background-color: #f5f5f5;
    }

    .language-item img {
        width: 24px;
        height: 18px;
        object-fit: cover;
    }

.navbar-brand {
    display: flex;
    align-items: center;
}

.site-name-black, .site-name-green {
    vertical-align: middle;
}

/* Specifico per mobile */
.mobile-header .language-selector {
    margin-left: 0.2rem;
}

/* Specifico per desktop */
.desktop-brand .language-selector {
    margin-left: 0.2rem;
}

.language-item img, .selected-language img {
    border-radius: 4px; 
}


/* Stili per la versione desktop */
.desktop-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.desktop-brand {
    position: relative !important;
    margin-right: 20px;
    flex-shrink: 0;
}

.search-section {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
}

.search-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 45px;
    width: 45px;
    background: none;
    border: none;
}

.desktop-search-wrapper {
    width: 100%;
    max-width: 500px;
}

.header-buttons {
    display: flex;
}

.add-button {
    color: white;
    background-color: #3FB44C;
    border-radius: 15px;
    height: 45px;
    border: none;
    padding-inline: 10px;
    transition: all 0.15s ease;
}

.right-buttons-wrapper {
    display: flex;
    gap: 10px;
}

/* Stili della barra di ricerca */
.search-input {
    height: 45px;
    border-radius: 15px;
    background-color: #f5f5f5;
    padding-right: 50px;
    border: 1px solid #ddd;
    width: 100%;
}

    .search-input::-webkit-search-cancel-button {
        position: relative;
        right: 20px; 
        cursor: pointer;
        -webkit-appearance: none;
        height: 16px;
        width: 16px;
        background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");
        background-size: 16px 16px;
    }

.btn-link.position-absolute {
    right: 5px; 
    z-index: 5;
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 180, 76, 0.5);
    border-color: #3FB44C;
}

.search-icon-container {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    pointer-events: none;
}

.btn-circle {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    flex-shrink: 0;
    margin-left: 10px;
}

    .btn-circle:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(63, 180, 76, 0.5);
    }

.btn-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

    .btn-icon:hover {
        background-color: #f0f0f0;
    }

    .btn-icon:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(63, 180, 76, 0.5);
    }

.btn-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 180, 76, 0.5);
}

.icon-size {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.icon-barra {
    width: 15px;
    height: 15px;
    object-fit: contain;
    transition: all 0.1s ease;
}

.detail-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 15px;
    transition: background-color 0.2s;
    color: black;
    font-weight: normal;
}

.action-icon {
    margin-right: 4px;
    margin-bottom: 4px;
}

.distance-selector {
    border: none;
    background-color: transparent;
}

.distance-selector-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    cursor: pointer;
}

.distance-selector-mobile-text {
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: black;
    font-size: 0.9rem;
}

.distance-selector-mobile .icon-barra {
    margin-right: 0; 
}

.location-info-mobile {
    font-size: 10px;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.detail-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Stili per il layout mobile */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.mobile-search-container {
    position: relative;
    flex: 1 1 auto;
    max-width: calc(100% - 55px);
}

.mobile-search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

/* ===== Stili per il dropdown menu delle categorie ===== */
.categorie-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.categorie-dropdown {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 1400px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    overflow: hidden;
}

.categorie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

    .categorie-header h4 {
        margin: 0;
        color: black;
        font-weight: 600;
    }

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.categorie-content {
    display: flex;
    height: 500px;
}

.categorie-sidebar {
    width: 30%;
    border-right: 1px solid #eee;
    overflow-y: auto;
}

.categoria-item {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

    .categoria-item:hover,
    .categoria-item.active {
        background-color: #f5f5f5;
    }

.categoria-icon {
    width: 34px;
    height: 34px;
    margin-right: 10px;
    object-fit: contain;
}

.categoria-nome {
    flex-grow: 1;
    color: black;
    font-weight: 500;
}

.arrow-right {
    font-size: 20px;
    color: #999;
}

.sottocategorie-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.sottocategorie-titolo {
    font-weight: 600;
    color: black;
    margin-bottom: 20px;
    padding-bottom: 10px;
    cursor: pointer;
    border-bottom: 2px solid #53b543;
}

    .sottocategorie-titolo:hover {
        color: #53b543;
    }

.sottocategorie-columns {
    display: flex;
    gap: 40px;
}

.sottocategorie-colonna {
    flex: 1;
}

.sottocategoria-gruppo {
    margin-bottom: 20px;
}

.sottocategoria-titolo {
    font-weight: 600;
    margin-bottom: 10px;
    color: black;
    cursor: pointer;
}

    .sottocategoria-titolo:hover {
        color: #53b543;
    }

.sottocategoria-secondaria {
    padding: 6px 0;
    color: #666;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 400;
}

    .sottocategoria-secondaria:hover {
        color: #53b543;
    }

.no-selection {
    display: flex;
    align-items: center;
    justify-content: center;
}

.seleziona-categoria-placeholder {
    color: #999;
    font-size: 1.1rem;
}

/* ===== Media queries per tablet (portrait e landscape) ===== */

@media (max-width: 1200px) {
    .search-section {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .desktop-container {
        flex-wrap: wrap;
    }

    .desktop-search-wrapper {
        max-width: none;
    }

    .desktop-container {
        gap: 15px;
    }
}



@media (max-width: 1024px) {
/*    .navbar-content {
        width: 90%;
    }

    .search-section {
        width: 90%;
    }

    .desktop-search-wrapper {
        max-width: 400px;
    }*/


    .categorie-dropdown {
        width: 90%;
        max-width: 900px;
    }
}

/* ===== Media queries per tablet più piccoli e telefoni in landscape ===== */
@media (max-width: 900px) {
    .desktop-container {
        flex-wrap: wrap;
    }


    .desktop-search-wrapper {
        max-width: none;
    }

    .categorie-dropdown {
        max-height: 80vh;
        overflow-y: auto;
    }

    .categorie-content {
        height: auto;
        max-height: 60vh;
    }
}

/* ===== Media queries per telefoni ===== */
@media (max-width: 768px) {

    .action-icon{
        margin: 0;
    }

    .dot{
        color: black;
    }

    .mobile-header {
        width: 100%;
        margin-bottom: 8px;
        justify-content: center;
    }

    .mobile-footer {
        align-items: center;
        border-top: 1px solid #ddd;
        border-radius: 15px 15px 0 0;
        background: white;
        width: 100%;
        justify-content: center;
        display: flex;
        position: fixed;
        left: 0;
        bottom: 0px;
        padding-block: 10px;
    }

    .site-name-black,
    .site-name-green {
        font-size: 36px;
    }

    /*.navbar-content {
        width: 95%;
    }

    .mobile-header {
        width: 90%;
    }*/
    /*.mobile-search-row {
        width: 90%;
    }*/
    /*.search-input {
        height: 40px;
    }*/
    /*.btn-circle,
    .btn-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }*/
    .categorie-dropdown {
        width: 95%;
        top: 130px;
        max-height: 75vh;
    }

    .categorie-content {
        flex-direction: column;
        height: auto;
        max-height: 65vh;
    }

    .categorie-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        max-height: 30vh;
    }

    .sottocategorie-columns {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== Media query per telefoni piccoli ===== */
@media (max-width: 480px) {

    .footer {
        display: none;
    }


    .navbar-content {
        width: 95%;
        padding: 0;
    }



    .mobile-search-row {
        width: 100%;
    }


    .mobile-search-container {
        max-width: calc(100% - 45px);
    }

    .categorie-dropdown {
        width: 98%;
        top: 120px;
    }

    .categoria-item {
        padding: 10px;
    }

    .categoria-icon {
        width: 28px;
        height: 28px;
    }
}

/* ===== Media query per telefoni in modalità landscape ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar-container {
        padding: 5px 0;
    }

    .mobile-header {
        width: 90%;
        margin-bottom: 5px;
    }

    .mobile-search-row {
        margin-bottom: 0;
        width: 90%;
    }

    .search-input {
        height: 35px;
    }

    .categorie-dropdown {
        top: 100px;
        max-height: 80vh;
    }

    .categorie-content {
        max-height: 60vh;
    }

    .categorie-sidebar {
        max-height: 25vh;
    }
}



/*media hover*/

@media (hover: hover) {
    .add-button:hover {
        background-color: #38A344;
    }

    .detail-item:hover {
        color: #FE580A;
    }

    .search-input:hover {
        background-color: white;
        box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.25);
    }

    .btn-circle:hover {
        background-color: white;
        box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.25);
    }

    .search-button-icon:hover .icon-barra {
        width: 17px;
        height: 17px;
    }
}