/* Pagina Prodotto Singolo */
.prodotto-container {
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
    min-width: 0;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #64748b;
    min-width: 0;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs i {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Titolo prodotto */
.prodotto-titolo {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* Grid principale */
.prodotto-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
    min-width: 0;
}

.prodotto-grid > *,
.prodotto-immagini,
.prodotto-info,
.info-card {
    min-width: 0;
}

/* Sezione immagini */
.prodotto-immagini {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.immagine-principale {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
}

.immagine-principale img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.immagini-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.thumbnail {
    width: 80px;
    flex: 0 0 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.thumbnail:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info prodotto */
.info-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    min-width: 0;
}

.info-titolo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    overflow-wrap: anywhere;
}

.info-row {
    display: flex;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e2e8f0;
    min-width: 0;
}

.info-label {
    width: 120px;
    font-weight: 600;
    color: #475569;
}

.info-value {
    flex: 1;
    color: #1e293b;
    min-width: 0;
    overflow-wrap: anywhere;
}

.info-value.codice {
    font-family: monospace;
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.info-codici {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.info-codici h3 {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prezzo-riassunto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #2563eb10, #3b82f610);
    border-radius: 12px;
    gap: 1rem;
    min-width: 0;
}

.prezzo-minimo {
    text-align: center;
}

.prezzo-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.prezzo-valore {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #10b981;
    overflow-wrap: anywhere;
}

.prezzo-originale-inline {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 600;
}

.negozi-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    font-size: 1.1rem;
    min-width: 0;
}

.negozi-count i {
    color: #2563eb;
    font-size: 1.2rem;
}

.prodotto-actions {
    margin-top: 1.25rem;
}

.btn-add-favorite {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: none;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-add-favorite:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
}

/* Descrizione estendibile */
.prodotto-descrizione {
    background: white;
    border-radius: 16px;
    margin-bottom: 3rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.descrizione-header {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
    gap: 1rem;
    min-width: 0;
}

.descrizione-header:hover {
    background: #f1f5f9;
}

.descrizione-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    color: #1e293b;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.descrizione-header i {
    font-size: 1.2rem;
    color: #2563eb;
    transition: transform 0.3s ease;
}

.descrizione-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    padding: 0 2rem;
    color: #475569;
    line-height: 1.8;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Offerte */
.offerte-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    min-width: 0;
    overflow: hidden;
}

.offerte-section h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 2rem;
}

.offerte-table {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
}

/* Aggiornamento tabella offerte con immagini */
/* Offerte Section - Tabella prezzi */
.offerte-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.offerte-section h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 2rem;
}

