/* COMPONENTE: PRODUCT CARD - Architettura 2026 v2.0 */
.sm-product-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    height: 100%;
    position: relative;
    border: 1px solid #eaeaea; /* Bordo leggero per delimitare le card bianche */
}

.sm-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* HEADER E BADGES */
.sm-card-header {
    position: relative;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fcfcfc; /* Leggerissimo stacco per l'area immagine */
}

.sm-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}

.sm-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
}

.sm-badge-discount { background-color: #d32f2f; } /* Rosso medicale per gli sconti */
.sm-badge-soldout { background-color: #757575; }

/* Il contenitore fa da cornice quadrata perfetta */
.sm-card-header a.sm-card-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1; 
    background-color: #fff;
    overflow: hidden;
}

/* L'immagine mantiene le sue proporzioni native dentro la cornice */
.sm-card-header a.sm-card-image-link img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain; 
    mix-blend-mode: multiply;
    margin: 0;
    padding: 0;
    
    /* ANTI-EDGE VISUAL SEARCH & DRAG BLOCK */
    pointer-events: none; 
    -webkit-user-drag: none;
    user-select: none;
}

/* BODY E TESTI */
.sm-card-body {
    padding: 1.5rem 1.5rem 0 1.5rem; /* Rimosso il padding inferiore per il Subgrid */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sm-card-category { font-size: 0.75rem; text-transform: uppercase; color: #888; }
.sm-card-title { font-size: 1rem; font-weight: 600; line-height: 1.3; margin: 0; }
.sm-card-title a { color: #222; text-decoration: none; transition: color 0.2s; }
.sm-card-title a:hover { color: #0056b3; }

/* BADGE MEDICO */
.sm-medical-notice {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #2e7d32; /* Verde rassicurante */
    background: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 4px;
}

.sm-card-price { font-size: 1.125rem; font-weight: 700; color: #0056b3; margin-top: auto; }

/* FOOTER E BOTTONE */
.sm-card-footer {
    padding: 1.5rem;
    align-self: end;
}

.sm-btn-cart {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #0056b3;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
}

.sm-btn-cart:hover { background-color: #004494; }
.out-of-stock .sm-btn-cart { background-color: #e0e0e0; color: #757575; pointer-events: none; }



/* ==========================================
   UI CARRELLO APP-STYLE (+ e -)
   ========================================== */
.app-cart-ui { width: 100%; }
.app-active-combo { 
    align-items: center; 
    justify-content: space-between; 
    gap: 10px; 
    width: 100%; 
}
.app-qty-controls { 
    display: flex; 
    align-items: center; 
    background: #f8fafc; 
    border-radius: 6px; 
    overflow: hidden; 
    flex: 1; 
    border: 1px solid #cbd5e1; 
}
.app-minus, .app-plus { 
    background: transparent; 
    border: none; 
    font-size: 22px; 
    color: #0056b3; 
    width: 44px; /* Dimensione perfetta per il tocco da smartphone */
    height: 44px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: background 0.2s; 
}
.app-minus:hover, .app-plus:hover { background: #e2e8f0; }
.app-qty { 
    flex: 1; 
    text-align: center; 
    font-weight: 700; 
    font-size: 16px; 
    color: #0f172a; 
}
.sm-view-cart-btn { 
    background: #0056b3; 
    color: white; 
    text-decoration: none; 
    width: 44px; 
    height: 44px; 
    border-radius: 6px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 18px; 
    transition: background 0.2s; 
    flex-shrink: 0;
}
.sm-view-cart-btn:hover { background: #004494; color: white; }