/* Home Products GPT - Grid/Carousel Product Listing Styles */

/* ============================================
   GRID MODE
   ============================================ */

.homeproducts-grid-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.homeproducts-grid-container {
    display: grid;
    gap: 15px;
    width: 100%;
}

/* Desktop grid - dinamik sütun sayısı */
.homeproducts-grid-container[data-grid-desktop="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.homeproducts-grid-container[data-grid-desktop="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.homeproducts-grid-container[data-grid-desktop="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.homeproducts-grid-container[data-grid-desktop="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.homeproducts-grid-container[data-grid-desktop="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.homeproducts-grid-container[data-grid-desktop="6"] {
    grid-template-columns: repeat(6, 1fr);
}

.homeproducts-grid-container[data-grid-desktop="7"] {
    grid-template-columns: repeat(7, 1fr);
}

.homeproducts-grid-container[data-grid-desktop="8"] {
    grid-template-columns: repeat(8, 1fr);
}

/* Ürün kartları için genel stil */
.homeproducts-grid-container > * {
    min-width: 0;
}

.homeproducts-grid-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   CAROUSEL MODE
   ============================================ */

.homeproducts-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.homeproducts-carousel-container {
    position: relative;
    width: 100%;
    padding: 0;
}

.homeproducts-carousel-track {
    position: relative;
    width: 100%;
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.homeproducts-carousel-slide {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    display: flex;
}

.homeproducts-carousel-items {
    display: flex;
    width: 100%;
    gap: 15px;
    padding: 0;
}

/* Ürün kartları için genel stil */
.homeproducts-carousel-items > * {
    flex: 0 0 auto;
    min-width: 0;
}

/* Desktop - dinamik sütun sayısı */
.homeproducts-carousel-items[data-items-per-view="1"] > * {
    width: 100%;
    flex: 0 0 100%;
}

.homeproducts-carousel-items[data-items-per-view="2"] > * {
    width: calc(50% - 7.5px);
    flex: 0 0 calc(50% - 7.5px);
}

.homeproducts-carousel-items[data-items-per-view="3"] > * {
    width: calc(33.333% - 10px);
    flex: 0 0 calc(33.333% - 10px);
}

.homeproducts-carousel-items[data-items-per-view="4"] > * {
    width: calc(25% - 11.25px);
    flex: 0 0 calc(25% - 11.25px);
}

.homeproducts-carousel-items[data-items-per-view="5"] > * {
    width: calc(20% - 12px);
    flex: 0 0 calc(20% - 12px);
}

.homeproducts-carousel-items[data-items-per-view="6"] > * {
    width: calc(16.666% - 12.5px);
    flex: 0 0 calc(16.666% - 12.5px);
}

.homeproducts-carousel-items[data-items-per-view="7"] > * {
    width: calc(14.285% - 12.85px);
    flex: 0 0 calc(14.285% - 12.85px);
}

.homeproducts-carousel-items[data-items-per-view="8"] > * {
    width: calc(12.5% - 13.125px);
    flex: 0 0 calc(12.5% - 13.125px);
}

/* Navigasyon Okları */
.homeproducts-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: var(--slider-arrow-background-color, rgba(255, 255, 255, 0.9));
    border: none;
    width: var(--dot-buton-width, 44px);
    height: var(--dot-buton-height, 44px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: var(--slider-arrow-text-color, #333);
    font-size: var(--font-size-normal, 16px);
    padding: 0;
    margin: 0;
}

.homeproducts-carousel-nav:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.homeproducts-carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.homeproducts-carousel-nav:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.homeproducts-carousel-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.homeproducts-carousel-prev {
    left: 10px;
}

.homeproducts-carousel-next {
    right: 10px;
}

.homeproducts-carousel-nav i {
    display: block;
    line-height: 1;
}

/* Pagination Dots */
.homeproducts-carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 20px;
}

/* Dot'lar kapsayıcının dışında */
.homeproducts-carousel-dots-outside {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 20px;
    padding: 15px;
    display: flex;
}

.homeproducts-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--slider-dot-color, rgba(255, 255, 255, 0.5));
    background: var(--slider-dot-color, rgba(255, 255, 255, 0.5));
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    position: relative;
}

.homeproducts-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.homeproducts-carousel-dot.is-active {
    border: 2px solid var(--dot-active-color, #fff);
    background: var(--dot-active-color, #fff);
    width: 32px;
    border-radius: 6px;
}

.homeproducts-carousel-dot:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (992px ve altı) */
@media (max-width: 992px) {
    /* Grid Mode - Tablet */
    .homeproducts-grid-container[data-grid-desktop="8"],
    .homeproducts-grid-container[data-grid-desktop="7"],
    .homeproducts-grid-container[data-grid-desktop="6"],
    .homeproducts-grid-container[data-grid-desktop="5"] {
        grid-template-columns: repeat(var(--grid-tablet, 3), 1fr);
    }
    
    .homeproducts-grid-container[data-grid-desktop="4"] {
        grid-template-columns: repeat(var(--grid-tablet, 3), 1fr);
    }
    
    .homeproducts-grid-container[data-grid-desktop="3"] {
        grid-template-columns: repeat(var(--grid-tablet, 2), 1fr);
    }
    
    /* Carousel Mode - Tablet */
    .homeproducts-carousel-items[data-items-per-view-tablet="1"] > * {
        width: 100%;
    }
    
    .homeproducts-carousel-items[data-items-per-view-tablet="2"] > * {
        width: calc(50% - 7.5px);
    }
    
    .homeproducts-carousel-items[data-items-per-view-tablet="3"] > * {
        width: calc(33.333% - 10px);
    }
    
    .homeproducts-carousel-items[data-items-per-view-tablet="4"] > * {
        width: calc(25% - 11.25px);
    }
    
    .homeproducts-carousel-items[data-items-per-view-tablet="5"] > * {
        width: calc(20% - 12px);
    }
    
    /* Eğer tablet için özel ayar yoksa, desktop ayarını kullan */
    .homeproducts-carousel-items:not([data-items-per-view-tablet])[data-items-per-view="6"] > *,
    .homeproducts-carousel-items:not([data-items-per-view-tablet])[data-items-per-view="5"] > *,
    .homeproducts-carousel-items:not([data-items-per-view-tablet])[data-items-per-view="4"] > * {
        width: calc(33.333% - 10px);
    }
    
    .homeproducts-carousel-items:not([data-items-per-view-tablet])[data-items-per-view="3"] > * {
        width: calc(50% - 7.5px);
    }
}

/* Mobile (768px ve altı) */
@media (max-width: 768px) {
    /* Grid Mode - Mobile */
    .homeproducts-grid-container {
        grid-template-columns: repeat(var(--grid-mobile, 2), 1fr) !important;
        gap: 10px;
    }
    
    /* Carousel Mode - Mobile */
    .homeproducts-carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .homeproducts-carousel-prev {
        left: 5px;
    }
    
    .homeproducts-carousel-next {
        right: 5px;
    }
    
    .homeproducts-carousel-items {
        gap: 10px;
        padding: 0 5px;
    }
    
    .homeproducts-carousel-slide {
        min-width: 100% !important;
        width: 100% !important;
    }
    
    /* Mobile için özel ayar varsa onu kullan, yoksa default 2 */
    .homeproducts-carousel-items[data-items-per-view-mobile="1"] > * {
        width: 100% !important;
    }
    
    .homeproducts-carousel-items[data-items-per-view-mobile="2"] > * {
        width: calc(50% - 5px) !important;
    }
    
    .homeproducts-carousel-items[data-items-per-view-mobile="3"] > * {
        width: calc(33.333% - 6.66px) !important;
    }
    
    /* Eğer mobile için özel ayar yoksa, default 2 sütun */
    .homeproducts-carousel-items:not([data-items-per-view-mobile]) > * {
        width: calc(50% - 5px) !important;
        flex: 0 0 calc(50% - 5px) !important;
        max-width: calc(50% - 5px) !important;
    }
    
    .homeproducts-carousel-dots {
        bottom: 15px;
        gap: 8px;
    }
    
    .homeproducts-carousel-dot {
        width: 10px;
        height: 10px;
    }
    
    .homeproducts-carousel-dot.is-active {
        width: 24px;
    }
}

/* Small Mobile (480px ve altı) */
@media (max-width: 480px) {
    .homeproducts-grid-container {
        gap: 8px;
    }
    
    .homeproducts-carousel-nav {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .homeproducts-carousel-prev {
        left: 3px;
    }
    
    .homeproducts-carousel-next {
        right: 3px;
    }
    
    .homeproducts-carousel-items {
        gap: 8px;
        padding: 0 3px;
    }
    
    .homeproducts-carousel-dots {
        bottom: 10px;
        gap: 6px;
    }
    
    .homeproducts-carousel-dot {
        width: 8px;
        height: 8px;
        border-width: 1.5px;
    }
    
    .homeproducts-carousel-dot.is-active {
        width: 20px;
    }
}

/* Touch desteği için */
.homeproducts-carousel-wrapper {
    touch-action: pan-y;
}

/* Animasyon performansı */
.homeproducts-carousel-track,
.homeproducts-carousel-slide {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Ürün kartları için ek stiller */
.homeproducts-carousel-items img,
.homeproducts-grid-container img {
    max-width: 100%;
    height: auto;
    display: block;
}