.offerte-table {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.offerte-header {
    display: grid;
    grid-template-columns: 96px minmax(190px, 1.8fr) minmax(120px, 0.9fr) minmax(120px, 0.85fr) minmax(130px, 0.9fr) 120px;
    background: #f8fafc;
    padding: 1rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.offerta-row {
    display: grid;
    grid-template-columns: 96px minmax(190px, 1.8fr) minmax(120px, 0.9fr) minmax(120px, 0.85fr) minmax(130px, 0.9fr) 120px;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.2s ease;
    align-items: center;
    min-width: 0;
}

.offerta-col {
    min-width: 0;
    overflow-wrap: anywhere;
}

.offerta-row:hover {
    background: #f8fafc;
}

.offerta-row:last-child {
    border-bottom: none;
}

/* Colonna immagine - versione con copertura */
.offerta-col.immagine {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.3rem;
}

.offerta-shop-image-container {
    width: 78px;
    height: 78px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.offerta-shop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.offerta-row:hover .offerta-shop-image-container {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.offerta-row:hover .offerta-shop-image {
    transform: scale(1.08);
}

/* Colonna negozio */
.offerta-col.negozio {
    display: flex;
    align-items: center;
}

.offerta-shop-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.offerta-shop-logo-wrap {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.offerta-shop-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.25rem;
}

.offerta-shop-logo-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0ecff;
    color: #2563eb;
    font-weight: 800;
}

.offerta-shop-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.offerta-shop-meta strong {
    color: #1e293b;
    font-size: 0.98rem;
    line-height: 1.2;
}

.offerta-shop-meta small,
.offerta-shop-title {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.25;
}

.offerta-shop-title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.offerta-extra-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.offerta-extra-tags span {
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Colonna prezzo */
.offerta-col.prezzo {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.offerta-prezzo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #10b981;
}

.offerta-col.azione {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.offerta-prezzo-originale {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
}

.offerta-promo {
    font-size: 0.8rem;
    color: #f59e0b;
    margin-top: 0.2rem;
    font-weight: 500;
}

/* Colonna spedizione */
.offerta-col.spedizione span,
.offerta-col.spedizione small {
    font-size: 0.95rem;
}

.offerta-col.spedizione small {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* Badge disponibilità */
.disponibilita-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    width: fit-content;
}

.disponibilita-badge.disponibile {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.disponibilita-badge.non-disponibile {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Bottone offerta */
.btn-offerta {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.2);
}

.btn-offerta:hover {
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-offerta i {
    font-size: 0.9rem;
}

/* Nessuna offerta */
.nessuna-offerta {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1.1rem;
    background: #f8fafc;
    border-radius: 12px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .prodotto-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .immagine-principale {
        height: min(360px, 72vw);
    }

    .offerte-header, .offerta-row {
        grid-template-columns: 82px minmax(160px, 1.5fr) minmax(110px, 0.9fr) minmax(105px, 0.85fr) minmax(120px, 0.9fr) 104px;
    }
    
    .offerta-shop-image-container {
        width: 70px;
        height: 70px;
    }
    
    .offerta-prezzo {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .prodotto-container {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .prodotto-titolo {
        font-size: 1.55rem;
        margin-bottom: 1.2rem;
    }

    .prodotto-immagini,
    .info-card,
    .offerte-section {
        border-radius: 14px;
        padding: 1rem;
    }

    .immagine-principale {
        height: min(320px, 76vw);
    }

    .info-titolo,
    .offerte-section h2 {
        font-size: 1.25rem;
    }

    .info-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .info-label {
        width: auto;
    }

    .prezzo-riassunto {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .prezzo-minimo {
        text-align: left;
    }

    .prezzo-valore {
        font-size: 1.65rem;
    }

    .descrizione-header {
        padding: 1.1rem 1rem;
    }

    .descrizione-content {
        padding: 0 1rem;
    }

    .offerte-section {
        padding: 1rem;
    }
    
    .offerte-header {
        display: none;
    }

    .offerta-row {
        grid-template-columns: 64px minmax(0, 1fr) 44px;
        grid-template-areas:
            "immagine negozio azione"
            "immagine prezzo azione"
            "immagine disponibilita azione";
        gap: 0.35rem 0.65rem;
        padding: 0.75rem;
        align-items: center;
    }

    .offerta-col.immagine {
        grid-area: immagine;
        padding: 0;
        align-self: stretch;
    }

    .offerta-col.negozio {
        grid-area: negozio;
    }

    .offerta-col.prezzo {
        grid-area: prezzo;
    }

    .offerta-col.spedizione {
        display: none;
    }

    .offerta-col.disponibilita {
        grid-area: disponibilita;
    }

    .offerta-col.azione {
        grid-area: azione;
        justify-content: center;
    }
    
    .offerta-shop-image-container {
        width: 60px;
        height: 60px;
        border-radius: 9px;
    }

    .offerta-shop-card {
        gap: 0.5rem;
    }

    .offerta-shop-logo-wrap {
        width: 34px;
        min-width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .offerta-shop-meta {
        gap: 0.08rem;
    }

    .offerta-shop-meta strong {
        font-size: 0.88rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .offerta-shop-meta small {
        display: none;
    }

    .offerta-shop-title {
        font-size: 0.72rem;
        -webkit-line-clamp: 1;
    }

    .offerta-extra-tags {
        display: none;
    }
    
    .offerta-prezzo {
        font-size: 1.08rem;
    }

    .offerta-prezzo-originale,
    .offerta-promo {
        font-size: 0.72rem;
    }
    
    .disponibilita-badge {
        padding: 0.25rem 0.55rem;
        font-size: 0.72rem;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .btn-offerta {
        width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
        border-radius: 10px;
        font-size: 0.92rem;
    }

    .btn-offerta span {
        display: none;
    }
}

@media (max-width: 480px) {
    .offerta-row {
        grid-template-columns: 56px minmax(0, 1fr) 38px;
        gap: 0.3rem 0.55rem;
        padding: 0.65rem;
    }
    
    /* Disponibilita compatta su schermi molto piccoli */
    .offerte-header .offerta-col.disponibilita,
    .offerta-row .offerta-col.disponibilita {
        display: block;
    }
    
    .offerta-shop-image-container {
        width: 52px;
        height: 52px;
    }

    .offerta-shop-logo-wrap {
        width: 30px;
        min-width: 30px;
        height: 30px;
    }

    .offerta-shop-title {
        display: none;
    }
    
    .offerta-prezzo {
        font-size: 1rem;
    }

    .disponibilita-badge {
        font-size: 0.68rem;
        padding: 0.22rem 0.45rem;
    }
    
    .btn-offerta {
        width: 38px;
        height: 38px;
        padding: 0;
        font-size: 0.85rem;
    }
    
    .btn-offerta i {
        font-size: 0.8rem;
    }
}
