/**
 * Yuva Category Products Carousel CSS
 * Responsive tasarım ve modern stil
 */

/* ========================================
   ANA KONTEYNER VE LAYOUT
   ======================================== */

.yuva-carousel-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
    overflow: visible;
}

.yuva-carousel-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
    position: relative;
}

/* ========================================
   KATEGORİ KARTI TASARIMI
   ======================================== */

.yuva-category-section {
    flex: 0 0 250px;
    min-height: 280px;
    overflow: visible;
    z-index: 5;
}

.yuva-category-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.yuva-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
    text-decoration: none;
    color: inherit;
}

.yuva-category-card.card-hover {
    transform: translateY(-4px) scale(1.02);
}

.yuva-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.yuva-category-card:hover::before {
    transform: scaleX(1);
}

.yuva-category-image {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
    position: relative;
}

.yuva-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.yuva-category-card:hover .yuva-category-image img {
    transform: scale(1.05);
}

.yuva-category-name {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
    text-align: center;
    display: none; /* Desktop'ta gizli */
}

.yuva-category-description {
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.4;
    margin-top: 6px;
    text-align: center;
    flex-grow: 1;
}

.yuva-category-count {
    display: inline-block;
    background: #ecf0f1;
    color: #34495e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 16px;
    text-align: center;
}

/* ========================================
   CAROUSEL BÖLÜMÜ
   ======================================== */

.yuva-products-section {
    flex: 1;
    min-width: 0;
}

