/**
 * Modern Cart System CSS
 * Güzel ve responsive sepet tasarımı
 */

/* Cart Toggle Button */
.cart-toggle {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-toggle:hover {
    color: var(--primary-color) !important;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.75rem;
    line-height: 18px;
    text-align: center;
    animation: cartBounce 0.3s ease;
}

@keyframes cartBounce {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Cart Dropdown */
.cart-dropdown {
    position: relative;
    display: inline-block;
}

.cart-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 450px;
    overflow-y: auto;
    background: rgba(15, 20, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 150, 255, 0.15);
    border-radius: 16px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(100, 150, 255, 0.1);
    margin-top: 12px;
    padding: 16px;
}

/* Dropdown click ile açılacak */
.cart-dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Empty State */
.cart-empty-state {
    text-align: center;
    padding: 30px 15px;
}

.cart-empty-state i {
    font-size: 2.5rem;
    color: rgba(100, 150, 255, 0.4);
    margin-bottom: 12px;
    display: block;
}

.cart-empty-state p {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.cart-browse-btn {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cart-browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    color: #fff;
}

/* Cart Items */
.cart-items-list {
    max-height: 200px;
    overflow-y: auto;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.cart-item-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.cart-item-qty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-price {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 100, 100, 0.1);
    color: #ff6b6b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s ease;
}

.cart-remove-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    transform: scale(1.1);
}

/* Footer */
.cart-footer-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
    margin-top: 8px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cart-total-row span:first-child {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.cart-total-price {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.cart-clear-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: rgba(255, 100, 100, 0.8);
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-clear-btn:hover {
    background: rgba(255, 100, 100, 0.1);
    border-color: rgba(255, 100, 100, 0.5);
}

.cart-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1050;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.show {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

body.cart-open {
    overflow: hidden;
}

/* Cart Header */
.cart-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h5 {
    color: #fff;
    margin: 0;
    font-weight: 600;
}

.cart-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cart-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Cart Body */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Empty Cart */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.cart-empty i {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
}

/* Cart Items */
.cart-items {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.cart-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.cart-item-info {
    margin-bottom: 10px;
}

.cart-item-name {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 5px;
}

.cart-quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.cart-quantity-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.quantity {
    color: #fff;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.remove-from-cart {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0;
    border: 1px solid rgba(220, 53, 69, 0.3);
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    transition: all 0.3s ease;
}

.remove-from-cart:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
    color: #dc3545;
}

/* Cart Footer */
.cart-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: 20px;
}

.cart-total {
    text-align: center;
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.cart-total span {
    color: var(--primary-color);
}

/* Cart Notifications */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    color: #fff;
    z-index: 1060;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cart-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.cart-notification-success {
    border-left: 4px solid #28a745;
}

.cart-notification-warning {
    border-left: 4px solid #ffc107;
}

.cart-notification-error {
    border-left: 4px solid #dc3545;
}

.cart-notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-content {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

/* Button States */
.add-to-cart {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.add-to-cart.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    border-color: #28a745;
}

.add-to-cart.btn-success:hover {
    background: linear-gradient(45deg, #218838, #1ea080);
    border-color: #1e7e34;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }

    .cart-sidebar.show {
        right: 0;
    }

    .cart-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cart-header {
        padding: 15px;
    }

    .cart-body {
        padding: 15px;
    }

    .cart-item {
        padding: 12px;
    }

    .cart-item-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .quantity-controls {
        justify-content: center;
    }
}

/* Loading States */
.cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
}

.cart-loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Smooth Animations */
.cart-item {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}