/**
 * ERREGGI - Product Single Page Styles
 * Mobile-First Approach - BEM Methodology - CSS Variables
 * Performance Optimized
 * 
 * @version 1.0.0
 */

/* ==========================================
   CSS VARIABLES
========================================== */

:root {
    --erreggi-primary: #fcb040;
    --erreggi-primary-dark: #e69e2d;
    --erreggi-secondary: #404040;
    --erreggi-secondary-light: #5a5a5a;
    --erreggi-text-dark: #2c2c2c;
    --erreggi-text-gray: #6a6a6a;
    --erreggi-bg-light: #f9f9f9;
    --erreggi-white: #ffffff;
    --erreggi-border: #ddd;
    
    --erreggi-radius: 8px;
    --erreggi-shadow: 0 5px 20px rgba(0,0,0,0.08);
    --erreggi-transition: all 0.3s ease;
}

/* ==========================================
   BREADCRUMB
========================================== */

.erreggi-breadcrumb {
    padding: 20px 0;
    background: var(--erreggi-bg-light);
}

.erreggi-breadcrumb nav {
    font-size: 0.9rem;
    color: var(--erreggi-text-gray);
}

.erreggi-breadcrumb a {
    color: var(--erreggi-text-gray);
    text-decoration: none;
    transition: color 0.3s;
}

.erreggi-breadcrumb a:hover {
    color: var(--erreggi-primary);
}

.erreggi-breadcrumb .separator {
    margin: 0 10px;
    color: var(--erreggi-border);
}

.erreggi-breadcrumb .current {
    color: var(--erreggi-secondary);
    font-weight: 600;
}

/* ==========================================
   PRODUCT DETAIL SECTION
========================================== */

.product-detail {
    padding: 60px 0;
    background: var(--erreggi-white);
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 80px;
}

/* ==========================================
   PRODUCT GALLERY (Slider)
========================================== */

.product-gallery {
    position: sticky;
    top: 120px;
    background: var(--erreggi-white);
}

.product-slider-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: var(--erreggi-radius);
    background: var(--erreggi-bg-light);
    box-shadow: var(--erreggi-shadow);
}

.product-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.product-slide.active {
    opacity: 1;
    z-index: 2;
}

