/* ==================== VARIABILI CSS ==================== */
:root {
    /* Colori principali */
    --primary-color: #6c757d;
    --secondary-color: #495057;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #212529;
    --text-light: #6c757d;
    --white: #ffffff;
    
    /* Effetti visivi */
    --shadow: 0 20px 40px rgba(0,0,0,0.08);
    --transition: all 0.3s ease-in-out;
    --border-radius: 8px;
    
    /* Colori di stato */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

/* ==================== STILE BASE ==================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background: #f5f5f5;
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==================== COMPONENTI GENERALI ==================== */

/* Barra di ricerca */
.search-bar {
    background: var(--white);
    padding: 1rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    outline: none;
}

.search-bar button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    background: var(--secondary-color);
}

/* Breadcrumb di navigazione */
.breadcrumb {
    background: rgba(255,255,255,0.9);
    padding: 12px 20px;
    border-radius: 50px;
    margin-bottom: 2rem;
    display: inline-flex;
    box-shadow: var(--shadow);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-light);
}

/* Badge stato prodotto */
.product-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-left: 1rem;
    vertical-align: middle;
}

.status-new {
    background-color: var(--success-color);
    color: white;
}

.status-used {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.status-discontinued {
    background-color: var(--danger-color);
    color: white;
}

/* Bottoni base */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-secondary {
    background: var(--white);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--light-color);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Sezioni della pagina */
.section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.05);
}

