body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #FFFFFF;
    background-size: cover;
}

.shop-container {
    margin-top: 16vh;
    padding: 40px 5%;
    min-height: 100vh;
}

/* HEADER — CORRETTO perché era bianco su scuro */
.shop-header {
    text-align: center;
    margin-bottom: 50px;
}

.shop-header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    color: black; /* PRIMA ERA BIANCO → invisibile sul bianco */
    text-transform: uppercase;
    letter-spacing: 2px;
}

.shop-header p {
    font-size: 1.2rem;
    color: rgba(0, 0, 0, 0.7); /* testo chiaro ma leggibile */
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 2%;
}

.product-card {
    background: rgb(255, 255, 255);
    padding: 0;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    width: 370px;
    max-width: 370px;
    min-width: 370px;
    margin: 0 auto;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.product-image-container {
    position: relative;
    width: 100%;
}

.product-image-container img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.out-of-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-info {
    color: black;
    padding: 20px;
    padding-bottom: 25px;
}

.product-name {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: black;
}

.product-description {
    font-size: 0.9rem;
    margin-bottom: 15px;
    opacity: 0.8;
    line-height: 1.4;
}

.product-price {
    font-size: 1.8rem;
    color: #00bfff;
    margin-bottom: 20px;
    font-weight: bold;
}

.product-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 15px;
}

/* BUY BUTTON — ok */
.buy-btn {
    background: linear-gradient(135deg, #f000f0, #800080);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.buy-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.buy-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

/* INFO BUTTON — invisibile → sistemato */
.info-btn {
    background: rgba(0, 0, 0, 0.1); /* PRIMA era trasparente bianco → invisibile */
    color: black; /* PRIMA era bianco su bianco → invisibile */
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.info-btn:hover {
    background: rgba(0,0,0,0.2);
}

/* LOADING — corretto */
.loading-container {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.2); /* PRIMA era bianco */
    border-radius: 50%;
    border-top: 4px solid #00bfff;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error {
    text-align: center;
    font-size: 1.5rem;
    color: #ff6b6b;
    margin-top: 50px;
}

.error-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
    color: #ff6b6b;
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 20px;
}

.retry-btn {
    background: #00bfff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #0077ff;
    transform: scale(1.05);
}

/* PRODUCT DETAIL — sfondo scuro → testo bianco corretto */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr; /* IMG sinistra — INFO destra */
    gap: 40px;
    align-items: start;
    background: none;
    border: none;
    backdrop-filter: none;
    margin-top: 10%;
}

.product-images {
    position: sticky;
    top: 20px; /* rende l’immagine “fissa” mentre scrolli */
}

.product-images img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    object-fit: contain;
}

.product-detail-info {
    flex: 1 1 300px;
    max-width: 500px;
    color: rgb(0, 0, 0);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 15px;
}

.product-detail-info h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: rgb(0, 0, 0);
}

.product-category {
    font-size: 0.9rem;
    color: #800080;
    letter-spacing: 1px;
}

.product-price {
    font-size: 1.8rem;
    color: #800080;
    font-weight: bold;
}

.product-full-description {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    opacity: 0.9;
}

/* CATEGORIES — problema: testo bianco su bianco → corretto */
.categories-container {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 25px auto 35px;
    max-width: 900px;
}

.category-button {
    padding: 14px 28px;
    font-size: 1.2rem;
    background-color: white; /* PRIMA dark → ok */
    color: black; /* PRIMA white su bianco → invisibile */
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid rgb(172, 0, 211);
    font-weight: 600;
    transition: all 0.3s ease;
}

.category-button:hover,
.category-button.active {
    background-color: rgb(172, 0, 211);
    color: white;
    transform: scale(1.1);
}

.choose-category {
    text-align: center;
    margin-top: 40px;
    opacity: 0.6;
    color: black; /* PRIMA bianco */
}

