/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.cart-modal.active {
    right: 0;
}

.cart-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
}

.cart-header {
    padding: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-cart:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: #ddd #fff;
}

.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #fff;
}

.cart-items::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 3px;
}

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

.empty-cart i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ddd;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.cart-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.item-image {
    width: 100px;
    height: 100px;
    margin-left: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    background: #f8f9fa;
}

.dorsa-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
}

.dorsa-placeholder span {
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    letter-spacing: 1px;
}

.cart-item:hover .item-image {
    transform: scale(1.05);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-details h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.item-meta span {
    background: rgba(0, 0, 0, 0.04);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.item-meta span i {
    font-size: 1rem;
    color: #666;
}

.item-price {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    margin-top: 8px;
}

.item-quantity {
    display: flex;
    align-items: center;
    margin: 15px 0;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 10px;
    width: fit-content;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: inherit;
    /* border-radius: 8px; */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); */
}

/* .quantity-btn:hover {
    background: #f0f0f0;
    color: #333;
    transform: translateY(-1px);
} */

.quantity-btn:active {
    transform: translateY(0);
}

.quantity {
    margin: 0 15px;
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.remove-item {
    position: absolute;
    top: 8px;
    left: 8px;
    border: none;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.cart-footer {
    padding: 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.cart-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.clear-cart-btn {
    flex: 1;
    padding: 12px;
    background: #f8f9fa;
    color: #dc3545;
    border: 1px solid #dc3545;
    /* border-radius: 10px; */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-cart-btn i {
    margin-left: 8px;
    font-size: 1.1rem;
}

.clear-cart-btn:hover {
    background: #dc3545;
    color: #fff;
    transform: translateY(-2px);
}

.clear-cart-btn:active {
    transform: translateY(0);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.total-price {
    font-weight: 700;
    color: #333;
    font-size: 1.3rem;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: #FFDB58;
    color: #333;
    border: none;
    /* border-radius: 10px; */
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 219, 88, 0.3);
}

.checkout-btn i {
    margin-left: 10px;
    font-size: 1.2rem;
}

.checkout-btn:hover {
    background: #f4d03f;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 219, 88, 0.4);
}

.checkout-btn:active {
    transform: translateY(0);
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(255, 68, 68, 0.3);
}

.cart-badge.show {
    opacity: 1;
    transform: scale(1);
}

.cart-badge.pulse {
    animation: pulse 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Add to Cart Message */
.add-to-cart-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    animation: slideDown 0.3s ease-out;
    border-right: 4px solid #FFDB58;
    min-width: 300px;
    max-width: 90%;
}

.add-to-cart-message .message-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-to-cart-message .message-icon {
    font-size: 1.2rem;
}

.add-to-cart-message .message-text {
    font-size: 0.95rem;
    color: #333;
}

.add-to-cart-message .close-message {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    margin-right: -5px;
}

.add-to-cart-message .close-message:hover {
    color: #333;
}

.add-to-cart-message.success {
    background-color: #28a745;
    border-right-color: #28a745;
}

.add-to-cart-message.success .message-content {
    color: #fff;
}

.add-to-cart-message.success .message-icon {
    color: #fff;
}

.add-to-cart-message.success .message-text {
    color: #fff;
}

.add-to-cart-message.success .close-message {
    color: #fff;
}

.add-to-cart-message.success .close-message:hover {
    color: rgba(255, 255, 255, 0.8);
}

.add-to-cart-message.error {
    background-color: #dc3545;
    border-right-color: #dc3545;
}

.add-to-cart-message.error .message-content {
    color: #fff;
}

.add-to-cart-message.error .message-icon {
    color: #fff;
}

.add-to-cart-message.error .message-text {
    color: #fff;
}

.add-to-cart-message.error .close-message {
    color: #fff;
}

.add-to-cart-message.error .close-message:hover {
    color: rgba(255, 255, 255, 0.8);
}

.add-to-cart-message.info {
    border-right-color: #17a2b8;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .add-to-cart-message {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
        max-width: none;
    }

    @keyframes slideDown {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

/* Stock Warning */
.stock-warning {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stock-warning i {
    font-size: 1rem;
}

/* Quantity Disabled State */
.quantity-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-modal {
        width: 100%;
        right: -100%;
        top: 0;
        height: 100vh;
        background: #fff;
        z-index: 1000;
    }

    .cart-modal.active {
        right: 0;
    }

    .cart-modal-content {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .cart-header {
        padding: 15px;
        background: #fff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .cart-header h3 {
        font-size: 1.2rem;
    }

    .cart-items {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        background: #f8f9fa;
    }

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

    .item-image {
        width: 80px;
        height: 80px;
        margin-left: 15px;
    }

    .item-details h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .item-meta {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .item-meta span {
        padding: 5px 10px;
    }

    .item-price {
        font-size: 1rem;
    }

    .item-quantity {
        margin: 10px 0;
        padding: 6px;
    }

    .quantity-btn {
        width: 32px;
        height: 32px;
    }

    .quantity {
        margin: 0 12px;
        font-size: 1rem;
    }

    .remove-item {
        width: 48px;
        height: 48px;
        padding: 14px;
        top: 4px;
        right: 4px;
    }

    .cart-footer {
        padding: 15px;
        background: #fff;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        position: sticky;
        bottom: 0;
        z-index: 2;
    }

    .cart-actions {
        margin-bottom: 10px;
    }

    .clear-cart-btn {
        padding: 10px;
        font-size: 0.9rem;
    }

    .cart-total {
        margin-bottom: 15px;
        padding: 12px;
        font-size: 1.1rem;
    }

    .total-price {
        font-size: 1.2rem;
    }

    .checkout-btn {
        padding: 12px;
        font-size: 1rem;
    }

    /* Remove the display: none for mobile */
    .cart-modal {
        display: flex !important;
    }

    .dorsa-placeholder span {
        font-size: 1rem;
    }
}

/* Loading Animation */
.cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.cart-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FFDB58;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty Cart Animation */
.empty-cart {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Toast */
.mobile-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #fff;
    color: #333;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    width: 90%;
    max-width: 350px;
    text-align: right;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mobile-toast i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mobile-toast span {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Mobile Toast Types */
.mobile-toast.success {
    border-right: 4px solid #4CAF50;
}

.mobile-toast.success i {
    color: #4CAF50;
}

.mobile-toast.error {
    border-right: 4px solid #dc3545;
}

.mobile-toast.error i {
    color: #dc3545;
}

.mobile-toast.info {
    border-right: 4px solid #17a2b8;
}

.mobile-toast.info i {
    color: #17a2b8;
}

.color-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-sample {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .color-sample {
        width: 14px;
        height: 14px;
    }

    .product-colors .color-circle {
        width: 28px;
        height: 28px;
        margin: 0 8px;
    }
} 