/* ==========================================================================
   E-Commerce Shop — Catalogo Pubblico (Fase 2)
   Glass Ultra 3D — BEM
   Breakpoints: 320px / 768px / 1024px
   ========================================================================== */

/* --- Shop Layout --- */
.shop {
    padding: 2rem 1rem 4rem;
    min-height: 60vh;
}

.shop__container {
    max-width: var(--ec-max-width, 1200px);
    margin: 0 auto;
}

.shop__title {
    font-family: var(--ec-font-heading);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--ec-color-primary);
}

/* --- Breadcrumb --- */
.shop__breadcrumb,
.prodotto__breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ec-color-text-light);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.shop__breadcrumb a,
.prodotto__breadcrumb a {
    color: var(--ec-color-text-light);
    text-decoration: none;
    transition: color var(--ec-transition);
}

.shop__breadcrumb a:hover,
.prodotto__breadcrumb a:hover {
    color: var(--ec-color-accent);
}

.shop__breadcrumb-sep,
.prodotto__breadcrumb-sep {
    opacity: 0.4;
}

/* --- Layout 2 colonne (sidebar + content) --- */
.shop__layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: start;
}

/* --- Sidebar Filtri --- */
.shop__sidebar {
    position: sticky;
    top: 100px;
}

.shop__filter-group {
    margin-bottom: 1.5rem;
}

.shop__filter-title {
    font-family: var(--ec-font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--ec-color-primary);
}

.shop__filter-list {
    list-style: none;
}

.shop__filter-list li {
    margin-bottom: 0.25rem;
}

.shop__filter-link {
    display: block;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    color: var(--ec-color-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--ec-transition);
}

.shop__filter-link:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--ec-color-accent);
}

.shop__filter-link--active {
    background: rgba(255, 255, 255, 0.8);
    color: var(--ec-color-accent);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shop__filter-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    font-family: var(--ec-font-body);
    font-size: 0.9rem;
    color: var(--ec-color-text);
    cursor: pointer;
    transition: border-color var(--ec-transition);
}

.shop__filter-select:focus {
    outline: none;
    border-color: var(--ec-color-accent);
}

/* --- Toolbar --- */
.shop__toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.shop__search {
    display: flex;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: border-color var(--ec-transition);
}

.shop__search:focus-within {
    border-color: var(--ec-color-accent);
}

.shop__search-input {
    flex: 1;
    border: none;
    padding: 0.6rem 1rem;
    background: transparent;
    font-family: var(--ec-font-body);
    font-size: 0.9rem;
    color: var(--ec-color-text);
}

.shop__search-input:focus {
    outline: none;
}

.shop__search-btn {
    border: none;
    background: transparent;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    color: var(--ec-color-text-light);
    transition: color var(--ec-transition);
}

.shop__search-btn:hover {
    color: var(--ec-color-accent);
}

.shop__filter-toggle {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-family: var(--ec-font-body);
    font-size: 0.85rem;
    color: var(--ec-color-text);
}

.shop__count {
    font-size: 0.85rem;
    color: var(--ec-color-text-light);
    margin-left: auto;
}

/* --- Griglia Prodotti --- */
.shop__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.shop__grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

/* --- Card Prodotto --- */
.shop__card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--ec-color-text);
    border-radius: var(--ec-radius-sm);
    overflow: hidden;
    transition: transform var(--ec-transition), box-shadow var(--ec-transition);
    cursor: pointer;
}

.shop__card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.05);
}

.shop__card-img-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
}

.shop__card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.shop__card:hover .shop__card-img {
    transform: scale(1.05);
}

.shop__card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    color: #ccc;
}

.shop__card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.shop__card-badge--evidenza {
    background: var(--ec-color-accent);
    color: #fff;
}

.shop__card-badge--esaurito {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

.shop__card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shop__card-category {
    font-size: 0.75rem;
    color: var(--ec-color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shop__card-title {
    font-family: var(--ec-font-heading);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ec-color-primary);
}

.shop__card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ec-color-accent);
    margin-top: 0.25rem;
}

.shop__card-iva {
    font-size: 0.7rem;
    color: var(--ec-color-text-light);
}

/* --- Load More --- */
.shop__load-more {
    text-align: center;
    margin-top: 2rem;
}

.shop__load-more-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    cursor: pointer;
    font-family: var(--ec-font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ec-color-primary);
    transition: all var(--ec-transition);
}

.shop__load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* --- Empty State --- */
.shop__empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--ec-color-text-light);
}

.shop__empty svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.shop__empty-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--ec-color-accent);
    text-decoration: underline;
}

/* ==========================================================================
   Pagina Dettaglio Prodotto
   ========================================================================== */

.prodotto {
    padding: 2rem 1rem 4rem;
}

.prodotto__container {
    max-width: var(--ec-max-width, 1200px);
    margin: 0 auto;
}