#categoryTitle{
    text-align: center;
    font-size: 2.5rem;
    color: black; /* PRIMA bianco su bianco */
    margin-top: 5%;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.shop-title {
    text-align: center;
    font-size: 2.5rem;
    color: black; /* PRIMA bianco su bianco */
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tag {
    display: inline-block;
    background: rgba(0, 123, 255, 0.2);
    color: #005499; /* più visibile del celeste chiaro */
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.purchase-section {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-controls input {
    width: 60px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 5px;
}

.quantity-controls button {
    background: linear-gradient(135deg, #f000f0, #800080);
    color: white;
    border: none;
    padding: 5px 12px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-controls button:hover {
    background: linear-gradient(135deg, #f000f0, #800080);
}

.checkout-btn {
    background: linear-gradient(135deg, #c301c3, #800080);
    color: white;
    font-weight: 700;
    padding: 12px 25px;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #0077ff, #0044ff);
    transform: scale(1.05);
}

.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 20px;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.product-images {
    position: sticky;
    top: 20px;
}

.product-images img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.product-detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: rgb(0, 0, 0);
}

.product-category {
    color: #800080;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.product-price {
    font-size: 2rem;
    font-weight: bold;
    color: black;
    margin-bottom: 20px;
}

.product-detail-info p {
    line-height: 1.6;
    margin-bottom: 30px;
    color: rgba(0, 0, 0, 0.9);
}

/* Sezione personalizzazione */
.customization-section {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.customization-section h3 {
    margin-bottom: 15px;
    color: #800080;
    font-size: 1.3rem;
}

.customization-field {
    margin-bottom: 15px;
}

.customization-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: rgb(0, 0, 0);
}

.customization-field input[type="text"],
.customization-field input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: white;
    font-size: 1rem;
}

.customization-field input[type="file"] {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px dashed rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.2);
    color: white;
}

.customization-field small {
    display: block;
    margin-top: 5px;
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
}

/* Sezione acquisto */
.purchase-section {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 12px;
}

.quantity-selector {
    margin-bottom: 20px;
}

.quantity-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: white;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #f000f0, #800080);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
}

.quantity-controls button:hover {
    background: linear-gradient(135deg, #f000f0, #800080);
}

.quantity-controls input {
    width: 60px;
    height: 40px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: white;
    font-size: 1rem;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #f000f0, #800080);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #f000f0, #800080);
    transform: translateY(-2px);
}

.color-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 10px;
}

.color-selection input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    border: 0.5px solid #b300ff;
    transition: all 0.3s ease;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: #b300ff;
}

.color-option.selected {
    border-color: #b300ff;
    transform: scale(1.1);
}

.color-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.color-sample {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
}

/* Stili per lo slider immagini */
.image-slider {
    position: relative;
}

.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    display: none;
    width: 100%;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    max-height: 500px;
    object-fit: contain;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    padding: 15px;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev {
    left: 15px;
}

.slider-btn.next {
    right: 15px;
}

.slider-btn i {
    font-size: 1.2rem;
}

/* Thumbnails */
.slider-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.thumbnail:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #800080;
    opacity: 1;
    transform: scale(1.1);
}

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

/* Responsive */
@media (max-width: 1390px) and (min-width: 768px) {
    .products-container {
        margin-top: 10%;      
    }   
}

@media (max-width: 767px) {
    .shop-header h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .product-actions {
        flex-direction: column;
    }

    .product-detail {
        flex-direction: column;
        align-items: center;
    }

    .product-detail-container{
        margin-left: 10%;
    }

    .product-images {
        max-width: 90%;
    }

    .product-detail-info {
        max-width: 90%;
    }

    .quantity-controls input {
        width: 50px;
    }

     .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-images {
        position: static;
    }
    
    .product-detail-info h1 {
        font-size: 2rem;
    }
    
    .product-price {
        font-size: 1.8rem;
    }

    .color-options {
        justify-content: center;
    }
    
    .color-preview {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .slider-btn {
        width: 40px;
        height: 40px;
        padding: 10px;
    }
    
    .slider-btn i {
        font-size: 1rem;
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .slider-btn.prev {
        left: 10px;
    }
    
    .slider-btn.next {
        right: 10px;
    }

    #categoryTitle{
        margin-top: 18%;
    }
}

@media (max-width: 500px) {
    .thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .slider-thumbnails {
        gap: 5px;
    }
}