/* Farm3Design Products CSS - Stili combinati con sistema comunicazione Pizza Lorenzo */

.farm3-products-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f8f8;
    color: #333;
    display: flex;
    flex-direction: column;
    max-width: 80rem;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem;
}

@media (min-width: 768px) {
    .farm3-products-container {
        flex-direction: row;
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .farm3-products-container {
        padding: 2rem 2rem;
    }
}

/* === SIDEBAR DESKTOP === */
.farm3-sidebar {
    display: none;
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-right: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

@media (min-width: 768px) {
    .farm3-sidebar {
        display: block;
        width: 20%;
        padding: 1.5rem;
        margin-right: 2rem;
        margin-bottom: 0;
    }
}

@media (min-width: 1024px) {
    .farm3-sidebar {
        width: 25%;
    }
}

.farm3-sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.farm3-sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.farm3-sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    border-radius: 0.375rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
}

.farm3-sidebar-item i {
    margin: 0 0 0.5rem 0;
    font-size: 20px;
    text-align: center;
    flex-shrink: 0;
    color: #6b7280;
}

.farm3-sidebar-item span {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* Counter rimosso - non più utilizzato */

.farm3-sidebar-item:hover:not(.active) {
    background-color: #f3f4f6;
    color: #111827;
    border-color: #e5e7eb;
    transform: translateX(2px);
}

.farm3-sidebar-item:hover:not(.active) i {
    color: #374151;
    transform: scale(1.1);
}

.farm3-sidebar-item.active {
    background-color: #2563eb;
    color: white;
    font-weight: 600;
    border-color: #1d4ed8;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.farm3-sidebar-item.active i {
    color: white;
}

/* Counter active state rimosso - non più utilizzato */

/* === MOBILE TABS === */
.farm3-mobile-tabs {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.farm3-mobile-tabs::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .farm3-mobile-tabs {
        display: none;
    }
}

.farm3-topic-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #374151;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.farm3-topic-tab i {
    font-size: 14px;
    color: #6b7280;
}

.farm3-topic-tab:hover:not(.active) {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.farm3-topic-tab.active {
    background-color: #2563eb;
    border-color: #1d4ed8;
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.farm3-topic-tab.active i {
    color: white;
}

/* === MAIN CONTENT === */
.farm3-main-content {
    flex: 1;
    min-width: 0;
}

/* === LOADING === */
.farm3-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.farm3-loading.hidden {
    display: none;
}

.farm3-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === PRODUCTS GRID === */
.farm3-products-wrapper h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.farm3-products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .farm3-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .farm3-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.farm3-product-card {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    cursor: pointer;
}

.farm3-product-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.farm3-product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.farm3-product-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.farm3-product-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.farm3-price {
    font-size: 1.125rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 1rem;
}

.farm3-price.on-sale {
    color: #dc2626;
}

.farm3-product-card button {
    width: 100%;
    padding: 0.75rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.farm3-product-card button:hover {
    background-color: #1d4ed8;
}

/* === ERROR STATE === */
.farm3-products-error {
    text-align: center;
    padding: 3rem 1rem;
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
}

.farm3-no-products {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

/* === MODAL === */
.farm3-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.farm3-modal.show {
    display: flex;
}

.farm3-modal-content {
    background-color: white;
    border-radius: 0.5rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.farm3-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.farm3-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.farm3-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.farm3-modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.farm3-modal-body {
    padding: 1.5rem;
}

.farm3-modal-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.farm3-modal-loading .farm3-spinner {
    margin-bottom: 1rem;
}

/* === MODAL CONTENT === */
.farm3-modal-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

.farm3-modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 1.5rem;
}

.farm3-modal-price.on-sale {
    color: #dc2626;
}

.farm3-modal-description,
.farm3-modal-full-description {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.farm3-modal-section {
    margin-bottom: 1.5rem;
}

.farm3-modal-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.farm3-specs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .farm3-specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.farm3-spec-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.farm3-spec-item i {
    color: #2563eb;
    width: 20px;
    text-align: center;
}

.farm3-variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.farm3-variant-tag {
    background-color: #eff6ff;
    color: #1e40af;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    border: 1px solid #dbeafe;
}

/* === MODAL ACTIONS === */
.farm3-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.farm3-modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}

.farm3-modal-btn-primary {
    background-color: #2563eb;
    color: white;
    flex: 1;
    min-width: 200px;
    justify-content: center;
}

.farm3-modal-btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.farm3-modal-btn-whatsapp {
    background-color: #25d366;
    color: white;
    width: 48px;
    height: 48px;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
}

.farm3-modal-btn-whatsapp:hover {
    background-color: #20ba5a;
    transform: scale(1.05);
}

/* === CSS GALLERY (per più immagini) === */
.farm3-css-gallery {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.farm3-gallery-radio {
    display: none;
}

.farm3-gallery-img {
    display: none;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.farm3-gallery-radio:checked + .farm3-gallery-img {
    display: block;
}

.farm3-css-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
}

.farm3-css-dots {
    display: flex;
    gap: 0.5rem;
}

.farm3-css-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.farm3-css-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.farm3-gallery-radio:checked + .farm3-gallery-img ~ .farm3-css-controls .farm3-css-dot[for] {
    background-color: white;
    transform: scale(1.2);
}

/* === BODY MODAL OPEN === */
body.modal-open {
    overflow: hidden;
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 640px) {
    .farm3-modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100%;
    }
    
    .farm3-modal-actions {
        flex-direction: column;
    }
    
    .farm3-modal-btn-primary {
        min-width: auto;
    }
    
    .farm3-specs-grid {
        grid-template-columns: 1fr;
    }
}