/**
 * Product Images Optimizer
 * Βελτιώνει την εμφάνιση των εικόνων προϊόντων και σχετικών προϊόντων
 */

/* ============================================
   Κύρια Εικόνα Προϊόντος
   ============================================ */

/* Gallery container - μείωση μεγέθους */
.woocommerce-product-gallery {
    max-width: 100%;
}

.woocommerce-product-gallery__wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Κύρια εικόνα προϊόντος - μικρότερο μέγεθος */
.woocommerce-product-gallery__image img,
.woocommerce-product-gallery__image a img {
    max-width: 400px !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.woocommerce-product-gallery__image img:hover,
.woocommerce-product-gallery__image a img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Thumbnails - μικρότερα */
.woocommerce-product-gallery__image--placeholder img {
    max-width: 400px !important;
    width: 100% !important;
    height: auto !important;
}

/* ============================================
   Σχετικά Προϊόντα
   ============================================ */

/* Container σχετικών προϊόντων */
.related.products {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.related.products h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

/* Grid σχετικών προϊόντων */
.related.products ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Κάθε προϊόν στο grid */
.related.products ul.products li.product {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.related.products ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #1c7bb6;
}

/* Εικόνες σχετικών προϊόντων - μικρότερες */
.related.products ul.products li.product img,
.related.products ul.products li.product .woocommerce-loop-product__link img,
.related.products ul.products li.product .attachment-woocommerce_thumbnail {
    max-width: 180px !important;
    width: 100% !important;
    height: auto !important;
    max-height: 180px !important;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.related.products ul.products li.product:hover img {
    transform: scale(1.05);
}

/* Τίτλος προϊόντος */
.related.products ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px;
    font-weight: 500;
    margin: 10px 0;
    color: #333;
    line-height: 1.4;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related.products ul.products li.product .woocommerce-loop-product__title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related.products ul.products li.product .woocommerce-loop-product__title a:hover {
    color: #1c7bb6;
}

/* Τιμή */
.related.products ul.products li.product .price {
    font-size: 16px;
    font-weight: 600;
    color: #1c7bb6;
    margin: 10px 0;
}

/* Κουμπί προσθήκης στο καλάθι */
.related.products ul.products li.product .add_to_cart_button {
    margin-top: 10px;
    padding: 10px 20px;
    background: #1c7bb6;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.related.products ul.products li.product .add_to_cart_button:hover {
    background: #155a8a;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(28, 123, 182, 0.3);
}

/* ============================================
   Γενικές Βελτιώσεις
   ============================================ */

/* Καθαρισμός layout */
.woocommerce div.product div.images {
    margin-bottom: 30px;
}

/* Responsive design */
@media (max-width: 768px) {
    /* Κύρια εικόνα - ακόμα μικρότερη σε mobile */
    .woocommerce-product-gallery__image img,
    .woocommerce-product-gallery__image a img {
        max-width: 100% !important;
    }
    
    /* Σχετικά προϊόντα - 2 στήλες σε tablet */
    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .related.products ul.products li.product {
        padding: 10px;
    }
    
    .related.products ul.products li.product img {
        max-width: 150px !important;
        max-height: 150px !important;
    }
}

@media (max-width: 480px) {
    /* Σχετικά προϊόντα - 1 στήλη σε mobile */
    .related.products ul.products {
        grid-template-columns: 1fr;
    }
    
    .related.products h2 {
        font-size: 20px;
    }
    
    .related.products ul.products li.product img {
        max-width: 200px !important;
        max-height: 200px !important;
    }
}

/* Βελτίωση spacing */
.woocommerce .product .summary {
    padding-left: 20px;
}

@media (max-width: 768px) {
    .woocommerce .product .summary {
        padding-left: 0;
        margin-top: 20px;
    }
}

/* Smooth transitions */
.woocommerce-product-gallery__image,
.related.products ul.products li.product {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading state */
.woocommerce-product-gallery__image img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.woocommerce-product-gallery__image img[loading="lazy"].loaded {
    opacity: 1;
}

