/* Product Cards */
.product-card {
    position: relative;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,.15) !important;
}

.product-img-wrapper {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-card:hover .product-img {
    transform: scale(1.1);
}

/* Badge Promo e Novità */
.badge-promo,
.badge-new {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.badge-promo {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.badge-new {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    top: 45px;
}

/* Price Tag */
.price-tag {
    padding: 0.5rem 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
}

/* Quantity Selector */
.quantity-selector {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
}

.quantity-selector .input-group {
    max-width: 140px;
    margin: 0 auto;
}

.qty-input {
    border-left: none;
    border-right: none;
    font-weight: 600;
}

.qty-input:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

/* Add to Cart Button */
.add-to-cart-btn {
    position: relative;
    overflow: hidden;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-to-cart-btn .btn-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.add-to-cart-btn:hover .btn-icon {
    transform: scale(1.2);
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

/* Sticky Cart Button */
.sticky-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background: linear-gradient(135deg, #c5d81b, #9fb312);
    color: #0b0b0b;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(197,216,27,.4);
    transition: all 0.3s ease;
}

.sticky-cart-btn:hover {
    background: linear-gradient(135deg, #d4e521, #b3c71a);
    color: #0b0b0b;
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(197,216,27,.6);
}

#sticky-cart-count {
    display: inline-block;
    background: #fff;
    color: #c5d81b;
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-img {
    height: 250px;
    border-radius: 12px 12px 0 0;
}

.skeleton-text {
    height: 20px;
    margin-bottom: 10px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
    color: #c5d81b;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #c5d81b;
}

.breadcrumb-item.active {
    color: #0b0b0b;
    font-weight: 600;
}

/* Search autocomplete */
.search-container {
    position: relative;
    min-width: 300px;
}

.search-dropdown {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    width: 90%;
    max-width: 600px;
}

.autocomplete-list {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    background: white;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,.25);
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
}

[data-bs-theme="dark"] .autocomplete-list,
body[data-bs-theme="dark"] .autocomplete-list {
    background: #1a1a1a;
    box-shadow: 0 1rem 3rem rgba(0,0,0,.5);
}

.autocomplete-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 1.05rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0.5rem;
    border-radius: 0.75rem;
}

.autocomplete-item::before {
    content: "🔍";
    font-size: 1.2rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.autocomplete-item::after {
    content: "→";
    position: absolute;
    right: 1.5rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

[data-bs-theme="dark"] .autocomplete-item,
body[data-bs-theme="dark"] .autocomplete-item {
    color: #f8f9fa;
}

.autocomplete-item:hover {
    background: linear-gradient(135deg, #c5d81b, #b3c71a);
    color: #0b0b0b;
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 4px 12px rgba(197, 216, 27, 0.3);
}

.autocomplete-item:hover::before {
    opacity: 1;
    transform: scale(1.2);
}

.autocomplete-item:hover::after {
    opacity: 1;
    transform: translateX(0);
}

[data-bs-theme="dark"] .autocomplete-item:hover,
body[data-bs-theme="dark"] .autocomplete-item:hover {
    background: linear-gradient(135deg, #c5d81b, #b3c71a);
    color: #0b0b0b;
}

.autocomplete-item.text-muted {
    font-weight: 400;
    font-size: 0.95rem;
    cursor: default;
    opacity: 0.6;
}

.autocomplete-item.text-muted:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

.autocomplete-item.text-muted::before {
    content: "ℹ️";
}

.autocomplete-item.text-muted::after {
    display: none;
}

/* Overlay per chiudere dropdown */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: rgba(0,0,0,0.3);
}

/* Contact cards */
.contact-card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,.15) !important;
}

.contact-icon {
    font-size: 4rem;
    line-height: 1;
}

/* Card prodotti carrello */
#elenco .list-group-item {
    transition: all 0.2s ease;
}

#elenco .list-group-item:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,.1);
    transform: translateX(2px);
}

/* Quantità selector nel carrello */
#elenco .input-group-sm {
    flex-wrap: nowrap;
}

#elenco .input-group-sm .form-control {
    max-width: 60px;
    min-width: 60px;
    font-weight: 600;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    text-align: center;
}

/* Rimuovi spinner nativi input number */
#elenco .input-group-sm .form-control::-webkit-outer-spin-button,
#elenco .input-group-sm .form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#elenco .input-group-sm .form-control[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

#elenco .input-group-sm .btn {
    padding: 0.25rem 0.5rem;
    min-width: 32px;
    flex-shrink: 0;
}

/* Totale ordine card */
.card.bg-light {
    border: 2px solid #c5d81b;
}

[data-bs-theme="dark"] .card.bg-light,
body[data-bs-theme="dark"] .card.bg-light {
    background-color: #2c2c2c !important;
    border-color: #c5d81b;
}

[data-bs-theme="dark"] .card.bg-light h5,
[data-bs-theme="dark"] .card.bg-light h4,
body[data-bs-theme="dark"] .card.bg-light h5,
body[data-bs-theme="dark"] .card.bg-light h4 {
    color: #f8f9fa !important;
}

/* Responsive */
@media (max-width: 768px) {
    .product-img-wrapper {
        height: 200px;
    }
    
    .sticky-cart-btn {
        bottom: 20px;
        right: 20px;
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
    
    .badge-promo,
    .badge-new {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
    
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
    
    /* Card prodotti carrello mobile */
    #elenco .list-group-item .row > div {
        margin-bottom: 0.5rem;
    }
    
    #elenco .list-group-item .col-md-6,
    #elenco .list-group-item .col-md-2 {
        text-align: center !important;
    }
    
    #elenco .input-group {
        max-width: 140px;
        margin: 0 auto;
    }
}
