/**
 * Sepet Widget Stilleri
 * 
 * Sepet dropdown ve ilgili bileşenlerin stilleri
 * 
 * Dosya Yolu: Assets/style/cart-widget.css
 */

/* ============================================
   SEPET BUTONU
   ============================================ */

.cart-btn {
    position: relative;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: none;
    color: #000;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.5);
    background: linear-gradient(135deg, #ffca28 0%, #ffa726 100%);
}

.cart-btn i {
    font-size: 1.2rem;
}

/* Sepet sayacı badge */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Sepet sayacı güncelleme animasyonu */
.cart-count-updated {
    animation: cartBounce 0.3s ease;
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ============================================
   SEPET DROPDOWN
   ============================================ */

.cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    margin-top: 10px;
    width: 380px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1050;
    display: none;
    animation: dropdownSlideIn 0.3s ease;
}

.cart-dropdown.show {
    display: block;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown header */
.cart-dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.cart-dropdown-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

/* Dropdown body */
.cart-dropdown-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
}

/* Custom scrollbar */
.cart-dropdown-body::-webkit-scrollbar {
    width: 6px;
}

.cart-dropdown-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cart-dropdown-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.cart-dropdown-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   SEPET ÖĞELERİ
   ============================================ */

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-dropdown-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cart-dropdown-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.cart-dropdown-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-dropdown-item h6 {
    font-size: 0.875rem;
    margin-bottom: 4px;
    color: #212529;
    line-height: 1.3;
}

.cart-dropdown-item .text-muted {
    font-size: 0.75rem;
}

.cart-dropdown-item .btn-link {
    font-size: 0.875rem;
    text-decoration: none;
}

.cart-dropdown-item .btn-link:hover {
    text-decoration: underline;
}

/* Boş sepet durumu */
.cart-empty {
    padding: 40px 20px;
}

.cart-empty i {
    opacity: 0.5;
}

.cart-empty p {
    margin: 16px 0;
    font-size: 1rem;
}

/* ============================================
   SEPET FOOTER
   ============================================ */

.cart-dropdown-footer {
    padding: 16px 20px;
    border-top: 2px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.cart-dropdown-footer strong {
    font-size: 1.1rem;
}

.cart-dropdown-footer .text-warning {
    color: #ffc107 !important;
    font-size: 1.2rem;
}

.cart-dropdown-footer .btn {
    font-weight: 600;
    transition: all 0.2s ease;
}

.cart-dropdown-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ============================================
   RESPONSIVE TASARIM
   ============================================ */

@media (max-width: 768px) {
    .cart-dropdown {
        width: 340px;
        right: 0;
        left: auto;
        transform: translateX(0);
    }
    
    .cart-dropdown-body {
        max-height: 300px;
    }
    
    .cart-dropdown-item img {
        height: 50px;
    }
}

@media (max-width: 480px) {
    .cart-dropdown {
        position: fixed;
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        margin-top: 0;
    }
    
    .cart-btn {
        padding: 6px 12px;
    }
    
    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

/* ============================================
   BOOTSTRAP DROPDOWN OVERRIDE
   ============================================ */

.dropdown-menu.cart-dropdown-menu {
    width: 380px;
    max-width: 90vw;
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    margin-top: 10px;
    right: 0;
    left: auto;
}

.dropdown-menu.cart-dropdown-menu .dropdown-item {
    padding: 0;
    border: none;
}

/* Mobile cart dropdown positioning fix */
@media (max-width: 768px) {
    .dropdown-menu.cart-dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        transform: none !important;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

.cart-loading {
    text-align: center;
    padding: 40px 20px;
}

.cart-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #ffc107;
}

/* ============================================
   ANIMASYONLAR
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-dropdown-item {
    animation: slideInRight 0.3s ease;
}

/* Her öğe için gecikme */
.cart-dropdown-item:nth-child(1) { animation-delay: 0.05s; }
.cart-dropdown-item:nth-child(2) { animation-delay: 0.1s; }
.cart-dropdown-item:nth-child(3) { animation-delay: 0.15s; }
.cart-dropdown-item:nth-child(4) { animation-delay: 0.2s; }
.cart-dropdown-item:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   TOOLTIP
   ============================================ */

.cart-tooltip {
    position: absolute;
    background: #212529;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1060;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cart-tooltip.show {
    opacity: 1;
}

/* ============================================
   SEPET BADGE (Alternatif stil)
   ============================================ */

.cart-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #212529;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-badge .badge {
    background: #ffc107;
    color: #000;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}