.yuva-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.yuva-products-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.yuva-products-view-all {
    color: var(--primary-color, #3498db);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.yuva-products-view-all:hover {
    color: var(--primary-color, #2980b9);
    text-decoration: underline;
    opacity: 0.8;
}

/* ========================================
   SWIPER CAROUSEL TASARIMI
   ======================================== */

.yuva-carousel-container .swiper {
    overflow: visible;
    padding: 0 0 40px 0;
}

.yuva-carousel-container .swiper-wrapper {
    align-items: stretch;
}

.yuva-carousel-container .swiper-slide {
    height: auto;
    display: flex;
}

/* ========================================
   ÜRÜN KARTI TASARIMI
   ======================================== */

.yuva-product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f8f9fa;
    height: 100%;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.yuva-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: inherit;
}

.yuva-product-card.product-hover {
    transform: translateY(-3px) scale(1.02);
}

.yuva-product-image {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

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

.yuva-product-image img.lazy-loading {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.yuva-product-image img.lazy-loaded {
    opacity: 1;
}

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

.yuva-product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.yuva-product-badge.sale {
    background: #e74c3c;
}

.yuva-product-badge.new {
    background: #27ae60;
}

.yuva-product-badge.featured {
    background: #f39c12;
}

.yuva-product-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.yuva-product-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yuva-product-price {
    margin-top: auto;
    font-weight: 700;
    color: #27ae60;
    font-size: var(--product-price-font-size, 14px);
}

.yuva-product-price .original-price {
    text-decoration: line-through;
    color: #95a5a6;
    font-weight: 400;
    margin-right: 8px;
}

.yuva-product-price .sale-price {
    color: #e74c3c;
}

.yuva-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 8px 0;
    font-size: 12px;
}

.yuva-product-rating .stars {
    color: #f39c12;
}

.yuva-product-rating .rating-count {
    color: #7f8c8d;
}

/* ========================================
   SWIPER KONTROLLERI
   ======================================== */

.yuva-carousel-container .swiper-button-next,
.yuva-carousel-container .swiper-button-prev {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    top: 50%;
    margin-top: -22px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yuva-carousel-container .swiper-button-next:hover,
.yuva-carousel-container .swiper-button-prev:hover {
    background: #3498db;
    border-color: #3498db;
    color: white;
    transform: scale(1.1);
}

.yuva-carousel-container .swiper-button-next {
    right: -22px;
}

.yuva-carousel-container .swiper-button-prev {
    display: none; /* Sol oku kaldır */
}

.yuva-carousel-container .swiper-button-next::after,
.yuva-carousel-container .swiper-button-prev::after {
    font-size: 16px;
    font-weight: 700;
    color: inherit;
}

/* Swiper container'ın overflow'unu düzelt */
.yuva-products-section {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.yuva-carousel-container .swiper {
    overflow: visible;
    padding: 0 50px 40px 0;
    margin: 0 -50px 0 0;
}

.yuva-carousel-container .swiper-pagination {
    bottom: -10px;
    text-align: center;
}

.yuva-carousel-container .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #bdc3c7;
    opacity: 1;
    transition: all 0.3s ease;
    margin: 0 4px;
}

.yuva-carousel-container .swiper-pagination-bullet-active {
    background: #3498db;
    transform: scale(1.2);
}

/* ========================================
   RESPONSIVE TASARIM
   ======================================== */

/* Masaüstü için ek ayarlar */
@media (min-width: 769px) {
    .yuva-carousel-container {
        align-items: stretch;
        flex-direction: row;
    }
    
    .yuva-category-section {
        flex: 0 0 250px;
        max-width: 250px;
    }
    
    .yuva-products-section {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
}

/* Tablet (768px ve altı) */
@media (max-width: 768px) {
    .yuva-carousel-wrapper {
        padding: 0 15px;
    }
    
    .yuva-carousel-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .yuva-category-section {
        flex: none;
        width: 100%;
        min-height: 120px;
        max-height: 120px;
        order: 1;
    }
    
    .yuva-products-section {
        order: 2;
        flex: 1;
        min-width: 0;
        overflow: visible;
    }
    
    .yuva-category-card {
        min-height: 120px;
        max-height: 120px;
        padding: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        background: linear-gradient(135deg, var(--mobile-banner-start, #667eea) 0%, var(--mobile-banner-end, #764ba2) 100%);
        position: relative;
        overflow: hidden;
    }
    
    .yuva-category-image {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        z-index: -1 !important;
    }
    
    .yuva-category-image img {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .yuva-category-name {
        display: block !important;
        font-size: 18px;
        font-weight: 700;
        color: #ffffff;
        margin: 0;
        text-align: center;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 2;
    }
    
    .yuva-carousel-container .swiper {
        padding: 0 0 45px 0;
        overflow: visible;
        width: 100%;
    }
    
    .yuva-carousel-container .swiper-wrapper {
        align-items: stretch;
    }
    
    .yuva-carousel-container .swiper-slide {
        height: auto;
        display: flex;
        width: auto;
        flex-shrink: 0;
    }
    
    .yuva-carousel-container .swiper-button-next {
        display: none !important;
    }
    
    .yuva-carousel-container .swiper-button-prev {
        display: none !important;
    }
}

/* Mobil (767px ve altı) */
@media (max-width: 767px) {
    .yuva-carousel-wrapper {
        padding: 0 12px;
    }
    
    .yuva-carousel-container {
        gap: 12px;
        display: flex;
        flex-direction: column;
    }
    
    .yuva-category-section {
        min-height: 100px;
        max-height: 100px;
        width: 100%;
        flex: none;
    }
    
    .yuva-category-card {
        min-height: 100px;
        max-height: 100px;
        padding: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        background: linear-gradient(135deg, var(--mobile-banner-start, #667eea) 0%, var(--mobile-banner-end, #764ba2) 100%);
    }
    
    .yuva-category-image {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        z-index: -1 !important;
    }
    
    .yuva-category-image img {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .yuva-category-name {
        display: block !important;
        font-size: 16px;
        font-weight: 700;
        color: #ffffff;
        margin: 0;
        text-align: center;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 2;
    }
    
    .yuva-products-section {
        flex: 1;
        width: 100%;
        min-width: 0;
        overflow: visible;
    }
    
    .yuva-products-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .yuva-product-card {
        min-height: 320px;
        width: 100%;
        max-width: 280px;
        flex: 0 0 280px;
    }
    
    .yuva-product-image {
        height: 200px;
    }
    
    .yuva-product-content {
        padding: 12px;
    }
    
    .yuva-product-title {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .yuva-product-price {
        font-size: 14px;
        font-weight: 700;
    }
    
    .yuva-carousel-container .swiper {
        padding: 0 0 40px 0;
        margin: 0;
        width: 100%;
        overflow: visible;
    }
    
    .yuva-carousel-container .swiper-wrapper {
        align-items: stretch;
        display: flex;
    }
    
    .yuva-carousel-container .swiper-slide {
        height: auto;
        display: flex;
        width: 280px;
        flex-shrink: 0;
    }
    
    .yuva-carousel-container .swiper-button-next,
    .yuva-carousel-container .swiper-button-prev {
        display: none !important;
    }
    
    .yuva-carousel-container .swiper-button-next::after,
    .yuva-carousel-container .swiper-button-prev::after {
        font-size: 14px;
        font-weight: 600;
    }
    
    .yuva-carousel-container .swiper-pagination {
        bottom: -5px;
    }
    
    .yuva-carousel-container .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
}

/* Küçük mobil (480px ve altı) */
@media (max-width: 480px) {
    .yuva-carousel-wrapper {
        padding: 0 10px;
    }
    
    .yuva-carousel-container {
        gap: 10px;
    }
    
    .yuva-category-section {
        min-height: 80px;
        max-height: 80px;
    }
    
    .yuva-category-card {
        min-height: 80px;
        max-height: 80px;
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        background: linear-gradient(135deg, var(--mobile-banner-start, #667eea) 0%, var(--mobile-banner-end, #764ba2) 100%);
    }
    
    .yuva-category-image {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        z-index: -1 !important;
    }
    
    .yuva-category-image img {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .yuva-category-name {
        display: block !important;
        font-size: 14px;
        font-weight: 700;
        color: #ffffff;
        margin: 0;
        text-align: center;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 2;
    }
    
    .yuva-products-header {
        margin-bottom: 8px;
    }
    
    .yuva-products-title {
        font-size: 15px;
    }
    
    .yuva-product-card {
        min-height: 280px;
    }
    
    .yuva-product-image {
        height: 170px;
    }
    
    .yuva-product-content {
        padding: 10px;
    }
    
    .yuva-product-title {
        font-size: 13px;
        line-height: 1.2;
    }
    
    .yuva-product-price {
        font-size: 13px;
    }
    
    .yuva-carousel-container .swiper {
        padding: 0 0 35px 0;
    }
    
    .yuva-carousel-container .swiper-button-next,
    .yuva-carousel-container .swiper-button-prev {
        display: none !important;
    }
    
    .yuva-carousel-container .swiper-pagination {
        bottom: -5px;
    }
}

/* ========================================
   LOADING VE HATA DURUMLARI
   ======================================== */

.yyc-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 16px;
    color: #7f8c8d;
}

.yyc-error {
    background: #fee;
    color: #c0392b;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #f5b2b2;
}

.yyc-no-products {
    background: #f8f9fa;
    color: #6c757d;
    padding: 32px;
    border-radius: 8px;
    text-align: center;
    font-style: italic;
}

/* ========================================
   ACCESSIBILITY İYİLEŞTİRMELERİ
   ======================================== */

.yuva-carousel-container:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.yuva-product-card:focus,
.yuva-category-card:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode desteği */
@media (prefers-contrast: high) {
    .yuva-category-card,
    .yuva-product-card {
        border: 2px solid #000;
    }
    
    .yuva-category-name,
    .yuva-product-title {
        color: #000;
    }
}

/* Reduced motion desteği */
@media (prefers-reduced-motion: reduce) {
    .yuva-category-card,
    .yuva-product-card,
    .yuva-category-image img,
    .yuva-product-image img,
    .yuva-carousel-container .swiper-button-next,
    .yuva-carousel-container .swiper-button-prev,
    .yuva-carousel-container .swiper-pagination-bullet {
        transition: none;
    }
    
    .yuva-category-card:hover,
    .yuva-product-card:hover {
        transform: none;
    }
}

/* ========================================
   DARK MODE DESTEĞI
   ======================================== */

@media (prefers-color-scheme: dark) {
    .yuva-category-card,
    .yuva-product-card {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .yuva-category-name,
    .yuva-product-title {
        color: #ecf0f1;
    }
    
    .yuva-category-description {
        color: #bdc3c7;
    }
    
    .yuva-products-title {
        color: #ecf0f1;
    }
    
    .yuva-carousel-container .swiper-button-next,
    .yuva-carousel-container .swiper-button-prev {
        background: #34495e;
        border-color: #495057;
        color: #ecf0f1;
    }
    
    .yyc-no-products {
        background: #34495e;
        color: #bdc3c7;
    }
}

/* ========================================
   MARGIN CONTROL CLASSES
   ======================================== */

/* Default margin override sınıfları */
.yuva-carousel-wrapper.no-margin {
    margin-top: 0;
    margin-bottom: 0;
}

.yuva-carousel-wrapper.small-margin {
    margin-top: 20px;
    margin-bottom: 20px;
}

.yuva-carousel-wrapper.medium-margin {
    margin-top: 40px;
    margin-bottom: 40px;
}

.yuva-carousel-wrapper.large-margin {
    margin-top: 60px;
    margin-bottom: 60px;
}

.yuva-carousel-wrapper.xl-margin {
    margin-top: 80px;
    margin-bottom: 80px;
}

/* Custom margin sınıfları */
.yuva-carousel-wrapper.custom-margin-top {
    margin-top: var(--custom-margin-top, 40px);
}

.yuva-carousel-wrapper.custom-margin-bottom {
    margin-bottom: var(--custom-margin-bottom, 40px);
}

/* Responsive margin ayarları */
@media (max-width: 768px) {
    .yuva-carousel-wrapper {
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .yuva-carousel-wrapper.large-margin,
    .yuva-carousel-wrapper.xl-margin {
        margin-top: 30px;
        margin-bottom: 30px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .yuva-carousel-container .swiper-button-next,
    .yuva-carousel-container .swiper-button-prev,
    .yuva-carousel-container .swiper-pagination {
        display: none !important;
    }
    
    .yuva-carousel-container {
        flex-direction: column;
    }
    
    .yuva-carousel-container .swiper-slide {
        break-inside: avoid;
    }
}