/* Titoli sezione */
.section-title {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* ==================== LAYOUT PAGINA PRODOTTO ==================== */
.product-page {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.product-title {
    font-size: 2rem;
    margin: 0;
}

.product-sku {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Gallery prodotto */
.product-gallery {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
}

.thumbnail-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.thumbnail {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

.thumbnail.active {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(108,117,125,0.3);
}

.thumbnail:hover {
    border-color: var(--primary-color);
}

.main-image-container {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Lente di zoom */
.zoom-lens {
    position: absolute;
    border: 1px solid #d4d4d4;
    width: 150px;
    height: 150px;
    background-repeat: no-repeat;
    display: none;
    pointer-events: none;
}

/* Dettagli prodotto */
.product-details {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
}

.product-info {
    display: flex;
    flex-direction: column;
}

.product-price-container {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.product-price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
    margin: 0 0 0.5rem;
}

.product-availability {
    color: var(--success-color);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.product-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.product-features {
    margin-bottom: 2rem;
}

.feature-list {
    columns: 2;
    column-gap: 2rem;
}

.feature-item {
    margin-bottom: 0.75rem;
    break-inside: avoid;
}

/* Stelle rating */
.stars {
    color: #ffc107;
    font-size: 1.2rem;
}

/* Tabella specifiche tecniche */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr:nth-child(even) {
    background-color: var(--light-color);
}

.specs-table th,
.specs-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.specs-table th {
    width: 30%;
    color: var(--text-light);
    font-weight: normal;
}

/* Stili per i gruppi collassabili */
.spec-group {
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.spec-group-header {
    background: linear-gradient(135deg, #e8f0f5 0%, #d4e4ed 100%) !important;
    color: #495057 !important;
    padding: 0.65rem 1.5rem !important;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem !important;
    transition: all 0.3s ease;
    user-select: none;
}

.spec-group-header:hover {
    background: linear-gradient(135deg, #d4e4ed 0%, #c0d6e3 100%) !important;
}
.spec-group-header .icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.spec-group-header.collapsed .icon {
    transform: rotate(-90deg);
}

.spec-group-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.spec-group-content.collapsed {
    max-height: 0;
}

.spec-group table {
    width: 100%;
    border-collapse: collapse;
}

.spec-group table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.spec-group table th,
.spec-group table td {
    padding: 0.4rem 1.5rem !important;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
}

.spec-group table th {
    width: 35%;
    color: #343a40;
    font-weight: bold;
    font-size: 1rem !important;
    line-height: 1.3 !important;
}

.spec-group table td {
    color: #212529;
    font-weight: 400;
    font-size: 1rem !important;
    line-height: 1.3 !important;
}

.spec-group table tr:last-child th,
.spec-group table tr:last-child td {
    border-bottom: none;
}

/* Badge per evidenziare caratteristiche speciali */
.spec-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
}

.spec-badge-yes {
    background: #d4edda;
    color: #155724;
}

.spec-badge-no {
    background: #f8d7da;
    color: #721c24;
}

.spec-badge-pro {
    background: #fff3cd;
    color: #856404;
}

/* Griglia accessori */
.accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.accessory-card {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
    text-align: center;
}

.accessory-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.accessory-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.accessory-title {
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.accessory-price {
    font-weight: bold;
    color: var(--dark-color);
}

/* Container media (guide/video) */
.media-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.media-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.media-card:hover {
    transform: translateY(-5px);
}

.media-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.media-content {
    padding: 1rem;
    background: var(--white);
}

.media-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.media-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Recensioni */
.review {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.review:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: bold;
}

.review-date {
    color: var(--text-light);
    font-size: 0.85rem;
}

.review-rating {
    color: #ffc107;
    margin-bottom: 0.5rem;
}

/* Barra comparatore (fissa in basso) */
.comparator-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(100%);
    transition: var(--transition);
    z-index: 1000;
}

.comparator-bar.visible {
    transform: translateY(0);
}

.comparator-products {
    display: flex;
    gap: 1rem;
}

.comparator-product {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparator-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
}

/* ==================== MEDIA QUERIES (RESPONSIVE) ==================== */
@media (max-width: 1200px) {
    .product-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .feature-list {
        columns: 1;
    }
}

@media (max-width: 768px) {
    .product-gallery {
        grid-template-columns: 1fr;
    }

    .thumbnail-container {
        flex-direction: row;
        order: 2;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .thumbnail {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .main-image-container {
        height: 400px;
        order: 1;
    }

    .product-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .product-header {
        flex-direction: column;
        gap: 1rem;
    }

    .main-image-container {
        height: 300px;
    }

    .section {
        padding: 1.5rem;
    }
}
/* ==================== AGGIUNTA — LAYOUT PRODOTTO ==================== */

.product-page {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    overflow: hidden;
}

/* Gallery: colonna sinistra grande */
.product-gallery {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.75rem;
    padding: 2rem;
    background: #f8f9fa;
    border-right: 1px solid rgba(0,0,0,0.06);
    align-items: start;
}

/* Colonna destra: info compatta — larghezza fissa 320px */
.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Prezzo: sfondo grigio chiaro, bordo arrotondato */
.product-price-container {
    background: var(--light-color);
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.06);
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

/* Feature list: una colonna su scheda prodotto */
.product-features .feature-list {
    columns: 1;
    padding-left: 1.25rem;
}

.product-features h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feature-item {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

/* ==================== RESPONSIVE PRODUCT-PAGE ==================== */

/* Tablet: gallery sopra, info sotto */
@media (max-width: 900px) {
    .product-page {
        grid-template-columns: 1fr;
    }

    .product-gallery {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }
}

/* Mobile: gallery senza miniature laterali */
@media (max-width: 576px) {
    .product-gallery {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .thumbnail-container {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .product-info {
        padding: 1rem;
    }
}

/* ==================== SPEC NOTE (Tab 2 descrizioni aggiuntive) ==================== */
.spec-note {
    padding: 0.85rem 1.5rem;
    background: #fffbea;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #495057;
}

/* ==================== MATERIALI (Tab 3 guide e video) ==================== */
.materiali-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.materiale-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    gap: 1rem;
}

.materiale-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.materiale-titolo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.materiale-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.materiale-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    align-self: flex-start;
}

.materiale-badge-video { background: #fde8e8; color: #dc3545; }
.materiale-badge-pdf   { background: #e8f0ff; color: #0056b3; }
.materiale-badge-link  { background: #e8f9f0; color: #28a745; }

.materiale-btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--white);
    transition: var(--transition);
}

.materiale-btn-video { background: #dc3545; }
.materiale-btn-video:hover { background: #c82333; }
.materiale-btn-pdf   { background: #0056b3; }
.materiale-btn-pdf:hover { background: #004494; }
.materiale-btn-link  { background: #28a745; }
.materiale-btn-link:hover { background: #218838; }

.materiali-footer {
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: right;
    margin: 0.5rem 0 0;
}

.materiali-vuoti {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
}
