.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.product-card {
    background: var(--card-background);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.sold-out-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-info {
    padding: 20px;
    text-align: center;
}

.product-info h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.product-info p {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 15px;
    height: 45px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Cart & Checkout */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table th, .cart-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #444;
}

.btn-remove {
    background: #ff4444;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
}

.cart-total {
    text-align: right;
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.checkout-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-background);
    padding: 30px;
    border-radius: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    background: #333;
    border: 1px solid #444;
    color: #fff;
    border-radius: 8px;
}

/* Success Modal */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #222;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--primary-color);
}

.check-icon {
    font-size: 80px;
    color: #4CAF50;
    margin-bottom: 20px;
}

.cart-icon-wrapper {
    position: relative;
    margin-left: 15px;
}

#cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--primary-color);
    color: #000;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Mobile adjustments for cart icon */
@media (max-width: 768px) {
    .cart-icon-wrapper {
        margin-left: 0 !important;
        margin-right: 10px !important;
    }
    
    /* Ensure the container of cart and language switch is positioned correctly */
    header div[style*="display: flex"] {
        margin-left: auto !important;
        margin-right: 10px !important;
    }
    
    /* For RTL (Arabic) version */
    html[dir="rtl"] .cart-icon-wrapper {
        margin-right: 0 !important;
        margin-left: 10px !important;
    }
    
    html[dir="rtl"] header div[style*="display: flex"] {
        margin-right: auto !important;
        margin-left: 10px !important;
    }
}
