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

.content {
    padding: 0;
}

.categories-container,
.promossi-container,
.products-container {
    width: 100%;
    margin-bottom: 2rem;
    margin: 0 auto; 
    box-sizing: border-box; 
}

    .categories-container h3,
    .products-container h3 {
        text-align: left;
        margin-bottom: 1.5rem;
        color: #000;
        font-weight: 600;
        font-size: 1.5rem;
    }

.categories-grid,
.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
}

/* ===== Stili per la sezione annunci promossi ===== */
.promossi-container {
    padding: 1rem 3rem;
    background-color: #e8f5e9;
    border-radius: 25px;
    position: relative;
}

.promossi-title {
    background-color: #3FB44C;
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 25px 25px 0 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    box-sizing: border-box;
}

    .promossi-title h3 {
        color: white !important;
        font-weight: 500;
        font-size: 1.5rem;
        margin: 0;
        padding: 0 10px;
    }

.notifica-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

.specialoffer-icon {
    width: 80px;
    height: auto;
    position: absolute;
    right: -30px;
    top: -20px;
    transform: rotate(15deg);
}

.promossi-scroll {
    margin-top: 4.5rem;
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    margin-bottom: 0.5rem;
    overscroll-behavior-x: contain;
}

    .promossi-scroll::-webkit-scrollbar {
        height: 6px;
    }

    .promossi-scroll::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 3px;
    }

    .promossi-scroll::-webkit-scrollbar-track {
        background-color: rgba(0, 0, 0, 0.1);
    }

    .promossi-scroll ::deep .product-card.smaller-card {
        flex: 0 0 auto;
        width: 200px;
        scroll-snap-align: start;
    }

/* ===== Stili per le card ===== */
.category-card,
.product-card {
    flex: 0 0 calc(25% - 1.5rem); 
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

    .category-card:hover,
    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }

.categories-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between; 
    gap: 10px; 
    margin-bottom: 20px;
}

.category-card {
    flex: 1 1 0;
    min-width: 130px;
    max-width: none;
}

.all-categories {
    display: block;
    position: relative;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 1px solid #e9ecef;
}

    .all-categories:hover {
        background-color: #e9ecef;
    }

.category-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.category-name {
    position: absolute;
    top: 1rem;
    left: 1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.1rem !important;
    font-weight: 550;
    color: #333;
    text-shadow: 0 1px 2px rgba(255,255,255,0.7);
    z-index: 2; 
    max-width: 70%; 
}

.all-categories .category-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
}

.arrow-icon {
    font-size: 24px;
    margin-left: 5px;
    font-style: normal;
}

.card-img-top {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card-price {
    font-weight: 700;
    color: #3FB44C;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card-location {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

    .card-location img {
        width: 16px;
        height: 16px;
        margin-right: 5px;
    }

.card-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
}

/* Supporto cross-browser per scrolling orizzontale */
.categories-scroll {
    scrollbar-width: thin;
}

    .categories-scroll::-webkit-scrollbar {
        height: 6px;
    }

    .categories-scroll::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 3px;
    }

    .categories-scroll::-webkit-scrollbar-track {
        background-color: rgba(0, 0, 0, 0.1);
    }

    .categories-scroll ::deep .category-card {
        flex: 0 0 auto;
        width: 160px;
        scroll-snap-align: start;
    }

/* ===== Media Queries ===== */

/* Tablet (portrait and landscape) */
@media (max-width: 1200px) {
    .main-content {
        margin-top: 100px;
    }
}


@media (max-width: 1024px) {
    

    .category-card,
    .product-card {
        flex: 0 0 calc(33.333% - 1.5rem); 
    }

    .card-img-top {
        height: 160px;
    }
}

/* Tablet più piccoli e telefoni in landscape */
@media (max-width: 900px) {
    .main-content {
        margin-top: 100px;
    }

    .category-card,
    .product-card {
        flex: 0 0 calc(50% - 1rem); 
    }

    .categories-container h3,
    .products-container h3 {
        font-size: 1.3rem;
        margin-bottom: 1.25rem;
    }

    .card-img-top {
        height: 150px;
    }

    .categories-grid,
    .products-grid {
        gap: 1rem;
    }
}

/* Telefoni (portrait) */
@media (max-width: 768px) {
    .main-content {
        margin-top: 55px;
    }

    

    .categories-container,
    .products-container {
        margin-bottom: 1.5rem;
    }

    .categories-scroll ::deep .category-card {
        width: 130px;
    }

    .category-card,
    .product-card {
        flex: 0 0 calc(50% - 0.875rem); 
    }

    .categories-grid {
        justify-content: space-between;
    }

    .category-card {
        flex: 0 0 calc(33.333% - 10px); 
        margin-bottom: 10px;
    }

    .all-categories {
        flex: 0 0 calc(33.333% - 10px);
    }

    .category-name {
        font-size: 0.9rem;
    }

    .categories-grid,
    .products-grid {
        gap: 0.875rem;
    }

    .promossi-title h3 {
        font-size: 1.2rem;
    }

    .promossi-title .title-icon {
        width: 20px;
        height: 20px;
    }

    .promossi-title .special-offer-icon {
        width: 60px;
    }

    .promossi-scroll .product-card {
        width: 180px;
    }

    .promossi-scroll .card-img-top {
        height: 120px;
    }

    .card-img-top {
        height: 140px;
    }

    .card-body {
        padding: 0.75rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-price {
        font-size: 1.1rem;
    }

    .categories-container h3,
    .products-container h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
}

/* Telefoni piccoli */
@media (max-width: 480px) {


    .main-content {
        margin-top: 55px;
    }

    .categories-grid {
        gap: 0.75rem;
    }

    .products-grid {
        gap: 1rem;
    }

    .category-card {
        flex: 0 0 calc(50% - 0.375rem);
    }

    .promossi-title h3 {
        font-size: 1.1rem;
    }

    .promossi-title .title-icon {
        width: 18px;
        height: 18px;
    }

    .promossi-title .special-offer-icon {
        width: 50px;
    }

    .promossi-scroll .product-card {
        width: 160px;
    }

    .promossi-scroll .card-img-top {
        height: 100px;
    }

    .product-card {
        flex: 0 0 100%;
    }

    .card-img-top {
        height: 130px;
    }

    .categories-container h3,
    .products-container h3 {
        font-size: 24px;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-price {
        font-size: 1.05rem;
    }

    .card-location {
        font-size: 0.8rem;
    }
}

/* Telefoni in landscape con altezza limitata */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        margin-top: 90px;
    }

    .category-card,
    .product-card {
        flex: 0 0 calc(33.333% - 0.667rem); 
    }

    .categories-grid,
    .products-grid {
        gap: 1rem;
    }

    .card-img-top {
        height: 120px;
    }

    .categories-container,
    .products-container {
        margin-bottom: 1rem;
    }

        .categories-container h3,
        .products-container h3 {
            margin-bottom: 0.75rem;
        }
}

@media (max-width: 400px) {
    .category-card {
        flex: 0 0 100%; 
    }

    .all-categories {
        flex: 0 0 100%;
    }
}
