/**
 * ACF Product Comparison - Styles with Accordion
 * Accordion autonomo con classi prefisso pc-
 */

/* ============================================
   COMPARE BUTTON (singola pagina prodotto)
============================================ */

.compare-button-wrapper {
    margin: 0px 0px!important;
}

.compare-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--e-global-color-5cc728c);
    font-family: "HAAS Grotesk", Sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1rem;
    color: #FFFFFF;
    border-radius: 15px 15px 15px 15px;
    padding: 16px 30px;
    cursor: pointer;
    width: 100%!important;
    border: none!important;
    transition: all 0.3s ease;
    text-decoration: none;
}

.compare-button:hover {
    background: #332b2b;
    color: #FFFFFF;
}

button:focus { outline: 0!important; }

.compare-button.remove-from-compare {
    background-color: #000000;
    border-color: #000000;
}

.compare-button.remove-from-compare:hover {
    opacity: 0.8;
}

/* ============================================
   COMPARE LINK (link "Vedi Comparazione")
============================================ */

.compare-link-wrapper {
    display: inline-block;
}

.compare-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #e30613;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-family: "HAAS Grotesk", helvetica, Sans-Serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.compare-link:hover {
    background: #c00511;
    color: #ffffff;
}

.compare-count {
    background: #ffffff;
    color: #e30613;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.compare-count:empty {
    display: none;
}

/* ============================================
   COMPARISON PAGE - CONTROLS
============================================ */

.product-comparison-wrapper {
    font-family: "HAAS Grotesk", helvetica, Sans-Serif;
    max-width: 1440px!important;
    margin: 0 auto;
    padding: 0px!important;
}

.comparison-controls {
    background: #f9f9f9!important;
    padding: 20px!important;
    border-radius: 10px;
    margin-bottom: 30px;
}

.comparison-selectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.comparison-selector label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95rem;
    text-transform: uppercase;
    color: #000000;
}

.product-selector {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: "HAAS Grotesk", helvetica, Sans-Serif;
    font-size: 1rem;
    background: #ffffff;
    cursor: pointer;
}

.product-selector:focus {
    outline: none;
    border-color: #e30613;
}

.clear-comparison {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--e-global-color-5cc728c);
    font-family: "HAAS Grotesk", Sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1rem;
    color: #FFFFFF;
    border-radius: 10px!important;
    padding: 10px 20px;
    cursor: pointer;
    width: 100%!important;
    border: none!important;
    transition: all 0.3s ease;
    text-decoration: none;
}

.clear-comparison:hover {
    background: #c00511;
    color: #ffffff;
}

/* ============================================
   COMPARISON TABLE CONTAINER
============================================ */

.comparison-table-container {
    position: relative;
}

.comparison-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.comparison-empty-state p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.comparison-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* ============================================
   COMPARISON PRODUCT SECTION
============================================ */

.comparison-product-section {
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.comparison-product-header {
    background: #EFF1F4;
    padding: 20px;
    text-align: center;
    position: relative;
    display: flex;
    aspect-ratio: 1/1;
    border-radius: 20px;
    justify-content: center;
    align-items: center;
}

.cpc-category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #4c4c4c;
    font-family: "HAAS Grotesk", helvetica, Sans-Serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 50px;
    border: 1px solid #4C4C4C;
    line-height: 1;
    z-index: 2;
}

.cpc-category-badge:hover {
    color: #fff;
    background: #4c4c4c;
}

.comparison-product-header .comparison-product-image {
    width: 100%;
    max-width: 80%;
    height: auto;
    object-fit: contain;
    margin: 0 0;
    display: block;
}

.comparison-product-name {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    margin: 0;
}

/* Blocco info sotto immagine */
.cpc-product-info {
    padding-top: 20px;
    background: #ffffff;
}

.cpc-product-name {
    cursor: pointer;
    position: relative;
    font-size: 1.5rem;
    font-weight: 300;
    color: #000000;
    margin: 0;
}

.cpc-product-name:before {
    content: "";
    background: #000;
    position: absolute;
    width: 0%!important;
    height: 2px;
    bottom: -5px;
    left: 0px;
    transition: all 0.3s cubic-bezier(.77,0,.23,1.01);
}
.cpc-product-name:hover:before {
    width: 100%!important;
    transition: all 0.3s cubic-bezier(.77,0,.23,1.01);
    
}