.prodotto__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* --- Galleria --- */
.prodotto__gallery-main {
    border-radius: var(--ec-radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: #f5f5f5;
    cursor: zoom-in;
}

.prodotto__gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.prodotto__gallery-main:hover .prodotto__gallery-img {
    transform: scale(1.1);
}

.prodotto__gallery-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.prodotto__gallery-thumbs {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    overflow-x: auto;
}

.prodotto__gallery-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: none;
    padding: 0;
    transition: border-color var(--ec-transition);
}

.prodotto__gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prodotto__gallery-thumb--active,
.prodotto__gallery-thumb:hover {
    border-color: var(--ec-color-accent);
}

/* --- Info Prodotto --- */
.prodotto__info {
    padding: 2rem;
}

.prodotto__category {
    font-size: 0.8rem;
    color: var(--ec-color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prodotto__title {
    font-family: var(--ec-font-heading);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--ec-color-primary);
    margin: 0.5rem 0 1rem;
    line-height: 1.2;
}

.prodotto__price-block {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.prodotto__price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ec-color-accent);
}

.prodotto__price-iva {
    font-size: 0.8rem;
    color: var(--ec-color-text-light);
}

/* --- Disponibilita --- */
.prodotto__availability {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.prodotto__availability--ok {
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
}

.prodotto__availability--esaurito {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

/* --- Quantita --- */
.prodotto__qty-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.prodotto__qty-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.prodotto__qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    overflow: hidden;
}

.prodotto__qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ec-color-text);
    transition: background var(--ec-transition);
}

.prodotto__qty-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.prodotto__qty-input {
    width: 48px;
    height: 36px;
    border: none;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
    font-family: var(--ec-font-body);
    font-size: 0.95rem;
    font-weight: 600;
    background: transparent;
    -moz-appearance: textfield;
}

.prodotto__qty-input::-webkit-outer-spin-button,
.prodotto__qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- Bottone Aggiungi Carrello --- */
.prodotto__add-cart {
    display: block;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: var(--ec-color-accent);
    color: #fff;
    font-family: var(--ec-font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--ec-transition);
    margin-bottom: 1.5rem;
}

.prodotto__add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 169, 110, 0.3);
}

.prodotto__add-cart--disabled {
    background: #ccc;
    cursor: not-allowed;
}

.prodotto__add-cart--disabled:hover {
    transform: none;
    box-shadow: none;
}

/* --- Trust Icons --- */
.prodotto__trust {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 1.25rem;
}

.prodotto__trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ec-color-text-light);
}

.prodotto__trust-item svg {
    color: var(--ec-color-accent);
    flex-shrink: 0;
}

/* --- Accordion --- */
.prodotto__accordion {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.prodotto__accordion:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.prodotto__accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 0;
    border: none;
    background: transparent;
    font-family: var(--ec-font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ec-color-primary);
    cursor: pointer;
}

.prodotto__accordion-toggle svg {
    transition: transform var(--ec-transition);
}

.prodotto__accordion-toggle--open svg {
    transform: rotate(180deg);
}

.prodotto__accordion-body {
    display: none;
    padding-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--ec-color-text);
}

.prodotto__accordion-body--open {
    display: block;
}

/* --- Prodotti Correlati --- */
.prodotto__correlati {
    margin-top: 4rem;
}

.prodotto__correlati-title {
    font-family: var(--ec-font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ec-color-primary);
    margin-bottom: 1.5rem;
}

/* --- Dark Theme (macrofamiglia scura) --- */
.shop--dark {
    color: #f0f0f0;
}

.shop--dark .shop__title,
.shop--dark .shop__filter-title {
    color: #fff;
}

.shop--dark .shop__filter-link {
    color: #ddd;
}

.shop--dark .shop__filter-link:hover,
.shop--dark .shop__filter-link--active {
    color: var(--ec-tema-accento, var(--ec-color-accent));
    background: rgba(255, 255, 255, 0.1);
}

.shop--dark .shop__card-title {
    color: #fff;
}

.shop--dark .shop__breadcrumb,
.shop--dark .shop__breadcrumb a {
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .shop__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop__grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .prodotto__layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .shop__layout {
        grid-template-columns: 1fr;
    }

    .shop__sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        z-index: 1000;
        padding: 2rem;
        overflow-y: auto;
    }

    .shop__sidebar--open {
        display: block;
    }

    .shop__filter-toggle {
        display: flex;
    }

    .shop__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .shop__grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop__card-body {
        padding: 0.75rem;
    }

    .shop__card-title {
        font-size: 0.9rem;
    }

    .shop__card-price {
        font-size: 1rem;
    }

    .prodotto__info {
        padding: 1.25rem;
    }

    .prodotto__title {
        font-size: 1.4rem;
    }

    .prodotto__price {
        font-size: 1.5rem;
    }

    .prodotto__add-cart {
        position: sticky;
        bottom: 1rem;
        z-index: 10;
    }

    .prodotto__gallery-thumbs {
        gap: 0.5rem;
    }

    .prodotto__gallery-thumb {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .shop__title {
        font-size: 1.5rem;
    }

    .shop__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .shop__search {
        max-width: none;
    }

    .shop__count {
        margin-left: 0;
        text-align: right;
    }
}
