/**
 * Yeni Ürün Carousel Stillemesi
 * Bu dosya test-carousel.php'den başarıyla geliştirilen ürün card tasarımını içerir
 */

/* Temel Stiller */
.products-carousel {
    position: relative;
    margin: 0 -5px;
    padding: 0 28px; /* Ok boşluklarını biraz daha azalt */
}

/* Ürün Kartı Stilleri */
.showcase {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 5px;
    position: relative;
}

.showcase:hover {
    box-shadow: 0 8px 24px rgba(42,57,90,0.13);
    transform: translateY(-4px);
}

.showcase-image-container {
    position: relative;
    overflow: hidden;
}

.showcase-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.showcase:hover .showcase-image img {
    transform: scale(1.05);
}

.showcase-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.showcase-brand {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.showcase-brand a {
    color: #999;
    text-decoration: none;
}

.showcase-brand a:hover {
    color: #666;
}

.showcase-title {
    margin-bottom: 6px; /* Başlık ile fiyat arası boşluğu azalt */
    min-height: 40px;
    overflow: hidden;
}

.showcase-title a {
    color: #333;
    font-size: 14px;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
}

.showcase-title a:hover {
    color: #000;
}

.showcase-price {
    margin-top: 4px; /* Otomatik boşluğu kaldır, yukarıya yaklaştır */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.showcase-price-new {
    color: #d32f2f;
    font-weight: 700;
    font-size: 16px;
}

.showcase-discount-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e53935;
    color: #fff;
    border-radius: 12px;
    padding: 2px 6px;
    line-height: 1;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.showcase-discount-inline .discount-icon {
    display: inline-flex;
}

/* Eski üstteki indirim rozeti deals içinde görünmesin */
.deals-carousel .discount-badge { display: none !important; }

.showcase-cart-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse; /* Sıralamayı değiştir - kalp butonunu sola al */
    margin-top: 6px;
}

.showcase-buttons {
    flex-grow: 1;
    margin-left: 10px; /* Sağa kaydır */
}

.add-to-cart-button {
    background: #ffd700;
    color: #333;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
    width: 100%; /* Butonu genişlet */
}

.no-stock-button {
    background: #999;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: not-allowed;
    text-decoration: none;
    display: block;
    text-align: center;
}

.showcase-favorites {
    width: 35px;
    margin-right: 3px; /* Sağdan hafif boşluk */
}

.showcase-icon-favori, .showcase-icon-favori-add {
    cursor: pointer;
}

.showcase-icon-favori-add {
    display: none;
}

.showcase-favorites a:hover .showcase-icon-favori {
    display: none;
}

.showcase-favorites a:hover .showcase-icon-favori-add {
    display: block;
}

.showcase-sku {
    margin-top: 0;
    font-size: 12px;
    color: #999;
    text-align: right;
    padding: 0 15px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sold-out-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.discount-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #d32f2f;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    line-height: 1.2;
    min-width: 15px;
    text-align: center;
}

/* Owl Carousel Özellikleri */
.owl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    margin-top: -20px; /* Biraz yukarı kaydırma */
    left: -10px; /* Tüm nav konteynerini sola kaydır */
    width: calc(100% + 20px); /* Genişliği artır */
}

.owl-prev, 
.owl-next {
    width: 40px;
    height: 40px;
    background: #fff !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #333 !important;
    font-size: 22px !important;
    font-weight: bold !important;
    pointer-events: auto;
    position: absolute;
    border: 1px solid #eee !important;
}

.owl-prev {
    left: -50px; /* Sol ok daha fazla sola konumlandırma */
}

.owl-next {
    right: -50px; /* Sağ ok daha fazla sağa konumlandırma */
}

.owl-prev:hover, 
.owl-next:hover {
    background: #f5f5f5 !important;
    color: #000 !important;
}

.owl-dots {
    text-align: center;
    margin-top: 20px;
}

.owl-dot {
    display: inline-block;
    margin: 0 5px;
}

.owl-dot span {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
}

.owl-dot.active span {
    background: #d32f2f;
}

/* Mobil Düzenlemeler */
@media (max-width: 576px) {
    .showcase {
    margin: 0;
    min-height: 300px; /* Kartın fazla sıkışmasını önle */
        width: 100%;
        box-sizing: border-box;
    }
    
    .showcase-title {
        padding: 3px 2px;
        min-height: 36px;
        font-size: 12px;
    }
    
    .showcase-price {
        padding: 3px 2px;
        margin-bottom: 8px;
    }
    
    .showcase-sku {
        padding: 0 2px 5px;
        margin-top: 0;
        font-size: 11px;
        max-width: 100%;
    }
    
    .showcase-content {
        padding: 10px 0 0;
    }
    
    .showcase-image-container {
        height: 160px;
    }
    
    /* Ürün carousellerinde taşmayı engelle: mobilde overlap/bleed oluşmasın */
    .best-sellers-carousel .owl-stage-outer,
    .new-products-carousel .owl-stage-outer,
    .deals-carousel .owl-stage-outer {
        overflow: hidden;
    }
    
    .owl-carousel .owl-item {
        padding: 0 5px; /* Ürünler arasında 10px boşluk */
    }
    
    /* Mobilde okları aşağı bölüme taşıyoruz */
    .owl-prev, 
    .owl-next {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        display: inline-block;
        margin: 10px 5px 0;
    }
    
    .owl-nav {
        position: relative;
        top: auto;
        transform: none;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin: 15px 0 0;
        left: 0;
    }
    
    .discount-badge {
        font-size: 8px;
        padding: 1px 4px;
    }
    
    .owl-prev, .owl-next {
        width: 30px;
        height: 30px;
        font-size: 16px !important;
    }
    
    .products-carousel {
        padding: 0;
        width: 100%;
        margin: 0;
    }
    /* Move best-sellers a bit down from the heading */
    .bestsellers-section .products-carousel,
    .bestsellers-section .best-sellers-carousel,
    .best-sellers-carousel { margin-top: 10px; }
    
    .showcase-cart-buttons {
        padding: 0 2px 5px;
        display: block;
        position: relative;
        width: 100%;
    }
    
    .showcase-favorites {
        position: absolute;
        top: -55px; /* 10px daha yukarı */
        right: 15px; /* 10px sola kaydır (sağdan +10px) */
        margin: 0;
        z-index: 3;
    }
    
    .showcase-buttons {
        width: 100%;
        margin: 0;
    }
    
    .sepete-ekle,
    .add-to-cart-button {
        padding: 10px 5px;
        font-size: 13px;
        width: 100%;
        display: block;
        text-align: center;
        box-sizing: border-box;
        font-weight: 700;
    }
}

/* ---- Layout consistency fixes (avoid card drift) ---- */
/* Ensure footer (buttons/wishlist) sits at the bottom consistently */
.showcase-content { display: flex; flex-direction: column; justify-content: flex-start; }
.showcase-cart-buttons { margin-top: auto; }
/* Fix block heights so rows align */
.showcase-price { min-height: 28px; }
.showcase-sku { min-height: 16px; }
@media (max-width: 576px) {
    .showcase-title { min-height: 40px; }
    /* Small nudge to move carousel a bit below the heading */
    .bestsellers-section .products-carousel,
    .bestsellers-section .best-sellers-carousel,
    .best-sellers-carousel { margin-top: 12px !important; }
}