.cpc-product-name-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.cpc-arrow-btn {
    width: 35px;
    height: 35px;
    background: none;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.cpc-arrow-btn > svg {
    transform: scale(1.5);
}


.cpc-arrow-btn-header {
    width: 35px;
    height: 35px;
    background: #4c4c4c;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s ease;
    position: absolute;
    right: 20px;
    top:20px;
}

.cpc-didascalia {
    font-family: "HAAS Grotesk", helvetica, Sans-Serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: #000;
    margin: 0 0 14px;
    line-height: 1.5rem;
}

.cpc-divider {
    border: none;
    border-top: 1px solid #000;
    margin: 10px 0px;
}

.cpc-excerpt {
    font-family: "HAAS Grotesk", helvetica, Sans-Serif;
    font-size: 1rem;
    font-weight: 400;
    color: #4C4C4C;
    line-height: 1.2rem;
    margin: 10px 0px; 
  display: -webkit-box;
  -webkit-line-clamp: 3; /* numero di righe da mostrare */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: pretty!important;
}


/* ============================================
   PC ACCORDION — autonomo, nessuna dipendenza
============================================ */

.pc-accordion-wrapper {
    font-family: "HAAS Grotesk", helvetica, sans-serif;
    width: 100%;
}

/* Item */
.pc-accordion-item {
    border-bottom: 1px solid #000000;
    margin-bottom: 0;
}

.pc-accordion-item:first-child {
    border-top: 1px solid #000000;
}

/* Titolo rosso quando aperto */
.pc-accordion-item.is-open .pc-accordion-title {
    color: #d60816;
}

/* Freccia ruotata quando aperto */
.pc-accordion-item.is-open .pc-accordion-icon {
    transform: rotate(-90deg) scale(2);
}

/* Trigger */
.pc-accordion-trigger {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 0px;
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: "HAAS Grotesk", helvetica, sans-serif;
    text-align: left;
    transition: opacity 0.3s ease;
}

.pc-accordion-trigger:hover {
    opacity: 0.7;
    padding-left: 35px;
}

.pc-accordion-trigger:focus {
    outline: 2px solid #d60816;
    outline-offset: 2px;
    padding-left: 35px;
}

.pc-accordion-trigger:focus:not(:focus-visible) {
    outline: none;
}

/* Titolo */
.pc-accordion-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: #000000;
    text-transform: capitalize;
    transition: color 0.3s ease;
    text-align: left;
    line-height: 1.3;
}

/* Icona — identica al minimal accordion */
.pc-accordion-icon {
    flex-shrink: 0;
    margin-left: 0;
    font-size: 0;
    line-height: 1;
    position: relative;
    transition: transform 0.35s ease;
    transform: scale(2);
}

.pc-accordion-icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

/* Panel */
.pc-accordion-panel {
    overflow: hidden;
}

/* Contenuto */
.pc-accordion-content {
    padding: 20px 30px 30px;
}

.pc-content-row {
    margin-bottom: 10px;
}

.pc-content-row:last-child {
    margin-bottom: 0;
}

.pc-content-label {
    font-size: 1rem;
    font-weight: 300;
    color: #000000;
    margin-bottom: 5px;
    line-height: 1.4;
}

.pc-content-value {
    font-size: 1rem;
    font-weight: 400;
    color: #333333;
    line-height: 1.6;
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 1024px) {
    .comparison-table {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .comparison-selectors {
        grid-template-columns: 1fr;
    }

    .comparison-table {
        grid-template-columns: 1fr;
    }

    .comparison-product-header {
        padding: 30px 20px;
    }

    .comparison-product-name {
        font-size: 1.5rem;
    }

    .comparison-product-header .comparison-product-image {
        max-width: 300px;
    }

    .pc-accordion-trigger {
        font-size: 1.2rem;
        padding: 15px 20px;
    }

    .pc-accordion-title {
        font-size: 1.2rem;
    }

    .pc-accordion-content {
        padding: 0 20px 20px;
    }

    .pc-content-label,
    .pc-content-value {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .comparison-product-header {
        padding: 20px 15px;
    }

    .comparison-product-name {
        font-size: 1.3rem;
    }

    .pc-accordion-trigger {
        padding: 12px 15px;
    }

    .pc-accordion-title {
        font-size: 1rem;
    }
}

/* ============================================
   UTILITIES
============================================ */

.comparison-loading {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #666;
    grid-column: 1 / -1;
}

.comparison-error {
    background: #ffe6e6;
    border: 1px solid #ff4444;
    color: #cc0000;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    grid-column: 1 / -1;
}

/* Notification toast */
.compare-notification {
    position: fixed;
    bottom: 20px!important;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,0.45)!important;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px) !important;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 10px!important;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    font-family: "HAAS Grotesk", helvetica, Sans-Serif;
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 400px;
}

.compare-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.compare-notification-text {
    flex: 1;
    font-size: 1.1rem;
}

.compare-notification-button {
    padding: 10px 20px;
    background: #d60816!important;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: "HAAS Grotesk", helvetica, Sans-Serif;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.compare-notification-button:hover {
    background: #332b2b!important;
    color: #FFFFFF;
}

@media (max-width: 768px) {
    .compare-notification {
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: translateY(20px);
        min-width: auto;
        flex-direction: column;
        gap: 15px;
    }

    .compare-notification.show {
        transform: translateY(0);
    }

    .compare-notification-button {
        width: 100%;
        text-align: center;
    }
}