.product-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Slider Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--erreggi-secondary);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: var(--erreggi-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.slider-btn:hover {
    background-color: var(--erreggi-primary);
    color: var(--erreggi-white);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn:focus {
    outline: 2px solid var(--erreggi-primary);
    outline-offset: 2px;
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--erreggi-transition);
    border: 2px solid transparent;
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.dot.active {
    background-color: var(--erreggi-primary);
    border-color: var(--erreggi-white);
}

/* ==========================================
   PRODUCT INFO
========================================== */

.product-info {
    max-width: 600px;
}

.product-category-badge {
    display: inline-block;
    background: var(--erreggi-primary);
    color: var(--erreggi-white);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.product-title {
    font-size: 2.5rem;
    color: var(--erreggi-secondary);
    margin-bottom: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.product-subtitle {
    font-size: 1.3rem;
    color: var(--erreggi-text-gray);
    margin-bottom: 20px;
    font-weight: 400;
    line-height: 1.4;
}

.product-brief-description {
    color: var(--erreggi-text-gray);
    line-height: 1.7;
    margin-bottom: 30px;
}

/* ==========================================
   TRUST BADGES
========================================== */

.trust-badges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.trust-badge {
    padding: 20px;
    background: var(--erreggi-bg-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--erreggi-transition);
}

.trust-badge:hover {
    background: #fff;
    box-shadow: 0 5px 15px rgba(252, 176, 64, 0.15);
    transform: translateY(-2px);
}

.trust-badge i {
    color: var(--erreggi-primary);
    font-size: 2rem;
    flex-shrink: 0;
}

.trust-badge-content h4 {
    font-weight: 700;
    color: var(--erreggi-secondary);
    margin-bottom: 3px;
    font-size: 1.05rem;
}

.trust-badge-content p {
    font-size: 0.9rem;
    color: var(--erreggi-text-gray);
    margin: 0;
}

/* ==========================================
   CTA BOX
========================================== */

.cta-box {
    background: var(--erreggi-white);
    border: 2px solid var(--erreggi-primary);
    border-radius: var(--erreggi-radius);
    padding: 30px;
    margin-top: 30px;
}

.cta-box h3 {
    color: var(--erreggi-secondary);
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
}

.cta-buttons {
    display: grid;
    gap: 15px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.cta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cta-contact-info {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--erreggi-border);
}

.cta-title {
    font-size: 0.9rem;
    color: var(--erreggi-text-gray);
    margin-bottom: 10px;
}

.cta-title i {
    color: var(--erreggi-primary);
}

.cta-phones {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.cta-phones a {
    color: var(--erreggi-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.cta-phones a:hover {
    color: var(--erreggi-primary-dark);
}

.cta-hours {
    font-size: 0.85rem;
    color: var(--erreggi-text-gray);
    margin: 0;
}

/* ==========================================
   PRODUCT TABS
========================================== */

.product-tabs {
    margin-top: 60px;
    background: var(--erreggi-white);
}

.tabs-header {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--erreggi-bg-light);
    margin-bottom: 40px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.tabs-header::-webkit-scrollbar {
    height: 4px;
}

.tabs-header::-webkit-scrollbar-track {
    background: var(--erreggi-bg-light);
}

.tabs-header::-webkit-scrollbar-thumb {
    background: var(--erreggi-primary);
    border-radius: 2px;
}

.tab-button {
    padding: 15px 25px;
    background: transparent;
    border: none;
    color: var(--erreggi-text-gray);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: var(--erreggi-transition);
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
}

.tab-button:hover {
    color: var(--erreggi-secondary);
}

.tab-button.active {
    color: var(--erreggi-secondary);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--erreggi-primary);
}

.tab-button:focus {
    outline: 2px solid var(--erreggi-primary);
    outline-offset: -2px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-content h2 {
    color: var(--erreggi-secondary);
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 800;
}

.tab-content h3 {
    color: var(--erreggi-primary);
    margin: 30px 0 20px;
    font-size: 1.3rem;
    font-weight: 700;
}

.tab-content h3 i {
    margin-right: 10px;
}

.tab-text-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--erreggi-text-gray);
    margin-bottom: 30px;
}

/* ==========================================
   HIGHLIGHTS BOX
========================================== */

.highlights-box {
    background: var(--erreggi-bg-light);
    padding: 30px;
    border-radius: var(--erreggi-radius);
    margin-top: 30px;
    border-left: 4px solid var(--erreggi-primary);
}

.highlights-box h3 {
    color: var(--erreggi-secondary);
    margin: 0 0 20px 0;
    font-size: 1.2rem;
}

.highlights-box h3 i {
    color: var(--erreggi-primary);
}

.highlights-box ul {
    line-height: 2;
    color: var(--erreggi-text-gray);
    padding-left: 20px;
    margin: 0;
}

.highlights-box li {
    margin-bottom: 10px;
}

.highlights-box strong {
    color: var(--erreggi-secondary);
}

/* ==========================================
   SPECS TABLE
========================================== */

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.specs-table tr.even {
    background: var(--erreggi-bg-light);
}

.specs-table td {
    padding: 15px;
    border: 1px solid var(--erreggi-border);
}

.spec-label {
    font-weight: 700;
    color: var(--erreggi-secondary);
    width: 30%;
}

.spec-value {
    color: var(--erreggi-text-gray);
}

.spec-value strong {
    color: var(--erreggi-secondary);
}

/* ==========================================
   FEATURES GRID
========================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.feature-item i {
    color: var(--erreggi-primary);
    font-size: 2rem;
    margin-top: 5px;
    flex-shrink: 0;
}

.feature-item h4 {
    color: var(--erreggi-secondary);
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.feature-item p {
    color: var(--erreggi-text-gray);
    line-height: 1.6;
    margin: 0;
}

/* ==========================================
   CONSIGLIO ESPERTO
========================================== */

.consiglio-esperto {
    background: #fcf3e8;
    padding: 30px;
    border-radius: var(--erreggi-radius);
    margin-top: 40px;
    border-left: 4px solid var(--erreggi-primary);
}

.consiglio-esperto h3 {
    color: var(--erreggi-secondary);
    margin: 0 0 15px 0;
    font-size: 1.2rem;
}

.consiglio-esperto h3 i {
    color: var(--erreggi-primary);
}

.consiglio-esperto p {
    line-height: 1.8;
    color: var(--erreggi-text-gray);
    margin: 0;
}

/* ==========================================
   RELATED PRODUCTS
========================================== */

.related-products {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid var(--erreggi-bg-light);
}

.related-products h2 {
    text-align: center;
    font-size: 2.2rem;
    color: var(--erreggi-secondary);
    margin-bottom: 50px;
    font-weight: 800;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    background: var(--erreggi-white);
    border-radius: var(--erreggi-radius);
    overflow: hidden;
    box-shadow: var(--erreggi-shadow);
    transition: var(--erreggi-transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card-image {
    height: 250px;
    overflow: hidden;
    background: var(--erreggi-bg-light);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-card-image img {
    transform: scale(1.1);
}

.product-card-content {
    padding: 25px;
}

.product-card-content h3 {
    color: var(--erreggi-secondary);
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.product-card-content p {
    color: var(--erreggi-text-gray);
    margin-bottom: 15px;
    line-height: 1.6;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* ==========================================
   RESPONSIVE - TABLET
========================================== */

@media (max-width: 1024px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .product-gallery {
        position: relative;
        top: 0;
    }
    
    .product-info {
        max-width: 100%;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   RESPONSIVE - MOBILE
========================================== */

@media (max-width: 768px) {
    .product-detail {
        padding: 40px 0;
    }
    
    .product-slider-container {
        height: 350px;
    }
    
    .slider-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .product-title {
        font-size: 1.8rem;
    }
    
    .product-subtitle {
        font-size: 1.1rem;
    }
    
    .trust-badges {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cta-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-header {
        gap: 5px;
    }
    
    .tab-button {
        padding: 12px 18px;
        font-size: 0.9rem;
    }
    
    .tab-content h2 {
        font-size: 1.6rem;
    }
    
    .specs-table {
        font-size: 0.9rem;
    }
    
    .spec-label {
        width: 40%;
    }
    
    .features-grid {
        gap: 20px;
    }
    
    .feature-item i {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .related-products {
        margin-top: 50px;
    }
    
    .product-card-image {
        height: 200px;
    }
}