/* Cart Styles */

/* Cart Icon Badge */
.cart-icon-wrapper {
    position: relative;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #a87b51;
    color: white;
    border-radius: 50%;
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 1.2rem;
    height: 1.2rem;
    text-align: center;
    line-height: 0.8rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Cart Dropdown */
.cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.cart-icon-wrapper:hover .cart-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-dropdown-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.cart-dropdown-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.cart-items {
    max-height: 320px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.cart-item:hover {
    background-color: #f8f9fa;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 5px 0;
    color: #212529;
}

.cart-item-price {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

.cart-item-quantity {
    color: #6c757d;
    font-size: 0.8rem;
}

.cart-item-remove {
    color: #dc3545;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.cart-item-remove:hover {
    color: #bd2130;
}

.cart-dropdown-footer {
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

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

.cart-total-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
}

.cart-total-price {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.btn-checkout {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    background-color: #a87b51;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.btn-checkout:hover {
    background-color: #8a6642;
    color: white;
    text-decoration: none;
}

.btn-view-cart {
    display: block;
    width: 100%;
    padding: 8px;
    text-align: center;
    background-color: transparent;
    color: #212529;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-view-cart:hover {
    background-color: #f8f9fa;
    color: #212529;
    text-decoration: none;
}

.cart-empty {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    max-width: 320px;
    width: 100%;
    text-align: center;
}

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

.cart-notification-title {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.cart-notification-message {
    margin: 0 0 15px 0;
    color: #6c757d;
}

.cart-notification-actions {
    display: flex;
    justify-content: space-between;
}

.cart-notification-btn {
    flex: 1;
    margin: 0 5px;
    padding: 8px;
    text-align: center;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.cart-notification-btn.primary {
    background-color: #a87b51;
    color: white;
    border: none;
}

.cart-notification-btn.primary:hover {
    background-color: #8a6642;
    color: white;
}

.cart-notification-btn.secondary {
    background-color: transparent;
    color: #212529;
    border: 1px solid #ced4da;
}

.cart-notification-btn.secondary:hover {
    background-color: #f8f9fa;
    color: #212529;
}

/* Animation for adding to cart */
.btn-added {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.cart-badge.pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cart-dropdown {
        width: 280px;
    }
}

@media (max-width: 576px) {
    .cart-notification {
        max-width: 90%;
    }
}
